[warning-fix][Wformat]
Fix fprintf format specifier warnings
This commit is contained in:
1 parent
5db5ff264e
commit
ec41f80087
4 files changed
+20
-17
No files matched your search
@@ -1942,7 +1942,7 @@ IntNode::STEPwrite(std::string &s, const char *)
|
||||
char tmp[BUFSIZ];
|
||||
if(value != S_INT_NULL)
|
||||
{
|
||||
sprintf(tmp, "%d", value);
|
||||
sprintf(tmp, "%ld", value);
|
||||
s = tmp;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -214,7 +214,7 @@ VARget_simple_name(Variable v)
|
||||
e = e->e.op2;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr,"unexpected op_code (%d) encountered in variable name expression\n",opcode_print(e->e.op_code));
|
||||
fprintf(stderr,"unexpected op_code (%s) encountered in variable name expression\n",opcode_print(e->e.op_code));
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2422,7 +2422,7 @@ MemberFunctionSign (Entity entity, FILE* file)
|
||||
/* //////////////// */
|
||||
if(corba_binding)
|
||||
{
|
||||
fprintf(file, "\n//\t%d_ptr create_TIE();\n\tIDL_Application_instance_ptr create_TIE();\n",
|
||||
fprintf(file, "\n//\t%s_ptr create_TIE();\n\tIDL_Application_instance_ptr create_TIE();\n",
|
||||
ENTITYget_CORBAname(entity));
|
||||
/*
|
||||
fprintf(file, "\n//\t%s_ptr create_TIE();\n\tP26::Application_instance_ptr create_TIE();\n",
|
||||
@@ -2432,7 +2432,7 @@ MemberFunctionSign (Entity entity, FILE* file)
|
||||
fprintf (file, "};\n");
|
||||
if(corba_binding)
|
||||
{
|
||||
fprintf (file, "\n// Associate IDL interface generated code with implementation object\nDEF_TIE_%d(%s)\n", ENTITYget_CORBAname(entity), entnm);
|
||||
fprintf (file, "\n// Associate IDL interface generated code with implementation object\nDEF_TIE_%s(%s)\n", ENTITYget_CORBAname(entity), entnm);
|
||||
}
|
||||
|
||||
/* print creation function for class */
|
||||
@@ -2711,7 +2711,10 @@ get_attribute_number (Entity entity)
|
||||
if (found) return i;
|
||||
else printf ( "Internal error: %s:%d\n"
|
||||
"Attribute %s not found. \n"
|
||||
,__FILE__,__LINE__, VARget_name (a));
|
||||
/* In this case, a is a Variable - so macro VARget_name (a) expands *
|
||||
* to an Expression. The first element of an Expression is a Symbol. *
|
||||
* The first element of a Symbol is char * name. */
|
||||
,__FILE__,__LINE__, VARget_name(a)->symbol.name );
|
||||
}
|
||||
|
||||
LISTod;
|
||||
@@ -3232,7 +3235,7 @@ print_typechain(FILE *f,const Type t,char *buf,Schema schema)
|
||||
case set_:
|
||||
case list_:
|
||||
/* create a new TypeDescriptor variable, e.g. t1, and new space for it */
|
||||
fprintf(f,"\t%d * %s%d = new %d;\n",
|
||||
fprintf(f,"\t%s * %s%d = new %s;\n",
|
||||
GetTypeDescriptorName(t), TD_PREFIX, count,
|
||||
GetTypeDescriptorName(t) );
|
||||
|
||||
@@ -4432,7 +4435,7 @@ TYPEprint_typedefs (Type t, FILE *classes)
|
||||
externln:
|
||||
/* Print the extern statement: */
|
||||
strncpy (nm, TYPEtd_name(t), BUFSIZ);
|
||||
fprintf( classes, "extern %d \t*%s;\n", GetTypeDescriptorName(t), nm );
|
||||
fprintf( classes, "extern %s \t*%s;\n", GetTypeDescriptorName(t), nm );
|
||||
}
|
||||
|
||||
/* return 1 if it is a multidimensional aggregate at the level passed in
|
||||
@@ -4602,7 +4605,7 @@ TYPEprint_descriptions (const Type type, FILES* files, Schema schema)
|
||||
|
||||
/* in source - declare the real definition of the pointer */
|
||||
/* i.e. in the .cc file */
|
||||
fprintf(files -> lib,"%d \t*%s;\n", GetTypeDescriptorName(type), tdnm);
|
||||
fprintf(files -> lib,"%s \t*%s;\n", GetTypeDescriptorName(type), tdnm);
|
||||
|
||||
if(isAggregateType(type)) {
|
||||
const char * ctype = TYPEget_ctype (type);
|
||||
@@ -4941,7 +4944,7 @@ TYPEprint_new (const Type type, FILE *create, Schema schema)
|
||||
case set_:
|
||||
case list_:
|
||||
|
||||
fprintf(create,"\n\t%s = new %d (\n",
|
||||
fprintf(create,"\n\t%s = new %s (\n",
|
||||
TYPEtd_name (type), GetTypeDescriptorName(type));
|
||||
|
||||
/* fill in it's values */
|
||||
|
||||
@@ -570,7 +570,7 @@ TYPEselect_inc_print_vars( const Type type, FILE *f, Linked_List dups)
|
||||
fprintf( f, "/* \tunion { */\n" );
|
||||
fprintf( f, "\t// types in SELECT \n" );
|
||||
LISTdo( SEL_TYPEget_items(type), t, Type )
|
||||
fprintf( f, "\t// %s\t-- %d\n",
|
||||
fprintf( f, "\t// %s\t-- %s\n",
|
||||
SEL_ITEMget_enumtype (t), FundamentalType (t,0));
|
||||
LISTod;
|
||||
|
||||
@@ -1432,7 +1432,7 @@ TYPEselect_lib_part21 (const Type type, FILE* f, Schema schema)
|
||||
fprintf(f, " return _%s.ValueType();\n else ", dm);
|
||||
break;
|
||||
default:
|
||||
fprintf(f, " return %d;\n else ", FundamentalType(t,0));
|
||||
fprintf(f, " return %s;\n else ", FundamentalType(t,0));
|
||||
}
|
||||
LISTod;
|
||||
|
||||
@@ -1506,7 +1506,7 @@ TYPEselect_lib_part21 (const Type type, FILE* f, Schema schema)
|
||||
fprintf(f, " out << \")\";\n }\n else ");
|
||||
break;
|
||||
default:
|
||||
fprintf(f, " _%s -> STEPwrite (out); \n else ");
|
||||
fprintf(f, " _%s -> STEPwrite (out); \n else "); //FIXME should this be given 'dm' as an arg?
|
||||
break;
|
||||
}
|
||||
LISTod;
|
||||
@@ -1660,19 +1660,19 @@ TYPEselect_lib_StrToVal (const Type type, FILE* f, Schema schema)
|
||||
case enumeration_:
|
||||
if (!enum_cnt) {
|
||||
/* if there\'s more than one enumeration they are done in Select class */
|
||||
fprintf (f, " case %d : \n", FundamentalType (t, 0));
|
||||
fprintf (f, " case %s : \n", FundamentalType (t, 0));
|
||||
fprintf( f,
|
||||
"\treturn _%s.StrToVal (str, &_error);\n",
|
||||
SEL_ITEMget_dmname (t));
|
||||
}
|
||||
else {
|
||||
fprintf (f, " // case %d : done in Select class\n", FundamentalType (t, 0));
|
||||
fprintf (f, " // case %s : done in Select class\n", FundamentalType (t, 0));
|
||||
}
|
||||
++enum_cnt;
|
||||
break;
|
||||
|
||||
case string_:
|
||||
fprintf (f, " case %d : \n", FundamentalType (t, 0));
|
||||
fprintf (f, " case %s : \n", FundamentalType (t, 0));
|
||||
fprintf( f,
|
||||
"\treturn _%s.StrToVal (str);\n",
|
||||
SEL_ITEMget_dmname (t));
|
||||
@@ -1683,7 +1683,7 @@ TYPEselect_lib_StrToVal (const Type type, FILE* f, Schema schema)
|
||||
case bag_:
|
||||
case set_:
|
||||
case list_:
|
||||
fprintf (f, " case %d : \n", FundamentalType (t, 0));
|
||||
fprintf (f, " case %s : \n", FundamentalType (t, 0));
|
||||
fprintf( f,
|
||||
"\treturn _%s.StrToVal (str, &_error, "
|
||||
"%s -> AggrElemTypeDescriptor ());\n",
|
||||
@@ -1694,7 +1694,7 @@ TYPEselect_lib_StrToVal (const Type type, FILE* f, Schema schema)
|
||||
|
||||
default:
|
||||
/* otherwise use StrToVal on the contents to check the format */
|
||||
fprintf (f, " case %d : \n", FundamentalType (t, 0));
|
||||
fprintf (f, " case %s : \n", FundamentalType (t, 0));
|
||||
fprintf( f,
|
||||
"\treturn _%s -> StrToVal (str, instances);\n",
|
||||
SEL_ITEMget_dmname (t));
|
||||
|
||||
Reference in new issue
Block a user