Skip to content

Commit efc971e

Browse files
committed
py: unary_op enum type fix, and a cast to remove clang warning
1 parent c9845a0 commit efc971e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

py/parse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ STATIC bool fold_constants(parser_t *parser, const rule_t *rule, size_t num_args
519519
MP_BINARY_OP_RSHIFT,
520520
};
521521
mp_binary_op_t op = token_to_op[tok - MP_TOKEN_OP_PLUS];
522-
if (op == 255) {
522+
if (op == (mp_binary_op_t)255) {
523523
return false;
524524
}
525525
int rhs_sign = mp_obj_int_sign(arg1);
@@ -543,7 +543,7 @@ STATIC bool fold_constants(parser_t *parser, const rule_t *rule, size_t num_args
543543
return false;
544544
}
545545
mp_token_kind_t tok = MP_PARSE_NODE_LEAF_ARG(peek_result(parser, 1));
546-
mp_binary_op_t op;
546+
mp_unary_op_t op;
547547
if (tok == MP_TOKEN_OP_PLUS) {
548548
op = MP_UNARY_OP_POSITIVE;
549549
} else if (tok == MP_TOKEN_OP_MINUS) {

0 commit comments

Comments
 (0)