From 2748661ddd3033ca3e6bcf3fe16633ab75a598aa Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 13 Apr 2015 15:52:56 +0200 Subject: Work around MSVC warnings about unused variables in moc output Change 8836a4d5f0fbbb already added Q_UNUSED in one place, but that was not enough. Change-Id: Ib98ba3fe47c0903cc01c56fd3eb8461c8938c75e Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: Thiago Macieira --- src/tools/moc/generator.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/tools') diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 46acbc608b..8b6a0519c5 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -1310,6 +1310,7 @@ void Generator::generateStaticMetacall() } else { fprintf(out, " %s *_t = reinterpret_cast<%s *>(_o);\n", cdef->classname.constData(), cdef->classname.constData()); } + fprintf(out, " Q_UNUSED(_t)\n"); if (needTempVarForGet) fprintf(out, " void *_v = _a[0];\n"); fprintf(out, " switch (_id) {\n"); @@ -1355,6 +1356,7 @@ void Generator::generateStaticMetacall() } else { fprintf(out, " %s *_t = reinterpret_cast<%s *>(_o);\n", cdef->classname.constData(), cdef->classname.constData()); } + fprintf(out, " Q_UNUSED(_t)\n"); fprintf(out, " void *_v = _a[0];\n"); fprintf(out, " switch (_id) {\n"); for (int propindex = 0; propindex < cdef->propertyList.size(); ++propindex) { @@ -1408,6 +1410,7 @@ void Generator::generateStaticMetacall() } else { fprintf(out, " %s *_t = reinterpret_cast<%s *>(_o);\n", cdef->classname.constData(), cdef->classname.constData()); } + fprintf(out, " Q_UNUSED(_t)\n"); fprintf(out, " switch (_id) {\n"); for (int propindex = 0; propindex < cdef->propertyList.size(); ++propindex) { const PropertyDef &p = cdef->propertyList.at(propindex); -- cgit v1.2.3