From: Dale Weiler Date: Wed, 31 Jul 2013 15:56:56 +0000 (+0000) Subject: Fixes X-Git-Tag: v0.3.0~46 X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=1538e69f93dd42cc8590f4be64774de303e584be;hp=fa5ad1212eb2cac046ff66dffb472cec9b024b9f Fixes --- diff --git a/fold.c b/fold.c index 662601b..5f5c127 100644 --- a/fold.c +++ b/fold.c @@ -42,7 +42,6 @@ #define isvector(X) (((ast_expression*)(X))->vtype == TYPE_VECTOR) #define isstring(X) (((ast_expression*)(X))->vtype == TYPE_STRING) #define isfloats(X,Y) (isfloat (X) && isfloat (Y)) -#define isvectors(X,Y) (isvector (X) && isvector(Y)) /* * Implementation of basic vector math for vec3_t, for trivial constant @@ -547,8 +546,8 @@ ast_expression *fold_op(fold_t *fold, const oper_info *info, ast_expression **op } switch(info->id) { - case opid2('-', 'P'): return fold_op_neg (fold, a); - case opid2('!', 'P'): return fold_op_not (fold, a); + case opid2('-','P'): return fold_op_neg (fold, a); + case opid2('!','P'): return fold_op_not (fold, a); case opid1('+'): return fold_op_add (fold, a, b); case opid1('-'): return fold_op_sub (fold, a, b); case opid1('*'): return fold_op_mul (fold, a, b); diff --git a/lexer.h b/lexer.h index c8c6bfe..d0ca190 100644 --- a/lexer.h +++ b/lexer.h @@ -185,10 +185,10 @@ static const oper_info c_operators[] = { { "++", 1, opid3('+','+','P'), ASSOC_RIGHT, 16, OP_PREFIX, false}, { "--", 1, opid3('-','-','P'), ASSOC_RIGHT, 16, OP_PREFIX, false}, - { "**", 2, opid2('*', '*'), ASSOC_RIGHT, 15, 0, true}, + { "**", 2, opid2('*','*'), ASSOC_RIGHT, 15, 0, true}, - { "!", 1, opid2('!', 'P'), ASSOC_RIGHT, 14, OP_PREFIX, true}, - { "~", 1, opid2('~', 'P'), ASSOC_RIGHT, 14, OP_PREFIX, true}, + { "!", 1, opid2('!','P'), ASSOC_RIGHT, 14, OP_PREFIX, true}, + { "~", 1, opid2('~','P'), ASSOC_RIGHT, 14, OP_PREFIX, true}, { "+", 1, opid2('+','P'), ASSOC_RIGHT, 14, OP_PREFIX, false}, { "-", 1, opid2('-','P'), ASSOC_RIGHT, 14, OP_PREFIX, true}, /* { "&", 1, opid2('&','P'), ASSOC_RIGHT, 14, OP_PREFIX, false}, */ @@ -212,7 +212,7 @@ static const oper_info c_operators[] = { { "==", 2, opid2('=','='), ASSOC_LEFT, 9, 0, true}, { "!=", 2, opid2('!','='), ASSOC_LEFT, 9, 0, true}, - { "&", 2, opid1('&'), ASSOC_LEFT, 8, 0, false}, + { "&", 2, opid1('&'), ASSOC_LEFT, 8, 0, true}, { "^", 2, opid1('^'), ASSOC_LEFT, 7, 0, true}, @@ -252,9 +252,9 @@ static const oper_info fte_operators[] = { { "(", 0, opid1('('), ASSOC_LEFT, 15, 0, false}, /* function call */ { "[", 2, opid1('['), ASSOC_LEFT, 15, 0, false}, /* array subscript */ - { "!", 1, opid2('!', 'P'), ASSOC_RIGHT, 14, OP_PREFIX, false}, + { "!", 1, opid2('!','P'), ASSOC_RIGHT, 14, OP_PREFIX, true}, { "+", 1, opid2('+','P'), ASSOC_RIGHT, 14, OP_PREFIX, false}, - { "-", 1, opid2('-','P'), ASSOC_RIGHT, 14, OP_PREFIX, false}, + { "-", 1, opid2('-','P'), ASSOC_RIGHT, 14, OP_PREFIX, true}, { "++", 1, opid3('+','+','P'), ASSOC_RIGHT, 14, OP_PREFIX, false}, { "--", 1, opid3('-','-','P'), ASSOC_RIGHT, 14, OP_PREFIX, false}, @@ -304,7 +304,7 @@ static const oper_info qcc_operators[] = { { "(", 0, opid1('('), ASSOC_LEFT, 15, 0, false}, /* function call */ { "[", 2, opid1('['), ASSOC_LEFT, 15, 0, false}, /* array subscript */ - { "!", 1, opid2('!', 'P'), ASSOC_RIGHT, 14, OP_PREFIX, true}, + { "!", 1, opid2('!','P'), ASSOC_RIGHT, 14, OP_PREFIX, true}, { "+", 1, opid2('+','P'), ASSOC_RIGHT, 14, OP_PREFIX, false}, { "-", 1, opid2('-','P'), ASSOC_RIGHT, 14, OP_PREFIX, true},