From b61d46c5b4f7683c3c2d006a9c984505adfe2e80 Mon Sep 17 00:00:00 2001 From: S-H-GAMELINKS Date: Mon, 8 Nov 2021 22:42:10 +0900 Subject: [PATCH] Remove cast codde --- ast.c | 2 +- node.c | 2 +- parse.y | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ast.c b/ast.c index 9a731327878ff6..1ca9d58b298934 100644 --- a/ast.c +++ b/ast.c @@ -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; } diff --git a/node.c b/node.c index b51b8a9c5a3b1d..84c2bf9088ba5b 100644 --- a/node.c +++ b/node.c @@ -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; } diff --git a/parse.y b/parse.y index 3a023d4ff71247..c0126e9238d7f9 100644 --- a/parse.y +++ b/parse.y @@ -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);