Use NOT operator to complement bits instead of XOR

The previous way of doing it relied on the variable being 32-bit wide.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2017-12-31 13:09:08 +01:00
parent 0cbe6abbd5
commit c24cab6d1d
3 changed files with 3 additions and 3 deletions

View File

@@ -1220,7 +1220,7 @@ const : T_ID { $$ = sym_GetConstantValue($1); }
}
| T_OP_ADD const %prec NEG { $$ = +$2; }
| T_OP_SUB const %prec NEG { $$ = -$2; }
| T_OP_NOT const %prec NEG { $$ = 0xFFFFFFFF^$2; }
| T_OP_NOT const %prec NEG { $$ = ~$2; }
| T_OP_ROUND '(' const ')' { $$ = math_Round($3); }
| T_OP_CEIL '(' const ')' { $$ = math_Ceil($3); }
| T_OP_FLOOR '(' const ')' { $$ = math_Floor($3); }