Fix compiler warnings in auto-generated code.

Refs #5036
This commit is contained in:
Gunnar Beutner 2013-11-08 21:45:27 +01:00
parent ba6f64a0ec
commit 135c2b2309

View File

@ -168,6 +168,7 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo& locp)
std::cout << "\t\t" << "int real_id = id - " << "TypeImpl<" << klass.Parent << ">::StaticGetFieldCount();" << std::endl
<< "\t\t" << "if (real_id < 0) { return " << "TypeImpl<" << klass.Parent << ">::StaticGetFieldInfo(id); }" << std::endl;
if (klass.Fields.size() > 0) {
std::cout << "\t\t" << "switch (";
if (!klass.Parent.empty())
@ -185,8 +186,13 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo& locp)
}
std::cout << "\t\t\t" << "default:" << std::endl
<< "\t\t\t\t" << "throw std::runtime_error(\"Invalid field ID.\");" << std::endl
<< "\t\t" << "}" << std::endl;
<< "\t\t";
}
std::cout << "\t\t" << "throw std::runtime_error(\"Invalid field ID.\");" << std::endl;
if (klass.Fields.size() > 0)
std::cout << "\t\t" << "}" << std::endl;
std::cout << "\t" << "}" << std::endl << std::endl;