quiet compiler warning with string formatting in CParser::Term

This commit is contained in:
Campbell Barton 2013-01-12 15:32:05 +00:00
parent c93e127e7a
commit 68d83f4140
2 changed files with 7 additions and 5 deletions

@ -354,7 +354,7 @@ int CParser::MakeInt()
}
#endif
STR_String CParser::Symbol2Str(int s)
const char *CParser::Symbol2Str(int s)
{
// returns a string representation of of symbol s,
// for use in Term when generating an error
@ -370,18 +370,20 @@ STR_String CParser::Symbol2Str(int s)
case whocodedsym: return "WHOMADE";
case eolsym: return "end of line";
case idsym: return "identifier";
default: return "unknown"; // should not happen
}
return "unknown"; // should not happen
}
void CParser::Term(int s)
{
// generates an error if the next symbol isn't the specified symbol s
// otherwise, skip the symbol
if (s == sym) NextSym();
if (s == sym) {
NextSym();
}
else {
STR_String msg;
msg.Format("Warning: " + Symbol2Str(s) + " expected\ncontinuing without it");
msg.Format("Warning: %s expected\ncontinuing without it", Symbol2Str(s));
// AfxMessageBox(msg,MB_ICONERROR);

@ -102,7 +102,7 @@ private:
#if 0 /* not used yet */
int MakeInt();
#endif
STR_String Symbol2Str(int s);
const char *Symbol2Str(int s);
void Term(int s);
int Priority(int optor);
CExpression *Ex(int i);