]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
folder: change ~ for floats too
authorWolfgang Bumiller <wry.git@bumiller.com>
Thu, 14 Nov 2013 10:41:11 +0000 (11:41 +0100)
committerWolfgang Bumiller <wry.git@bumiller.com>
Thu, 14 Nov 2013 10:41:11 +0000 (11:41 +0100)
fold.c

diff --git a/fold.c b/fold.c
index 48ae6f15c3e92aee67586fa98441fe07707f5f20..c75106ad74c472b8265e4f532a9e48257566e28b 100644 (file)
--- a/fold.c
+++ b/fold.c
@@ -616,7 +616,7 @@ static GMQCC_INLINE ast_expression *fold_op_cmp(fold_t *fold, ast_value *a, ast_
 static GMQCC_INLINE ast_expression *fold_op_bnot(fold_t *fold, ast_value *a) {
     if (isfloat(a)) {
         if (fold_can_1(a))
-            return fold_constgen_float(fold, ~((qcint_t)fold_immvalue_float(a)));
+            return fold_constgen_float(fold, -1-fold_immvalue_float(a));
     } else {
         if (isvector(a)) {
             if (fold_can_1(a))