From e8ff8255a9d9d0608bcb206f062dc5d1007655c4 Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Sun, 20 Apr 2008 15:01:52 +0000 Subject: [PATCH] Some const correctness git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4692 4a71c877-e1ca-e34f-864e-861f7616d084 --- lib/gamelib/audp_parser.y | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/gamelib/audp_parser.y b/lib/gamelib/audp_parser.y index cf57a961c..342aabc60 100644 --- a/lib/gamelib/audp_parser.y +++ b/lib/gamelib/audp_parser.y @@ -30,7 +30,7 @@ static Vector3i vecPos, vecRot, vecScale; extern int audp_lex(void); extern int audp_lex_destroy(void); -void audp_error(char *pMessage,...); +void audp_error(const char* fmt, ...); %} @@ -195,18 +195,16 @@ anim_state: INTEGER INTEGER INTEGER INTEGER INTEGER INTEGER INTEGER INTEGER I /***************************************************************************/ /* A simple error reporting routine */ -void audp_error(char *pMessage,...) +void audp_error(const char* msg, ...) { int line; char *pText; char aTxtBuf[1024]; va_list args; - va_start(args, pMessage); - vsnprintf(aTxtBuf, sizeof(aTxtBuf), pMessage, args); + va_start(args, msg); + vsnprintf(aTxtBuf, sizeof(aTxtBuf), msg, args); va_end(args); - // Guarantee to nul-terminate - aTxtBuf[sizeof(aTxtBuf) - 1] = '\0'; parseGetErrorData( &line, &pText ); debug( LOG_ERROR, "RES file parse error:\n%s at line %d\nToken: %d, Text: '%s'\n", aTxtBuf, line, audp_char, pText );