]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - main.c
Some cleanups and smaller binaries!
[xonotic/gmqcc.git] / main.c
diff --git a/main.c b/main.c
index bcd91599e730bcc063c7b0f7f734325fef403057..e8a41b756c50e293d732a8f3086ef20f33530237 100644 (file)
--- a/main.c
+++ b/main.c
@@ -198,6 +198,7 @@ static bool options_parse(int argc, char **argv) {
                     opts_set(opts.warn, WARN_BREAKDEF,             true);
 
                     OPTS_OPTION_U32(OPTION_STANDARD) = COMPILER_FTEQCC;
+                    OPTS_OPTION_BOOL(OPTION_STATISTICS) = true;
 
                 } else if (!strcmp(argarg, "qccx")) {
 
@@ -561,7 +562,7 @@ int main(int argc, char **argv) {
 
     app_name = argv[0];
     con_init ();
-    opts_init("progs.dat", COMPILER_GMQCC, (1024 << 3));
+    opts_init("progs.dat", COMPILER_QCC, (1024 << 3));
 
     util_seed(time(0));
 
@@ -681,7 +682,7 @@ int main(int argc, char **argv) {
 
             if (!line[0] || (line[0] == '/' && line[1] == '/'))
                 continue;
-                
+
             if (hasline) {
                 item.filename = util_strdup(line);
                 item.type     = TYPE_QC;
@@ -697,9 +698,6 @@ int main(int argc, char **argv) {
         mem_d(line);
     }
 
-    if (retval)
-        goto cleanup;
-
     if (vec_size(items)) {
         if (!OPTS_OPTION_BOOL(OPTION_QUIET) &&
             !OPTS_OPTION_BOOL(OPTION_PP_ONLY))
@@ -791,7 +789,7 @@ cleanup:
     vec_free(ppems);
 
     if (!OPTS_OPTION_BOOL(OPTION_PP_ONLY))
-        parser_cleanup(parser);
+        if(parser) parser_cleanup(parser);
     if (opts_output_free)
         mem_d(OPTS_OPTION_STR(OPTION_OUTPUT));
     if (operators_free)