From 15da0d818aa3903c672aecfa418ce0f7f0830233 Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Mon, 22 Apr 2013 18:40:13 +0930 Subject: [PATCH] qbsp: replace enum errors in parser.c Signed-off-by: Kevin Shanahan --- qbsp/globals.c | 3 --- qbsp/parser.c | 16 ++++++++-------- qbsp/warnerr.h | 4 ---- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/qbsp/globals.c b/qbsp/globals.c index 933ae4d3..694b95d8 100644 --- a/qbsp/globals.c +++ b/qbsp/globals.c @@ -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", }; diff --git a/qbsp/parser.c b/qbsp/parser.c index 79808ec6..239dbc53 100644 --- a/qbsp/parser.c +++ b/qbsp/parser.c @@ -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; diff --git a/qbsp/warnerr.h b/qbsp/warnerr.h index 382f97e5..0349ddee 100644 --- a/qbsp/warnerr.h +++ b/qbsp/warnerr.h @@ -75,10 +75,6 @@ enum { errInvalidMemType, // 50 errTooManyPoints, errOutOfMemory, - errLineIncomplete, - errEOFInQuotes, - errTokenTooLarge, - errLowLeakCount, errTooManyClipnodes, errDetailClusterMismatch, cErrors