Skip to content

Commit

Permalink
Merge bitcoin#1027: [Cleanup] Get rid of compiler warnings
Browse files Browse the repository at this point in the history
18f6d04 [Trivial] Get rid of compiler warnings (random-zebra)

Pull request description:

  This removes a few compiler warnings:

  uninitialized variables:
  <code>
  init.cpp:1620:47: warning: ‘nStart’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  </code>
  <strike>
  leveldb/port/port_posix.cc:60:15: warning: ‘ecx’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  </strike>
  <br>

  signed/unsigned int comparison:
  <code>
  wallet/wallet.cpp:2446:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  </code>
  <code>
  utilstrencodings.cpp:58:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  </code>
  <br>

  variables defined/set but not used
  <strike>
  qt/privacydialog.cpp:710:13: warning: variable ‘nLockedBalance’ set but not used [-Wunused-but-set-variable]
  </strike>
  <code>
  ./qt/pivx/qtutils.h:22:21: warning: ‘SHORT_KEY’ defined but not used [-Wunused-variable]
  </code>

ACKs for top commit:
  furszy:
    ACK 18f6d04
  Fuzzbawls:
    ACK 18f6d04

Tree-SHA512: 46830addd7a21b07e46a9eb53354d50b51d3846b590925e524f68b92cbc8cd71f8b29fca5ab8e399f300164e7f895d634ff794a6f55bfa097a7ec54a54084743
  • Loading branch information
random-zebra committed Sep 30, 2019
2 parents 968000b + 18f6d04 commit 569ac5e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1094,8 +1094,6 @@ bool AppInit2()
return InitError(_("Unable to start HTTP server. See debug log for details."));
}

int64_t nStart;

// ********************************************************* Step 5: Backup wallet and verify wallet database integrity
#ifdef ENABLE_WALLET
if (!fDisableWallet) {
Expand Down Expand Up @@ -1411,6 +1409,7 @@ bool AppInit2()
nCoinCacheSize = nTotalCache / 300; // coins in memory require around 300 bytes

bool fLoaded = false;
int64_t nStart = GetTimeMillis();
while (!fLoaded && !ShutdownRequested()) {
bool fReset = fReindex;
std::string strLoadError;
Expand Down
9 changes: 8 additions & 1 deletion src/qt/pivx/qtutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
#include <QListView>
#include <QGraphicsDropShadowEffect>

Qt::Modifier SHORT_KEY
#ifdef Q_OS_MAC
= Qt::CTRL;
#else
= Qt::ALT;
#endif

// Open dialog at the bottom
bool openDialog(QDialog *widget, QWidget *gui){
widget->setWindowFlags(Qt::CustomizeWindowHint);
Expand Down Expand Up @@ -249,4 +256,4 @@ void forceUpdateStyle(QWidget *widget, bool forceUpdate){

void forceUpdateStyle(std::initializer_list<QWidget*> args){
foreach (QWidget* w, args) { forceUpdateStyle(w, true); }
}
}
7 changes: 1 addition & 6 deletions src/qt/pivx/qtutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
#include <initializer_list>
#include "qt/pivx/pivxgui.h"

static Qt::Modifier SHORT_KEY
#ifdef Q_OS_MAC
= Qt::CTRL;
#else
= Qt::ALT;
#endif
extern Qt::Modifier SHORT_KEY;

bool openDialog(QDialog *widget, QWidget *gui);
void closeDialog(QDialog *widget, PIVXGUI *gui);
Expand Down
2 changes: 1 addition & 1 deletion src/utilstrencodings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ bool validateURL(std::string strURL, std::string& strErr, unsigned int maxSize)

// check fronts
bool found = false;
for (int i=0; i < reqPre.size() && !found; i++) {
for (int i=0; i < (int) reqPre.size() && !found; i++) {
if (strURL.find(reqPre[i]) == 0) found = true;
}
if ((!found) && (reqPre.size() > 0)) {
Expand Down
2 changes: 1 addition & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2435,7 +2435,7 @@ bool CWallet::CreateCoinStake(
CAmount nMinFee = 0;
if (!stakeInput->IsZPIV()) {
// Set output amount
unsigned int outputs = txNew.vout.size() - 1;
int outputs = txNew.vout.size() - 1;
CAmount nRemaining = nCredit - nMinFee;
if (outputs > 1) {
// Split the stake across the outputs
Expand Down

0 comments on commit 569ac5e

Please sign in to comment.