]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
parsewarning and genwarning to use vcompile_warning
authorWolfgang (Blub) Bumiller <blub@speed.at>
Mon, 17 Dec 2012 17:26:26 +0000 (18:26 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Mon, 17 Dec 2012 17:26:26 +0000 (18:26 +0100)
parser.c

index 8e5f8b0c651f0fdaf7b889b0ca95c5ed1c13bdb8..ee4718519ece62aae2edf5b6c65ab6b66320fd9e 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -124,40 +124,22 @@ static void parseerror(parser_t *parser, const char *fmt, ...)
 /* returns true if it counts as an error */
 static bool GMQCC_WARN parsewarning(parser_t *parser, int warntype, const char *fmt, ...)
 {
 /* returns true if it counts as an error */
 static bool GMQCC_WARN parsewarning(parser_t *parser, int warntype, const char *fmt, ...)
 {
+    bool    r;
        va_list ap;
        va_list ap;
-       int lvl = LVL_WARNING;
-
-    if (!OPTS_WARN(warntype))
-        return false;
-
-    if (opts.werror) {
-           parser->errors++;
-           lvl = LVL_ERROR;
-       }
-
        va_start(ap, fmt);
        va_start(ap, fmt);
-    con_vprintmsg(lvl, parser->lex->tok.ctx.file, parser->lex->tok.ctx.line, (opts.werror ? "error" : "warning"), fmt, ap);
+       r = vcompile_warning(parser->lex->tok.ctx, warntype, fmt, ap);
        va_end(ap);
        va_end(ap);
-
-       return opts.werror;
+       return r;
 }
 
 static bool GMQCC_WARN genwarning(lex_ctx ctx, int warntype, const char *fmt, ...)
 {
 }
 
 static bool GMQCC_WARN genwarning(lex_ctx ctx, int warntype, const char *fmt, ...)
 {
+    bool    r;
        va_list ap;
        va_list ap;
-       int lvl = LVL_WARNING;
-
-    if (!OPTS_WARN(warntype))
-        return false;
-
-    if (opts.werror)
-           lvl = LVL_ERROR;
-
        va_start(ap, fmt);
        va_start(ap, fmt);
-    con_vprintmsg(lvl, ctx.file, ctx.line, (opts.werror ? "error" : "warning"), fmt, ap);
+       r = vcompile_warning(ctx, warntype, fmt, ap);
        va_end(ap);
        va_end(ap);
-
-       return opts.werror;
+       return r;
 }
 
 /**********************************************************************
 }
 
 /**********************************************************************