mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
Use the correct default cv-qualifier on locals
This commit is contained in:
parent
c62e0a93eb
commit
f1bbdb7d45
1 changed files with 7 additions and 1 deletions
8
parser.c
8
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), "const") ||
|
||||||
!strcmp(parser_tokval(parser), "var"))
|
!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) {
|
if (!block) {
|
||||||
parseerror(parser, "cannot declare a local variable here");
|
parseerror(parser, "cannot declare a local variable here");
|
||||||
|
|
Loading…
Reference in a new issue