]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
solve it, not hide it
authorWolfgang Bumiller <wry.git@bumiller.com>
Thu, 25 Apr 2013 17:18:50 +0000 (19:18 +0200)
committerWolfgang Bumiller <wry.git@bumiller.com>
Thu, 25 Apr 2013 17:18:50 +0000 (19:18 +0200)
parser.c

index 14cf583647c0a79362691193440f75b0d8761572..7fba786c9cead285969038375c0e801cbc4f24b3 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -5689,7 +5689,9 @@ skipvar:
 
                 /* we only want the integral part anyways */
                 builtin_num = integral;
-            } else if (parser->tok != TOKEN_INTCONST) {
+            } else if (parser->tok == TOKEN_INTCONST) {
+                builtin_num = parser_token(parser)->constval.i;
+            } else {
                 parseerror(parser, "builtin number must be a compile time constant");
                 break;
             }
@@ -5709,9 +5711,7 @@ skipvar:
                 }
                 vec_push(parser->functions, func);
 
-                func->builtin = -((OPTS_FLAG(EXPRESSIONS_FOR_BUILTINS))
-                                    ? builtin_num
-                                    : parser_token(parser)->constval.i) - 1;
+                func->builtin = -builtin_num-1;
             }
 
             if (OPTS_FLAG(EXPRESSIONS_FOR_BUILTINS)