Skip to content

Commit

Permalink
Reduced number of compiler warnings (#1076)
Browse files Browse the repository at this point in the history
* Reduced number of compiler warnings
  • Loading branch information
psolstice authored Oct 4, 2021
1 parent aa9cf80 commit d62dccf
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 15 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ if test "x$CXXFLAGS_overridden" = "xno"; then
AX_CHECK_COMPILE_FLAG([-Wself-assign],[CXXFLAGS="$CXXFLAGS -Wno-self-assign"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wunused-local-typedef],[CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedef"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wdeprecated-register],[CXXFLAGS="$CXXFLAGS -Wno-deprecated-register"],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-Wdeprecated-copy],[CXXFLAGS="$CXXFLAGS -Wno-deprecated-copy"],,[[$CXXFLAG_WERROR]])
fi
CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"

Expand Down
1 change: 0 additions & 1 deletion src/amount.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class CFeeRate
explicit CFeeRate(const CAmount& _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { }
/** Constructor for a fee rate in satoshis per kB. The size in bytes must not exceed (2^63 - 1)*/
CFeeRate(const CAmount& nFeePaid, size_t nBytes);
CFeeRate(const CFeeRate& other) { nSatoshisPerK = other.nSatoshisPerK; }
/**
* Return the fee in satoshis for the given size in bytes.
*/
Expand Down
4 changes: 4 additions & 0 deletions src/bls-signatures/contrib/relic/include/relic_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
* @param[in] B - the second number.
* @returns - the smaller number.
*/
#ifndef MIN
#define MIN(A, B) ((A) < (B) ? (A) : (B))
#endif

/**
* Returns the maximum between two numbers.
Expand All @@ -59,7 +61,9 @@
* @param[in] B - the second number.
* @returns - the bigger number.
*/
#ifndef MAX
#define MAX(A, B) ((A) > (B) ? (A) : (B))
#endif

/**
* Splits a bit count in a digit count and an updated bit count.
Expand Down
2 changes: 2 additions & 0 deletions src/bls-signatures/src/publickey.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class PublicKey {
// Don't allow public construction, force static methods
PublicKey();

PublicKey& operator=(const PublicKey &) = default;

private:
// Exponentiate public key with n
PublicKey Exp(const bn_t n) const;
Expand Down
4 changes: 3 additions & 1 deletion src/bls/bls.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class CBLSWrapper
}

CBLSWrapper(const CBLSWrapper& ref) = default;
CBLSWrapper& operator=(const CBLSWrapper& ref) = default;
constexpr CBLSWrapper& operator=(const CBLSWrapper& ref) = default;
CBLSWrapper(CBLSWrapper&& ref)
{
std::swap(impl, ref.impl);
Expand Down Expand Up @@ -213,6 +213,8 @@ class CBLSWrapper
GetBuf(buf);
return HexStr(buf.begin(), buf.end());
}

virtual ~CBLSWrapper() = default;
};

class CBLSId : public CBLSWrapper<uint256, BLS_CURVE_ID_SIZE, CBLSId>
Expand Down
2 changes: 1 addition & 1 deletion src/elysium/sigmawallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ bool SigmaWallet::MintPoolEntry::operator!=(MintPoolEntry const &another) const
}

SigmaWallet::SigmaWallet(Database *database)
: walletFile(pwalletMain->strWalletFile), database(database)
: database(database), walletFile(pwalletMain->strWalletFile)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/hdmint/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @param strWalletFile wallet file string
* @return CHDMintWallet object
*/
CHDMintWallet::CHDMintWallet(const std::string& strWalletFile, bool resetCount) : tracker(strWalletFile), strWalletFile(strWalletFile)
CHDMintWallet::CHDMintWallet(const std::string& strWalletFile, bool resetCount) : strWalletFile(strWalletFile), tracker(strWalletFile)
{
this->mintPool = CMintPool();

Expand Down
5 changes: 3 additions & 2 deletions src/lelantus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1184,9 +1184,10 @@ void CLelantusState::Containers::CheckSurgeCondition() {
CLelantusState::CLelantusState(
size_t maxCoinInGroup,
size_t startGroupSize)
:containers(surgeCondition),
:
maxCoinInGroup(maxCoinInGroup),
startGroupSize(startGroupSize)
startGroupSize(startGroupSize),
containers(surgeCondition)
{
Reset();
}
Expand Down
4 changes: 2 additions & 2 deletions src/liblelantus/joinsplit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ JoinSplit::JoinSplit(const Params *p,
unsigned int nVersion)
:
params (p),
fee (fee),
version (nVersion) {
version (nVersion),
fee (fee) {

serialNumbers.reserve(Cin.size());
for(size_t i = 0; i < Cin.size(); i++) {
Expand Down
4 changes: 2 additions & 2 deletions src/qt/automintnotification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

AutomintNotification::AutomintNotification(QWidget *parent) :
QDialog(parent),
lelantusModel(nullptr),
ui(new Ui::AutomintNotification)
ui(new Ui::AutomintNotification),
lelantusModel(nullptr)
{
ui->setupUi(this);
ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Anonymize"));
Expand Down
4 changes: 2 additions & 2 deletions src/qt/lelantuscoincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ LelantusCoinControlDialog::LelantusCoinControlDialog(
const PlatformStyle *_platformStyle,
QWidget *parent) :
QDialog(parent),
storage(_storage),
ui(new Ui::CoinControlDialog),
model(0),
platformStyle(_platformStyle),
storage(_storage)
platformStyle(_platformStyle)
{
ui->setupUi(this);

Expand Down
6 changes: 3 additions & 3 deletions src/qt/masternodelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

MasternodeList::MasternodeList(const PlatformStyle* platformStyle, QWidget* parent) :
QWidget(parent),
nTimeFilterUpdatedDIP3(0),
nTimeUpdatedDIP3(0),
fFilterUpdatedDIP3(true),
ui(new Ui::MasternodeList),
clientModel(0),
walletModel(0),
fFilterUpdatedDIP3(true),
nTimeFilterUpdatedDIP3(0),
nTimeUpdatedDIP3(0),
mnListChanged(true)
{
ui->setupUi(this);
Expand Down

0 comments on commit d62dccf

Please sign in to comment.