X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=ftepp.c;h=763850169675aca88781a7c2e09a145c8173b4d6;hp=c7e4273c5f4f9495891c200d6256bfdb4748edc9;hb=c3964cf29d0928b7c1decbd5a4d8dd38c3aff78a;hpb=36a90bb86667d3675b2babdbd9e262282953f09f;ds=sidebyside diff --git a/ftepp.c b/ftepp.c index c7e4273..7638501 100644 --- a/ftepp.c +++ b/ftepp.c @@ -217,7 +217,7 @@ static void ftepp_macro_delete(ftepp_t *ftepp, const char *name) } } -static inline int ftepp_next(ftepp_t *ftepp) +static GMQCC_INLINE int ftepp_next(ftepp_t *ftepp) { return (ftepp->token = lex_do(ftepp->lex)); } @@ -991,9 +991,9 @@ static char *ftepp_include_find_path(const char *file, const char *pathfile) memcpy(vec_add(filename, len+1), file, len); vec_last(filename) = 0; - fp = util_fopen(filename, "rb"); + fp = file_open(filename, "rb"); if (fp) { - fclose(fp); + file_close(fp); return filename; } vec_free(filename); @@ -1010,14 +1010,15 @@ static char *ftepp_include_find(ftepp_t *ftepp, const char *file) return filename; } -static void ftepp_directive_warning(ftepp_t *ftepp) { +static bool ftepp_directive_warning(ftepp_t *ftepp) { char *message = NULL; if (!ftepp_skipspace(ftepp)) - return; + return false; /* handle the odd non string constant case so it works like C */ if (ftepp->token != TOKEN_STRINGCONST) { + bool store = false; vec_upload(message, "#warning", 8); ftepp_next(ftepp); while (ftepp->token != TOKEN_EOL) { @@ -1025,13 +1026,13 @@ static void ftepp_directive_warning(ftepp_t *ftepp) { ftepp_next(ftepp); } vec_push(message, '\0'); - (void)!!ftepp_warn(ftepp, LVL_WARNING, message); + store = ftepp_warn(ftepp, WARN_CPP, message); vec_free(message); - return; + return store; } unescape (ftepp_tokval(ftepp), ftepp_tokval(ftepp)); - (void)!!ftepp_warn(ftepp, LVL_WARNING, "#warning %s", ftepp_tokval(ftepp)); + return ftepp_warn(ftepp, WARN_CPP, "#warning %s", ftepp_tokval(ftepp)); } static void ftepp_directive_error(ftepp_t *ftepp) {