]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ftepp.c
Make compiler and virtual-machine compile as C++ code, also removed gmqcc_voidptr...
[xonotic/gmqcc.git] / ftepp.c
diff --git a/ftepp.c b/ftepp.c
index 96c20bf4f937f7ad0d55c9050e31b6813a3ab1a3..763850169675aca88781a7c2e09a145c8173b4d6 100644 (file)
--- a/ftepp.c
+++ b/ftepp.c
@@ -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, WARN_CPP, 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, WARN_CPP, "#warning %s", ftepp_tokval(ftepp));
+    return ftepp_warn(ftepp, WARN_CPP, "#warning %s", ftepp_tokval(ftepp));
 }
 
 static void ftepp_directive_error(ftepp_t *ftepp) {