Skip to content

Commit

Permalink
Remove cast codde
Browse files Browse the repository at this point in the history
  • Loading branch information
S-H-GAMELINKS committed Nov 8, 2021
1 parent 8651b79 commit b61d46c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ast.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ node_children(rb_ast_t *ast, const NODE *node)

while (1) {
rb_ary_push(ary, NEW_CHILD(ast, node->nd_1st));
if (!node->nd_2nd || !nd_type_p(node->nd_2nd, (int)type))
if (!node->nd_2nd || !nd_type_p(node->nd_2nd, type))
break;
node = node->nd_2nd;
}
Expand Down
2 changes: 1 addition & 1 deletion node.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ dump_node(VALUE buf, VALUE indent, int comment, const NODE * node)
andor:
while (1) {
F_NODE(nd_1st, "left expr");
if (!node->nd_2nd || !nd_type_p(node->nd_2nd, (int)type))
if (!node->nd_2nd || !nd_type_p(node->nd_2nd, type))
break;
node = node->nd_2nd;
}
Expand Down
4 changes: 2 additions & 2 deletions parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -11839,9 +11839,9 @@ logop(struct parser_params *p, ID id, NODE *left, NODE *right,
enum node_type type = id == idAND || id == idANDOP ? NODE_AND : NODE_OR;
NODE *op;
value_expr(left);
if (left && (enum node_type)nd_type_p(left, type)) {
if (left && nd_type_p(left, type)) {
NODE *node = left, *second;
while ((second = node->nd_2nd) != 0 && (enum node_type)nd_type_p(second, type)) {
while ((second = node->nd_2nd) != 0 && nd_type_p(second, type)) {
node = second;
}
node->nd_2nd = NEW_NODE(type, second, right, 0, loc);
Expand Down

0 comments on commit b61d46c

Please sign in to comment.