|
From: Robert L. <rle...@us...> - 2007-03-28 16:37:32
|
Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/CppGenerator In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv21733/src/ccmtools/CppGenerator Modified Files: CppLocalGenerator.java Log Message: bug fix: wrong default ctor for structures Index: CppLocalGenerator.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/CppGenerator/CppLocalGenerator.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** CppLocalGenerator.java 26 Feb 2007 15:30:14 -0000 1.59 --- CppLocalGenerator.java 28 Mar 2007 16:37:27 -0000 1.60 *************** *** 32,36 **** import java.util.Set; import java.util.logging.Logger; - import ccmtools.CcmtoolsException; import ccmtools.CodeGenerator.Template; --- 32,35 ---- *************** *** 1219,1239 **** protected String generateDefaultValue(MIDLType type) { ! if(type instanceof MInterfaceDef) ! { ! MInterfaceDef iface = (MInterfaceDef)type; ! return getLocalCxxName(iface,Text.SCOPE_SEPARATOR) + "::SmartPtr()"; ! } ! else if(type instanceof MEnumDef) { ! MEnumDef enumeration = (MEnumDef)type; return enumeration.getMember(0); // Set enum to the first value. } else if(type instanceof MAliasDef) { - MAliasDef alias = (MAliasDef)type; MIDLType idlType = ((MTyped)type).getIdlType(); if(idlType instanceof MSequenceDef) { ! return getLocalCxxName(alias, Text.SCOPE_SEPARATOR) + "()"; } else --- 1218,1232 ---- protected String generateDefaultValue(MIDLType type) { ! if(type instanceof MEnumDef) { ! MEnumDef enumeration = (MEnumDef)type; return enumeration.getMember(0); // Set enum to the first value. } else if(type instanceof MAliasDef) { MIDLType idlType = ((MTyped)type).getIdlType(); if(idlType instanceof MSequenceDef) { ! return null; } else *************** *** 1242,1253 **** } } - else if(type instanceof MStringDef) - { - return "\"\""; - } - else if(type instanceof MWstringDef) - { - return "L\"\""; - } else if(type instanceof MPrimitiveDef) { --- 1235,1238 ---- *************** *** 1257,1268 **** return null; } ! protected String generateDefaultValue(MPrimitiveDef primitive) { ! if(primitive.getKind() == MPrimitiveKind.PK_ANY) ! { ! return " ::wamas::platform::utils::SmartPtr< ::wamas::platform::utils::Value>()"; ! } ! else if(primitive.getKind() == MPrimitiveKind.PK_BOOLEAN) { return "false"; --- 1242,1249 ---- return null; } ! protected String generateDefaultValue(MPrimitiveDef primitive) { ! if(primitive.getKind() == MPrimitiveKind.PK_BOOLEAN) { return "false"; |