From 11cd41652519be7053b16847ffa2a7c7df64b95d Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 15 Apr 2012 12:53:14 +0200 Subject: [PATCH] fix warnings: unused variable 'XX' [-Wunused-variable] --- share/qt/extract_strings_qt.py | 12 +++++++++--- src/net.cpp | 3 --- src/qt/bitcoinstrings.cpp | 7 ++++++- src/script.cpp | 1 - 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/share/qt/extract_strings_qt.py b/share/qt/extract_strings_qt.py index 03d3a1ba37..771f28ab0a 100755 --- a/share/qt/extract_strings_qt.py +++ b/share/qt/extract_strings_qt.py @@ -54,9 +54,15 @@ child = Popen(['xgettext','--output=-','-n','--keyword=_'] + files, stdout=PIPE) messages = parse_po(out) f = open(OUT_CPP, 'w') -f.write('#include \n') -f.write('// Automatically generated by extract_strings.py\n') -f.write('static const char *bitcoin_strings[] = {') +f.write("""#include +// Automatically generated by extract_strings.py +#ifdef __GNUC__ +#define UNUSED __attribute__((unused)) +#else +#define UNUSED +#endif +""") +f.write('static const char UNUSED *bitcoin_strings[] = {') for (msgid, msgstr) in messages: if msgid != EMPTY: f.write('QT_TRANSLATE_NOOP("bitcoin-core", %s),\n' % ('\n'.join(msgid))) diff --git a/src/net.cpp b/src/net.cpp index 8272b25561..b0f365061c 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1233,8 +1233,6 @@ void ThreadOpenConnections2(void* parg) if (fShutdown) return; - bool fAddSeeds = false; - // Add seed nodes if IRC isn't working bool fTOR = (fUseProxy && addrProxy.GetPort() == 9050); if (addrman.size()==0 && (GetTime() - nStart > 60 || fTOR) && !fTestNet) @@ -1260,7 +1258,6 @@ void ThreadOpenConnections2(void* parg) // Choose an address to connect to based on most recently seen // CAddress addrConnect; - int64 nBest = std::numeric_limits::min(); // Only connect to one address per a.b.?.? range. // Do this here so we don't have to critsect vNodes inside mapAddresses critsect. diff --git a/src/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 4fbd9874f5..b25af1a210 100644 --- a/src/qt/bitcoinstrings.cpp +++ b/src/qt/bitcoinstrings.cpp @@ -1,6 +1,11 @@ #include // Automatically generated by extract_strings.py -static const char *bitcoin_strings[] = {QT_TRANSLATE_NOOP("bitcoin-core", "" +#ifdef __GNUC__ +#define UNUSED __attribute__((unused)) +#else +#define UNUSED +#endif +static const char UNUSED *bitcoin_strings[] = {QT_TRANSLATE_NOOP("bitcoin-core", "" "Unable to bind to port %d on this computer. Bitcoin is probably already " "running."), QT_TRANSLATE_NOOP("bitcoin-core", "Warning: Disk space is low "), diff --git a/src/script.cpp b/src/script.cpp index b6f120289a..21f101e1c5 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1443,7 +1443,6 @@ bool ExtractAddresses(const CScript& scriptPubKey, txnouttype& typeRet, vector