diff options
author | Luciano Wolf <luciano.wolf@openbossa.org> | 2010-07-21 17:01:58 -0300 |
---|---|---|
committer | Luciano Wolf <luciano.wolf@openbossa.org> | 2010-07-21 17:10:48 -0300 |
commit | 10828a918d387d34cafb8709cea18f02d1af7af2 (patch) | |
tree | 07163d8c84dacb3a919f892edc3746cc68064a72 | |
parent | b47c32c81fca966740f790992f1b00f23bf49ada (diff) |
Fix error message, avoiding segfaults when dealing with primitive types.
Reviewer: Renato Araújo <renato.filho@openbossa.org>
Marcelo Lira <marcelo.lira@openbossa.org>
-rw-r--r-- | cppgenerator.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp index 23d9ee15d..5e7af0e06 100644 --- a/cppgenerator.cpp +++ b/cppgenerator.cpp @@ -583,7 +583,10 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu if (metaEnum && metaEnum->isProtected()) typeName = protectedEnumSurrogateName(metaEnum); #endif - desiredType = "SbkType<" + typeName + " >()->tp_name"; + if (func->type()->isPrimitive()) + desiredType = "\"" + func->type()->name() + "\""; + else + desiredType = "SbkType<" + typeName + " >()->tp_name"; } } else { s << guessCPythonCheckFunction(func->typeReplaced(0)); |