mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
combine 2 ifs to shorten code a little
This commit is contained in:
parent
8dd7943768
commit
4c5c615f95
1 changed files with 3 additions and 7 deletions
10
parser.c
10
parser.c
|
@ -613,13 +613,9 @@ static bool parser_sy_pop(parser_t *parser, shunt *sy)
|
||||||
break;
|
break;
|
||||||
case opid2('+','='):
|
case opid2('+','='):
|
||||||
case opid2('-','='):
|
case opid2('-','='):
|
||||||
if (exprs[0]->expression.vtype != exprs[1]->expression.vtype) {
|
if (exprs[0]->expression.vtype != exprs[1]->expression.vtype ||
|
||||||
parseerror(parser, "invalid types used in expression: cannot add or subtract type %s and %s",
|
(exprs[0]->expression.vtype != TYPE_VECTOR && exprs[0]->expression.vtype != TYPE_FLOAT) )
|
||||||
type_name[exprs[0]->expression.vtype],
|
{
|
||||||
type_name[exprs[1]->expression.vtype]);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (exprs[0]->expression.vtype != TYPE_VECTOR && exprs[0]->expression.vtype != TYPE_FLOAT) {
|
|
||||||
parseerror(parser, "invalid types used in expression: cannot add or subtract type %s and %s",
|
parseerror(parser, "invalid types used in expression: cannot add or subtract type %s and %s",
|
||||||
type_name[exprs[0]->expression.vtype],
|
type_name[exprs[0]->expression.vtype],
|
||||||
type_name[exprs[1]->expression.vtype]);
|
type_name[exprs[1]->expression.vtype]);
|
||||||
|
|
Loading…
Reference in a new issue