mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 15:01:41 +00:00
Rename is_math() to is_math_op().
This commit is contained in:
parent
dea6771d92
commit
341f370662
2 changed files with 8 additions and 6 deletions
|
@ -450,7 +450,7 @@ int is_compare (int op);
|
|||
\param op The op-code to check.
|
||||
\return True if the op-code is a math operator.
|
||||
*/
|
||||
int is_math (int op);
|
||||
int is_math_op (int op);
|
||||
|
||||
/** Check if the op-code is a logic operator.
|
||||
|
||||
|
|
|
@ -1049,7 +1049,7 @@ is_compare (int op)
|
|||
}
|
||||
|
||||
int
|
||||
is_math (int op)
|
||||
is_math_op (int op)
|
||||
{
|
||||
if (op == '*' || op == '/' || op == '+' || op == '-')
|
||||
return 1;
|
||||
|
@ -1085,7 +1085,7 @@ check_precedence (int op, expr_t *e1, expr_t *e2)
|
|||
if (options.traditional) {
|
||||
if (e2->type == ex_expr && !e2->paren) {
|
||||
if (((op == '&' || op == '|')
|
||||
&& (is_math (e2->e.expr.op) || is_compare (e2->e.expr.op)))
|
||||
&& (is_math_op (e2->e.expr.op) || is_compare (e2->e.expr.op)))
|
||||
|| (op == '='
|
||||
&& (e2->e.expr.op == OR || e2->e.expr.op == AND))) {
|
||||
notice (e1, "precedence of `%s' and `%s' inverted for "
|
||||
|
@ -1107,7 +1107,7 @@ check_precedence (int op, expr_t *e1, expr_t *e2)
|
|||
}
|
||||
} else if (e1->type == ex_expr && !e1->paren) {
|
||||
if (((op == '&' || op == '|')
|
||||
&& (is_math (e1->e.expr.op) || is_compare (e1->e.expr.op)))
|
||||
&& (is_math_op (e1->e.expr.op) || is_compare (e1->e.expr.op)))
|
||||
|| (op == '='
|
||||
&& (e1->e.expr.op == OR || e1->e.expr.op == AND))) {
|
||||
notice (e1, "precedence of `%s' and `%s' inverted for "
|
||||
|
@ -1121,7 +1121,8 @@ check_precedence (int op, expr_t *e1, expr_t *e2)
|
|||
} else {
|
||||
if (e2->type == ex_expr && !e2->paren) {
|
||||
if ((op == '&' || op == '|' || op == '^')
|
||||
&& (is_math (e2->e.expr.op) || is_compare (e2->e.expr.op))) {
|
||||
&& (is_math_op (e2->e.expr.op)
|
||||
|| is_compare (e2->e.expr.op))) {
|
||||
if (options.warnings.precedence)
|
||||
warning (e2, "suggest parentheses around %s in "
|
||||
"operand of %c",
|
||||
|
@ -1133,7 +1134,8 @@ check_precedence (int op, expr_t *e1, expr_t *e2)
|
|||
}
|
||||
if (e1->type == ex_expr && !e1->paren) {
|
||||
if ((op == '&' || op == '|' || op == '^')
|
||||
&& (is_math (e1->e.expr.op) || is_compare (e1->e.expr.op))) {
|
||||
&& (is_math_op (e1->e.expr.op)
|
||||
|| is_compare (e1->e.expr.op))) {
|
||||
if (options.warnings.precedence)
|
||||
warning (e1, "suggest parentheses around %s in "
|
||||
"operand of %c",
|
||||
|
|
Loading…
Reference in a new issue