]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - exec.c
moving -Olocal-temps to -O4 until the issues are solved
[xonotic/gmqcc.git] / exec.c
diff --git a/exec.c b/exec.c
index 2957d4c5bf315431353a5d6d7d9c8aaa7528adbc..2383ad70e5bf23827dae59e657b7877252745d3e 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012
+ * Copyright (C) 2012, 2013
  *     Wolfgang Bumiller
  *     Dale Weiler
  *
@@ -475,7 +475,8 @@ static qcint prog_enterfunction(qc_program *prog, prog_section_function *func)
     st.function = func;
 
     if (prog->xflags & VMXF_TRACE) {
-        vec_push(prog->function_stack, prog_getstring(prog, func->name));
+        const char *str = prog_getstring(prog, func->name);
+        vec_push(prog->function_stack, str);
     }
 
 #ifdef QCVM_BACKUP_STRATEGY_CALLER_VARS
@@ -1000,7 +1001,7 @@ int main(int argc, char **argv)
 
             --argc;
             ++argv;
-            if (argc < 3) {
+            if (argc < 2) {
                 usage();
                 exit(1);
             }
@@ -1027,27 +1028,20 @@ int main(int argc, char **argv)
         }
         else
         {
+            printf("unknown parameter: %s\n", argv[1]);
             usage();
             exit(1);
         }
     }
 
-    if (argc > 2) {
-        usage();
-        exit(1);
-    }
-    if (argc > 1) {
-        if (progsfile) {
-            printf("only 1 program file may be specified\n");
-            usage();
-            exit(1);
-        }
+    if (argc == 2 && !progsfile) {
         progsfile = argv[1];
         --argc;
         ++argv;
     }
 
     if (!progsfile) {
+        printf("must specify a program to execute\n");
         usage();
         exit(1);
     }