]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - main.c
-std=fteqcc gets its own operator list
[xonotic/gmqcc.git] / main.c
diff --git a/main.c b/main.c
index 4c8062d7dcdb1b125101c77348c26952c9ac592c..76e400727f118499bf9f5b517d094747859101a9 100644 (file)
--- a/main.c
+++ b/main.c
@@ -32,6 +32,7 @@ const char *opts_output   = "progs.dat";
 int         opts_standard = COMPILER_GMQCC;
 bool        opts_debug    = false;
 bool        opts_memchk   = false;
+bool        opts_dumpfin  = false;
 bool        opts_dump     = false;
 bool        opts_werror   = false;
 bool        opts_forcecrc = false;
@@ -221,13 +222,13 @@ static bool options_parse(int argc, char **argv) {
                 continue;
             }
             if (options_long_gcc("redirout", &argc, &argv, &redirout)) {
+                con_change(redirout, redirerr);
                 continue;
             }
             if (options_long_gcc("redirerr", &argc, &argv, &redirerr)) {
+                con_change(redirout, redirerr);
                 continue;
             }
-            
-            con_change(redirout, redirerr);
 
             if (!strcmp(argv[0]+1, "debug")) {
                 opts_debug = true;
@@ -237,6 +238,10 @@ static bool options_parse(int argc, char **argv) {
                 opts_dump = true;
                 continue;
             }
+            if (!strcmp(argv[0]+1, "dumpfin")) {
+                opts_dumpfin = true;
+                continue;
+            }
             if (!strcmp(argv[0]+1, "memchk")) {
                 opts_memchk = true;
                 continue;
@@ -251,7 +256,7 @@ static bool options_parse(int argc, char **argv) {
                 case 'h':
                     usage();
                     exit(0);
-                    break;
+                    /* break; never reached because of exit(0) */
 
                 case 'E':
                     opts_pp_only = true;
@@ -379,7 +384,6 @@ static bool options_parse(int argc, char **argv) {
         else
         {
             /* it's a QC filename */
-            argitem item;
             item.filename = argv[0];
             item.type     = TYPE_QC;
             vec_push(items, item);
@@ -454,6 +458,9 @@ int main(int argc, char **argv) {
     if (opts_standard == COMPILER_GMQCC) {
         operators = c_operators;
         operator_count = c_operator_count;
+    } else if (opts_standard == COMPILER_FTEQCC) {
+        operators = fte_operators;
+        operator_count = fte_operator_count;
     } else {
         operators = qcc_operators;
         operator_count = qcc_operator_count;