Changed: Replace atoi by NLMISC::fromString

This commit is contained in:
kervala 2013-09-06 14:45:48 +02:00
parent bfc65e70e7
commit 1560df430a

View file

@ -490,6 +490,8 @@ void COutputFile::generateOutput() const
outbuff+="/*\n"; outbuff+="/*\n";
outbuff+="\tFILE: "; outbuff+="\tFILE: ";
outbuff+=_FileName+"\n\n"; outbuff+=_FileName+"\n\n";
outbuff+="#ifndef RY_EGS_STATIC_BRICK_CPP_H\n";
outbuff+="#define RY_EGS_STATIC_BRICK_CPP_H\n\n";
outbuff+="\tWARNING: This file is autogenerated - any modifications will be lost at next regeneration\n\n"; outbuff+="\tWARNING: This file is autogenerated - any modifications will be lost at next regeneration\n\n";
outbuff+="*/\n\n"; outbuff+="*/\n\n";
@ -505,6 +507,8 @@ void COutputFile::generateOutput() const
_Structures[i].generateOutput(outbuff); _Structures[i].generateOutput(outbuff);
} }
outbuff+="#endif\n\n";
// read in the previous version of the output file // read in the previous version of the output file
char *inbuff=NULL; char *inbuff=NULL;
FILE *inf=fopen(_FileName.c_str(),"rb"); FILE *inf=fopen(_FileName.c_str(),"rb");
@ -631,17 +635,11 @@ void COutputFile::CStruct::generateOutput(std::string &outbuff) const
for (i=0;i<_Params.size();++i) for (i=0;i<_Params.size();++i)
{ {
outbuff+="\t\t"; outbuff+="\t\t";
outbuff+=_Params[i]._Name+"="; outbuff+="NLMISC::fromString(args[";
if (_Params[i]._Type==COutputFile::INT) outbuff+="atoi(";
if (_Params[i]._Type==COutputFile::FLOAT) outbuff+="(float)atof(";
outbuff+="args[";
if (i>100) outbuff+=('0'+((i/100)%10)); if (i>100) outbuff+=('0'+((i/100)%10));
if (i>10) outbuff+=('0'+((i/10)%10)); if (i>10) outbuff+=('0'+((i/10)%10));
outbuff+=('0'+(i%10)); outbuff+=('0'+(i%10));
if (_Params[i]._Type==COutputFile::INT || _Params[i]._Type==COutputFile::FLOAT) outbuff+="], "+_Params[i]._Name+");\n";
outbuff+="].c_str());\n";
else
outbuff+="].c_str();\n";
} }
outbuff+="\n"; outbuff+="\n";
outbuff+="\t\treturn *this;\n"; outbuff+="\t\treturn *this;\n";