From fdcafa35359b3ad9af79d2367a1884d01607fb84 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] --- scripts/qt/extract_strings_qt.py | 12 +++++++++--- src/qt/bitcoinstrings.cpp | 7 ++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/qt/extract_strings_qt.py b/scripts/qt/extract_strings_qt.py index 6627de4..b047869 100755 --- a/scripts/qt/extract_strings_qt.py +++ b/scripts/qt/extract_strings_qt.py @@ -53,9 +53,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/qt/bitcoinstrings.cpp b/src/qt/bitcoinstrings.cpp index 1b0a676..2d77441 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", "Bitcoin version"), +#ifdef __GNUC__ +#define UNUSED __attribute__((unused)) +#else +#define UNUSED +#endif +static const char UNUSED *bitcoin_strings[] = {QT_TRANSLATE_NOOP("bitcoin-core", "Bitcoin version"), QT_TRANSLATE_NOOP("bitcoin-core", "Usage:"), QT_TRANSLATE_NOOP("bitcoin-core", "Send command to -server or bitcoind\n"), QT_TRANSLATE_NOOP("bitcoin-core", "List commands\n"), -- 1.7.1