From 8836a4d5f0fbbbf18565e8dc64ab89e95a39720f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 7 Jan 2015 14:52:28 +0100 Subject: moc: Work around 'unused variable' MSVC warning MSVC prints warnings if all slots are actually static methods: moc_xxx.cpp:71: warning: C4189: '_t' : local variable is initialized but not referenced This can be easily avoided by using Q_UNUSED. Change-Id: Ice134a8a8d3e6aef1df1e7a89e9a2867281580fd Reviewed-by: Friedemann Kleint Reviewed-by: Olivier Goffart --- src/tools/moc/generator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/tools/moc') diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index fcc43aca68..2c41b17b68 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +** Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). ** Copyright (C) 2013 Olivier Goffart ** Contact: http://www.qt-project.org/legal ** @@ -1153,6 +1153,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 methodindex = 0; methodindex < methodList.size(); ++methodindex) { const FunctionDef &f = methodList.at(methodindex); -- cgit v1.2.3