]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ftepp.c
change choice of diagnostics for ftepp to use lex_ctx instance. Cleaned up C++ style...
[xonotic/gmqcc.git] / ftepp.c
diff --git a/ftepp.c b/ftepp.c
index 34ca698c8702e03c65361f0bba4d7225e9c7e0a9..6f2bb9316e9dc0578dfc1a0367e7ddfe082c5b83 100644 (file)
--- a/ftepp.c
+++ b/ftepp.c
@@ -77,7 +77,7 @@ static void ftepp_errorat(ftepp_t *ftepp, lex_ctx ctx, const char *fmt, ...)
     ftepp->errors++;
 
     va_start(ap, fmt);
-    con_vprintmsg(LVL_ERROR, ctx.file, ctx.line, "error", fmt, ap);
+    con_cvprintmsg((void*)&ctx, LVL_ERROR, "error", fmt, ap);
     va_end(ap);
 }
 
@@ -88,7 +88,7 @@ static void ftepp_error(ftepp_t *ftepp, const char *fmt, ...)
     ftepp->errors++;
 
     va_start(ap, fmt);
-    con_vprintmsg(LVL_ERROR, ftepp->lex->tok.ctx.file, ftepp->lex->tok.ctx.line, "error", fmt, ap);
+    con_cvprintmsg((void*)&ftepp->lex->tok.ctx, LVL_ERROR, "error", fmt, ap);
     va_end(ap);
 }
 
@@ -106,7 +106,7 @@ static bool GMQCC_WARN ftepp_warn(ftepp_t *ftepp, int warntype, const char *fmt,
     }
 
     va_start(ap, fmt);
-    con_vprintmsg(lvl, ftepp->lex->tok.ctx.file, ftepp->lex->tok.ctx.line, "error", fmt, ap);
+    con_cvprintmsg((void*)&ftepp->lex->tok.ctx, lvl, "error", fmt, ap);
     va_end(ap);
     return opts_werror;
 }
@@ -134,8 +134,9 @@ static void pptoken_delete(pptoken *self)
 
 static ppmacro *ppmacro_new(lex_ctx ctx, const char *name)
 {
-    (void)ctx;
     ppmacro *macro = (ppmacro*)mem_a(sizeof(ppmacro));
+    
+    (void)ctx;
     memset(macro, 0, sizeof(*macro));
     macro->name = util_strdup(name);
     return macro;