diff options
author | André Klitzing <aklitzing@gmail.com> | 2020-10-26 09:59:17 +0100 |
---|---|---|
committer | André Klitzing <aklitzing@gmail.com> | 2020-10-31 20:59:27 +0100 |
commit | 71223cc92ba1039f0dfde1bb30d3cccdab30c4dd (patch) | |
tree | 3d9e2882b90239bcce746e826bdb8adf239ef9f7 /src | |
parent | d4cd1bf861b87e827793e316bc8fd3930b8caedf (diff) |
Use (void) instead of Q_UNUSED
This change allows the user to use -Wextra-semi-stmt without a warning.
A macro should never include a ; by it's own. Macro Q_UNUSED already
adds semicolon.
Fixes: QTBUG-82978
Pick-to: 5.15
Change-Id: I6d8d009cf89f0c8bbb6a9fee986e81302ebd7459
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/moc/generator.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index c49419c530..9a1998e764 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -1123,7 +1123,7 @@ void Generator::generateStaticMetacall() } else { fprintf(out, " auto *_t = reinterpret_cast<%s *>(_o);\n", cdef->classname.constData()); } - fprintf(out, " Q_UNUSED(_t)\n"); + fprintf(out, " (void)_t;\n"); fprintf(out, " switch (_id) {\n"); for (int methodindex = 0; methodindex < methodList.size(); ++methodindex) { const FunctionDef &f = methodList.at(methodindex); @@ -1233,7 +1233,7 @@ void Generator::generateStaticMetacall() fprintf(out, " }\n }\n"); } if (!anythingUsed) - fprintf(out, " Q_UNUSED(result);\n"); + fprintf(out, " (void)result;\n"); fprintf(out, " }"); needElse = true; } @@ -1295,7 +1295,7 @@ void Generator::generateStaticMetacall() } else { fprintf(out, " auto *_t = reinterpret_cast<%s *>(_o);\n", cdef->classname.constData()); } - fprintf(out, " Q_UNUSED(_t)\n"); + fprintf(out, " (void)_t;\n"); }; if (needGet) { @@ -1427,14 +1427,14 @@ void Generator::generateStaticMetacall() fprintf(out, "\n"); if (methodList.isEmpty()) { - fprintf(out, " Q_UNUSED(_o);\n"); + fprintf(out, " (void)_o;\n"); if (cdef->constructorList.isEmpty() && automaticPropertyMetaTypes.isEmpty() && methodsWithAutomaticTypesHelper(methodList).isEmpty()) { - fprintf(out, " Q_UNUSED(_id);\n"); - fprintf(out, " Q_UNUSED(_c);\n"); + fprintf(out, " (void)_id;\n"); + fprintf(out, " (void)_c;\n"); } } if (!isUsed_a) - fprintf(out, " Q_UNUSED(_a);\n"); + fprintf(out, " (void)_a;\n"); fprintf(out, "}\n\n"); } |