From 6a0553231547644f06c9f16f0e28e0337185fb79 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 8 Jul 2020 18:07:30 +0900 Subject: Constified NODE pointer in ASTNodeData --- ast.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ast.c') diff --git a/ast.c b/ast.c index 575458fa95..6650966477 100644 --- a/ast.c +++ b/ast.c @@ -17,7 +17,7 @@ static VALUE rb_cNode; struct ASTNodeData { rb_ast_t *ast; - NODE *node; + const NODE *node; }; static void @@ -44,7 +44,7 @@ static const rb_data_type_t rb_node_type = { static VALUE rb_ast_node_alloc(VALUE klass); static void -setup_node(VALUE obj, rb_ast_t *ast, NODE *node) +setup_node(VALUE obj, rb_ast_t *ast, const NODE *node) { struct ASTNodeData *data; @@ -54,7 +54,7 @@ setup_node(VALUE obj, rb_ast_t *ast, NODE *node) } static VALUE -ast_new_internal(rb_ast_t *ast, NODE *node) +ast_new_internal(rb_ast_t *ast, const NODE *node) { VALUE obj; @@ -145,7 +145,7 @@ rb_ast_parse_array(VALUE array) return ast_parse_done(ast); } -static VALUE node_children(rb_ast_t*, NODE*); +static VALUE node_children(rb_ast_t*, const NODE*); static VALUE node_find(VALUE self, const int node_id) @@ -268,7 +268,7 @@ rb_ary_new_from_node_args(rb_ast_t *ast, long n, ...) } static VALUE -dump_block(rb_ast_t *ast, NODE *node) +dump_block(rb_ast_t *ast, const NODE *node) { VALUE ary = rb_ary_new(); do { @@ -284,7 +284,7 @@ dump_block(rb_ast_t *ast, NODE *node) } static VALUE -dump_array(rb_ast_t *ast, NODE *node) +dump_array(rb_ast_t *ast, const NODE *node) { VALUE ary = rb_ary_new(); rb_ary_push(ary, NEW_CHILD(ast, node->nd_head)); @@ -307,7 +307,7 @@ var_name(ID id) } static VALUE -node_children(rb_ast_t *ast, NODE *node) +node_children(rb_ast_t *ast, const NODE *node) { char name[DECIMAL_SIZE_OF_BITS(sizeof(long) * CHAR_BIT) + 2]; /* including '$' */ -- cgit v1.2.3