mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-24 04:41:25 +00:00
Use a branch instead of math on enum types
This commit is contained in:
parent
f43106017f
commit
1900262df4
1 changed files with 4 additions and 1 deletions
5
parser.c
5
parser.c
|
@ -476,7 +476,10 @@ static bool parser_sy_apply_operator(parser_t *parser, shunt *sy)
|
|||
type_name[exprs[0]->vtype]);
|
||||
return false;
|
||||
}
|
||||
out = (ast_expression*)ast_unary_new(ctx, (VINSTR_NEG_F-TYPE_FLOAT) + exprs[0]->vtype, exprs[0]);
|
||||
if (exprs[0]->vtype == TYPE_FLOAT)
|
||||
out = (ast_expression*)ast_unary_new(ctx, VINSTR_NEG_F, exprs[0]);
|
||||
else
|
||||
out = (ast_expression*)ast_unary_new(ctx, VINSTR_NEG_V, exprs[0]);
|
||||
break;
|
||||
|
||||
case opid2('!','P'):
|
||||
|
|
Loading…
Reference in a new issue