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 <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Kai Koehne 2015-01-07 14:52:28 +01:00
parent 0a76b6bc7f
commit 8836a4d5f0

View File

@ -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 <ogoffart@woboq.com>
** 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);