]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Use the correct default cv-qualifier on locals
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 21:16:08 +0000 (22:16 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 25 Nov 2012 21:16:08 +0000 (22:16 +0100)
parser.c

index 833333ab6230beec1d5a730543db4108c36b99df..48b01a48a5e1a5eed71c446db91cb03a079b19de 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -2297,7 +2297,13 @@ static bool parse_statement(parser_t *parser, ast_block *block, ast_expression *
             !strcmp(parser_tokval(parser), "const") ||
             !strcmp(parser_tokval(parser), "var"))
         {
-            int cvq = parser_tokval(parser)[0] == 'c' ? CV_CONST : CV_VAR;
+            int cvq;
+            if (parser_tokval(parser)[0] == 'c')
+                cvq = CV_CONST;
+            else if (parser_tokval(parser)[0] == 'v')
+                cvq = CV_VAR;
+            else
+                cvq = CV_NONE;
 
             if (!block) {
                 parseerror(parser, "cannot declare a local variable here");