CGE: Simplify error() calls

This also silences a few GCC warnings.
This commit is contained in:
eriktorbjorn 2011-07-02 20:25:39 +02:00
parent bdc213846e
commit ada4556b9a
2 changed files with 5 additions and 5 deletions

View File

@ -1357,7 +1357,7 @@ void CGEEngine::loadSprite(const char *fname, int ref, int cav, int col = 0, int
continue;
if ((i = takeEnum(Comd, strtok(line, " =\t"))) < 0)
error("%s [%s]", NumStr("Bad line ######", lcnt), (const char *)fname);
error("Bad line %d [%s]", lcnt, fname);
switch (i) {
@ -1365,7 +1365,7 @@ void CGEEngine::loadSprite(const char *fname, int ref, int cav, int col = 0, int
break;
case 1 : // Type
if ((type = takeEnum(Type, strtok(NULL, " \t,;/"))) < 0)
error("%s [%s]", NumStr("Bad line ######", lcnt), (const char *)fname);
error("Bad line %d [%s]", lcnt, fname);
break;
case 2 : // Phase
++ shpcnt;
@ -1533,7 +1533,7 @@ void CGEEngine::loadScript(const char *fname) {
_sprite->_flags._back = true;
}
if (! ok)
error("%s [%s]", NumStr("Bad INI line ######", lcnt), fname);
error("Bad INI line %d [%s]", lcnt, fname);
}
#define GAME_FRAME_DELAY (1000 / 50)

View File

@ -558,7 +558,7 @@ Sprite *Sprite::expand() {
else {
Snail::Com *c = &nea[neacnt++];
if ((c->_com = (SNCOM)takeEnum(Snail::_comTxt, strtok(NULL, " \t,;/"))) < 0)
error("%s [%s]", (const char*)NumStr("Bad NEAR in ######", lcnt), (const char*)fname);
error("Bad NEAR in %d [%s]", lcnt, fname);
c->_ref = atoi(strtok(NULL, " \t,;/"));
c->_val = atoi(strtok(NULL, " \t,;/"));
c->_ptr = NULL;
@ -574,7 +574,7 @@ Sprite *Sprite::expand() {
else {
Snail::Com *c = &tak[takcnt++];
if ((c->_com = (SNCOM)takeEnum(Snail::_comTxt, strtok(NULL, " \t,;/"))) < 0)
error("%s [%s]", NumStr("Bad NEAR in ######", lcnt), (const char *)fname);
error("Bad NEAR in %d [%s]", lcnt, fname);
c->_ref = atoi(strtok(NULL, " \t,;/"));
c->_val = atoi(strtok(NULL, " \t,;/"));
c->_ptr = NULL;