]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Remove &~= operator from gmqccs operator table, only fteqcc supports it.
authorDale Weiler <killfieldengine@gmail.com>
Thu, 29 Aug 2013 11:19:19 +0000 (07:19 -0400)
committerDale Weiler <killfieldengine@gmail.com>
Thu, 29 Aug 2013 11:19:19 +0000 (07:19 -0400)
lexer.h
tests/bitnot.qc
tests/bitnot.tmpl
tests/bitnotgmqcc.tmpl [new file with mode: 0644]

diff --git a/lexer.h b/lexer.h
index 2d67f3967e605ad9fd87dd5181919a03c07d5a72..48ab4b6e17b0a3b7af2aea2d6cbbb66af28ffee7 100644 (file)
--- a/lexer.h
+++ b/lexer.h
@@ -235,7 +235,6 @@ static const oper_info c_operators[] = {
     { "&=",  2, opid2('&','='),     ASSOC_RIGHT, 2,  0,         false},
     { "^=",  2, opid2('^','='),     ASSOC_RIGHT, 2,  0,         false},
     { "|=",  2, opid2('|','='),     ASSOC_RIGHT, 2,  0,         false},
-    { "&~=", 2, opid3('&','~','='), ASSOC_RIGHT, 2,  0,         false},
 
     { ":",   0, opid2(':','?'),     ASSOC_RIGHT, 1,  0,         false},
 
index 17ba6cd0e09dc7330caef5c33a56191de0bbbc90..54b6ecb30f7a2f4fe07e8cb84e20d6762a7a6e79 100644 (file)
@@ -6,11 +6,28 @@ void main() {
     vector e; e = '1 1 1';
     vector f; f = '1 1 1';
 
+#ifdef __STD_FTEQCC__
     a &~= 1; // 0
+#else
+    a &= ~1; // 0
+#endif
+#ifdef __STD_GMQCC__
     b &= ~1; // 0
     c &= ~d; // 0
+#else
+    b &~= 1; // 0
+    c &~= 1; // 0
+#endif
+#ifdef __STD_FTEQCC__
     f &~= e; // '0 0 0'
+#else
+    f &= ~e; // '0 0 0'
+#endif
+#ifdef __STD_GMQCC__
     e &= ~e; // '0 0 0'
+#else
+    e &~= e; // '0 0 0'
+#endif
 
     print("a: ", ftos(a), "\nb: ",
                  ftos(b), "\nc: ",
index b6a1eaa503c8003f61efd07347585712cc0514b5..45838e3c3e8414333ab402f2a8d71d284339fff2 100644 (file)
@@ -1,8 +1,8 @@
 # used to test the builtins
 I: bitnot.qc
-D: test bitwise not operators
+D: test bitwise not operators (fteqcc operators)
 T: -execute
-C: -std=gmqcc
+C: -std=fteqcc
 E: $null
 M: a: 0
 M: b: 0
diff --git a/tests/bitnotgmqcc.tmpl b/tests/bitnotgmqcc.tmpl
new file mode 100644 (file)
index 0000000..5614312
--- /dev/null
@@ -0,0 +1,11 @@
+# used to test the builtins
+I: bitnot.qc
+D: test bitwise not operators (gmqcc operators)
+T: -execute
+C: -std=gmqcc -fftepp
+E: $null
+M: a: 0
+M: b: 0
+M: c: 0
+M: e: '0 0 0'
+M: f: '0 0 0'