From: Wolfgang (Blub) Bumiller Date: Sun, 25 Nov 2012 21:16:08 +0000 (+0100) Subject: Use the correct default cv-qualifier on locals X-Git-Tag: 0.1.9~225 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f1bbdb7d45571cd189b88262a5a8dbb405d83d00;p=xonotic%2Fgmqcc.git Use the correct default cv-qualifier on locals --- diff --git a/parser.c b/parser.c index 833333a..48b01a4 100644 --- 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");