]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - parser.c
Merge branch 'union-replacement' into cooking
[xonotic/gmqcc.git] / parser.c
index 9fd94f6a4e990f0dc7a2e5dfdc1f1d17d4cbb630..482410677becfaeb2749bd79bfbdf81c389b1366 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -185,7 +185,7 @@ vector vec3_mulvf(vector a, float b)
  * parsing
  */
 
-bool parser_next(parser_t *parser)
+static bool parser_next(parser_t *parser)
 {
     /* lex_do kills the previous token */
     parser->tok = lex_do(parser->lex);
@@ -1038,9 +1038,9 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
         case opid2('>','>'):
             if (CanConstFold(exprs[0], exprs[1]) && ! NotSameType(TYPE_FLOAT)) {
                 if (op->id == opid2('<','<'))
-                    out = (ast_expression*)parser_const_float(parser, (double)((int)(ConstF(0)) << (int)(ConstF(1))));
+                    out = (ast_expression*)parser_const_float(parser, (double)((unsigned int)(ConstF(0)) << (unsigned int)(ConstF(1))));
                 else
-                    out = (ast_expression*)parser_const_float(parser, (double)((int)(ConstF(0)) >> (int)(ConstF(1))));
+                    out = (ast_expression*)parser_const_float(parser, (double)((unsigned int)(ConstF(0)) >> (unsigned int)(ConstF(1))));
                 break;
             }
         case opid3('<','<','='):
@@ -5814,6 +5814,7 @@ static ast_expression* parse_expression_leave(parser_t *parser, bool stopatcomma
                 }
                 vec_free(sy.out);
                 vec_free(sy.ops);
+                vec_free(sy.argc);
                 var->cvq = cvq;
             }
         }
@@ -6069,7 +6070,7 @@ parser_t *parser_create()
     return parser;
 }
 
-bool parser_compile(parser_t *parser)
+static bool parser_compile(parser_t *parser)
 {
     /* initial lexer/parser state */
     parser->lex->flags.noops = true;