X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=ftepp.c;h=d68eed45285baa72e2fed256faa9314596a0311a;hp=f8d41d92e3d764f26043936f4f186d6b51872619;hb=17318af62fa6ed5c5b48652150740c9ea241a536;hpb=f892b323351eb110dc97b8cf4e15d03dddc6fb78 diff --git a/ftepp.c b/ftepp.c index f8d41d9..d68eed4 100644 --- a/ftepp.c +++ b/ftepp.c @@ -22,7 +22,10 @@ * SOFTWARE. */ #include +#include +#include #include + #include "gmqcc.h" #include "lexer.h" @@ -186,7 +189,7 @@ static char *ftepp_predef_timestamp(lex_file *context) { /* * ctime and its fucking annoying newline char, no worries, we're * professionals here. - */ + */ find = ctime(&finfo.st_mtime); value = (char*)mem_a(strlen(find) + 1); memcpy(&value[1], find, (size = strlen(find)) - 1); @@ -313,7 +316,7 @@ static void ppmacro_delete(ppmacro *self) mem_d(self); } -static ftepp_t* ftepp_new() +static ftepp_t* ftepp_new(void) { ftepp_t *ftepp; @@ -621,7 +624,7 @@ static bool ftepp_macro_call_params(ftepp_t *ftepp, macroparam **out_params) ptok = pptoken_make(ftepp); vec_push(mp.tokens, ptok); if (ftepp_next(ftepp) >= TOKEN_EOF) { - ftepp_error(ftepp, "unexpected EOF in macro call"); + ftepp_error(ftepp, "unexpected end of file in macro call"); goto on_error; } } @@ -634,16 +637,10 @@ static bool ftepp_macro_call_params(ftepp_t *ftepp, macroparam **out_params) goto on_error; } if (ftepp_next(ftepp) >= TOKEN_EOF) { - ftepp_error(ftepp, "unexpected EOF in macro call"); + ftepp_error(ftepp, "unexpected end of file in macro call"); goto on_error; } } - /* need to leave that up - if (ftepp_next(ftepp) >= TOKEN_EOF) { - ftepp_error(ftepp, "unexpected EOF in macro call"); - goto on_error; - } - */ *out_params = params; return true; @@ -1881,7 +1878,7 @@ ftepp_t *ftepp_create() void ftepp_add_define(ftepp_t *ftepp, const char *source, const char *name) { ppmacro *macro; - lex_ctx ctx = { "__builtin__", 0 }; + lex_ctx ctx = { "__builtin__", 0, 0 }; ctx.file = source; macro = ppmacro_new(ctx, name); /*vec_push(ftepp->macros, macro);*/