qbsp: replace enum errors in parser.c
Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
parent
0e586916b1
commit
15da0d818a
|
|
@ -104,9 +104,6 @@ const char *rgszErrors[cErrors] = {
|
|||
"Internal error: invalid memory %i type in AllocMem",
|
||||
"Too many points on winding (%d)",
|
||||
"Out of memory",
|
||||
"line %d: Line is incomplete",
|
||||
"line %d: EOF inside quoted token",
|
||||
"line %d: Token too large",
|
||||
"Clipnodes in map exceed " stringify(MAX_BSP_CLIPNODES),
|
||||
"Internal error: Detail cluster mismatch",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -47,12 +47,12 @@ ParseToken(parser_t *p, parseflags_t flags)
|
|||
while (*p->pos <= 32) {
|
||||
if (!*p->pos) {
|
||||
if (flags & PARSE_SAMELINE)
|
||||
Error(errLineIncomplete, p->linenum);
|
||||
Error_("line %d: Line is incomplete", p->linenum);
|
||||
return false;
|
||||
}
|
||||
if (*p->pos++ == '\n') {
|
||||
if (flags & PARSE_SAMELINE)
|
||||
Error(errLineIncomplete, p->linenum);
|
||||
Error_("line %d: Line is incomplete", p->linenum);
|
||||
p->linenum++;
|
||||
}
|
||||
}
|
||||
|
|
@ -64,16 +64,16 @@ ParseToken(parser_t *p, parseflags_t flags)
|
|||
while (*p->pos && *p->pos != '\n') {
|
||||
*token_p++ = *p->pos++;
|
||||
if (token_p > &p->token[MAXTOKEN - 1])
|
||||
Error(errTokenTooLarge, p->linenum);
|
||||
Error_("line %d: Token too large", p->linenum);
|
||||
}
|
||||
goto out;
|
||||
}
|
||||
if (flags & PARSE_SAMELINE)
|
||||
Error(errLineIncomplete, p->linenum);
|
||||
Error_("line %d: Line is incomplete", p->linenum);
|
||||
while (*p->pos++ != '\n')
|
||||
if (!*p->pos) {
|
||||
if (flags & PARSE_SAMELINE)
|
||||
Error(errLineIncomplete, p->linenum);
|
||||
Error_("line %d: Line is incomplete", p->linenum);
|
||||
return false;
|
||||
}
|
||||
goto skipspace;
|
||||
|
|
@ -88,17 +88,17 @@ ParseToken(parser_t *p, parseflags_t flags)
|
|||
p->pos++;
|
||||
while (*p->pos != '"') {
|
||||
if (!*p->pos)
|
||||
Error(errEOFInQuotes, p->linenum);
|
||||
Error_("line %d: EOF inside quoted token", p->linenum);
|
||||
*token_p++ = *p->pos++;
|
||||
if (token_p > &p->token[MAXTOKEN - 1])
|
||||
Error(errTokenTooLarge, p->linenum);
|
||||
Error_("line %d: Token too large", p->linenum);
|
||||
}
|
||||
p->pos++;
|
||||
} else
|
||||
while (*p->pos > 32) {
|
||||
*token_p++ = *p->pos++;
|
||||
if (token_p > &p->token[MAXTOKEN - 1])
|
||||
Error(errTokenTooLarge, p->linenum);
|
||||
Error_("line %d: Token too large", p->linenum);
|
||||
}
|
||||
out:
|
||||
*token_p = 0;
|
||||
|
|
|
|||
|
|
@ -75,10 +75,6 @@ enum {
|
|||
errInvalidMemType, // 50
|
||||
errTooManyPoints,
|
||||
errOutOfMemory,
|
||||
errLineIncomplete,
|
||||
errEOFInQuotes,
|
||||
errTokenTooLarge,
|
||||
errLowLeakCount,
|
||||
errTooManyClipnodes,
|
||||
errDetailClusterMismatch,
|
||||
cErrors
|
||||
|
|
|
|||
Loading…
Reference in New Issue