]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.c
Replaced it all...
[xonotic/gmqcc.git] / lexer.c
diff --git a/lexer.c b/lexer.c
index e190da0779ca3349d69ecae7a0eae9f5a2eacbca..094c6efc2841e4c0cd4640e55ee6218a50986b1d 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -9,14 +9,14 @@
 MEM_VEC_FUNCTIONS(token, char, value)
 MEM_VEC_FUNCTIONS(lex_file, frame_macro, frames)
 
-VECTOR_MAKE(char*, lex_filenames);
+char* *lex_filenames;
 
 void lexerror(lex_file *lex, const char *fmt, ...)
 {
        va_list ap;
 
        va_start(ap, fmt);
-    vprintmsg(LVL_ERROR, lex->name, lex->sline, "parse error", fmt, ap);
+    con_vprintmsg(LVL_ERROR, lex->name, lex->sline, "parse error", fmt, ap);
        va_end(ap);
 }
 
@@ -32,7 +32,7 @@ bool lexwarn(lex_file *lex, int warntype, const char *fmt, ...)
            lvl = LVL_ERROR;
 
        va_start(ap, fmt);
-    vprintmsg(lvl, lex->name, lex->sline, "warning", fmt, ap);
+    con_vprintmsg(lvl, lex->name, lex->sline, "warning", fmt, ap);
        va_end(ap);
 
        return opts_werror;
@@ -157,8 +157,7 @@ lex_file* lex_open(const char *file)
     lex->peekpos = 0;
     lex->eof = false;
 
-    lex_filenames_add(lex->name);
-
+    vec_push(lex_filenames, lex->name);
     return lex;
 }
 
@@ -185,7 +184,7 @@ lex_file* lex_open_string(const char *str, size_t len, const char *name)
     lex->peekpos = 0;
     lex->eof = false;
 
-    lex_filenames_add(lex->name);
+    vec_push(lex_filenames, lex->name);
 
     return lex;
 }
@@ -193,9 +192,9 @@ lex_file* lex_open_string(const char *str, size_t len, const char *name)
 void lex_cleanup(void)
 {
     size_t i;
-    for (i = 0; i < lex_filenames_elements; ++i)
-        mem_d(lex_filenames_data[i]);
-    mem_d(lex_filenames_data);
+    for (i = 0; i < vec_size(lex_filenames); ++i)
+        mem_d(lex_filenames[i]);
+    vec_free(lex_filenames);
 }
 
 void lex_close(lex_file *lex)