[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53743] trunk/blender/source/gameengine/ Expressions: quiet compiler warning with string formatting in CParser::Term
Campbell Barton
ideasman42 at gmail.com
Sat Jan 12 16:32:11 CET 2013
Revision: 53743
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53743
Author: campbellbarton
Date: 2013-01-12 15:32:05 +0000 (Sat, 12 Jan 2013)
Log Message:
-----------
quiet compiler warning with string formatting in CParser::Term
Modified Paths:
--------------
trunk/blender/source/gameengine/Expressions/InputParser.cpp
trunk/blender/source/gameengine/Expressions/InputParser.h
Modified: trunk/blender/source/gameengine/Expressions/InputParser.cpp
===================================================================
--- trunk/blender/source/gameengine/Expressions/InputParser.cpp 2013-01-12 14:28:23 UTC (rev 53742)
+++ trunk/blender/source/gameengine/Expressions/InputParser.cpp 2013-01-12 15:32:05 UTC (rev 53743)
@@ -354,7 +354,7 @@
}
#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 @@
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);
Modified: trunk/blender/source/gameengine/Expressions/InputParser.h
===================================================================
--- trunk/blender/source/gameengine/Expressions/InputParser.h 2013-01-12 14:28:23 UTC (rev 53742)
+++ trunk/blender/source/gameengine/Expressions/InputParser.h 2013-01-12 15:32:05 UTC (rev 53743)
@@ -102,7 +102,7 @@
#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);
More information about the Bf-blender-cvs
mailing list