]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Fixes
authorDale Weiler <killfieldengine@gmail.com>
Wed, 31 Jul 2013 15:56:56 +0000 (15:56 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Wed, 31 Jul 2013 15:56:56 +0000 (15:56 +0000)
fold.c
lexer.h

diff --git a/fold.c b/fold.c
index 662601bc0ab61a8c91478f6d38cc46e5a8c8c4a9..5f5c12774c9a30bc68262a23dda1315e75f54f72 100644 (file)
--- 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 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
 
 /*
  * 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) {
     }
 
     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);
         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 c8c6bfea0772da0ccf56e7862c803d745ad338ef..d0ca190d38915d7f41f42ca25bb6e9e6464d5ab3 100644 (file)
--- 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},
 
     { "++",  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}, */
     { "+",   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, 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},
 
 
     { "^",   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 */
 
     { "(",   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, 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},
 
     { "++",  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 */
 
     { "(",   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},
 
     { "+",   1, opid2('+','P'),     ASSOC_RIGHT, 14, OP_PREFIX, false},
     { "-",   1, opid2('-','P'),     ASSOC_RIGHT, 14, OP_PREFIX, true},