From d790162ce38c3f8cbc8805fcd9298443d00c820f Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 17 Dec 2013 07:33:39 +0100 Subject: [PATCH] Fix compiler warnings in auto-generated mkclass code. Refs #5349 --- tools/mkclass/classcompiler.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/mkclass/classcompiler.cpp b/tools/mkclass/classcompiler.cpp index 561ac74c0..6b57a8625 100644 --- a/tools/mkclass/classcompiler.cpp +++ b/tools/mkclass/classcompiler.cpp @@ -149,15 +149,18 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo& locp) /* StaticGetFieldId */ std::cout << "\t" << "static int StaticGetFieldId(const String& name)" << std::endl - << "\t" << "{" << std::endl - << "\t\t" << "int offset = "; + << "\t" << "{" << std::endl; - if (!klass.Parent.empty()) - std::cout << "TypeImpl<" << klass.Parent << ">::StaticGetFieldCount()"; - else - std::cout << "0"; + if (!klass.Fields.empty()) { + std::cout << "\t\t" << "int offset = "; - std::cout << ";" << std::endl << std::endl; + if (!klass.Parent.empty()) + std::cout << "TypeImpl<" << klass.Parent << ">::StaticGetFieldCount()"; + else + std::cout << "0"; + + std::cout << ";" << std::endl << std::endl; + } std::map > > jumptable;