]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.c
vcompile_error, vcompile_warning; fixed: removed opts_ globals from con.c; made the...
[xonotic/gmqcc.git] / lexer.c
diff --git a/lexer.c b/lexer.c
index f1ef767f09d36a4e02cb041dc4bfb7a0a96095b7..6f8853d453acf132de13f7de4894a578040cda19 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -74,20 +74,17 @@ void lexerror(lex_file *lex, const char *fmt, ...)
 
 bool lexwarn(lex_file *lex, int warntype, const char *fmt, ...)
 {
+    bool    r;
+    lex_ctx ctx;
     va_list ap;
-    int lvl = LVL_WARNING;
 
-    if (!OPTS_WARN(warntype))
-        return false;
-
-    if (opts.werror)
-        lvl = LVL_ERROR;
+    ctx.file = lex->name;
+    ctx.line = lex->sline;
 
     va_start(ap, fmt);
-    con_vprintmsg(lvl, lex->name, lex->sline, (opts.werror ? "error" : "warning"), fmt, ap);
+    r = vcompile_warning(ctx, warntype, fmt, ap);
     va_end(ap);
-
-    return opts.werror;
+    return r;
 }