From a6794c4b01ceb96d3d36f8854309e2e3b878f7e3 Mon Sep 17 00:00:00 2001 From: mame Date: Fri, 5 Jan 2018 07:47:51 +0000 Subject: [PATCH] node.c: constify NODE* arguments in node.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- node.c | 8 ++++---- node.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/node.c b/node.c index dfbfc9eb44..4254fd7425 100644 --- a/node.c +++ b/node.c @@ -132,11 +132,11 @@ dump_option(VALUE buf, VALUE indent, VALUE opt) rb_hash_foreach(opt, add_option_i, (VALUE)&arg); } -static void dump_node(VALUE, VALUE, int, NODE *); +static void dump_node(VALUE, VALUE, int, const NODE *); static const char default_indent[] = "| "; static void -dump_array(VALUE buf, VALUE indent, int comment, NODE *node) +dump_array(VALUE buf, VALUE indent, int comment, const NODE *node) { int field_flag; const char *next_indent = default_indent; @@ -151,7 +151,7 @@ dump_array(VALUE buf, VALUE indent, int comment, NODE *node) } static void -dump_node(VALUE buf, VALUE indent, int comment, NODE *node) +dump_node(VALUE buf, VALUE indent, int comment, const NODE * node) { int field_flag; int i; @@ -1056,7 +1056,7 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node) } VALUE -rb_parser_dump_tree(NODE *node, int comment) +rb_parser_dump_tree(const NODE *node, int comment) { VALUE buf = rb_str_new_cstr( "###########################################################\n" diff --git a/node.h b/node.h index 12f4d423a8..aa16a1f93f 100644 --- a/node.h +++ b/node.h @@ -470,7 +470,7 @@ typedef struct node_buffer_struct node_buffer_t; typedef struct rb_ast_struct { VALUE flags; VALUE reserved1; - NODE *root; + const NODE *root; node_buffer_t *node_buffer; VALUE mark_ary; } rb_ast_t; @@ -488,7 +488,7 @@ VALUE rb_parser_end_seen_p(VALUE); VALUE rb_parser_encoding(VALUE); VALUE rb_parser_get_yydebug(VALUE); VALUE rb_parser_set_yydebug(VALUE, VALUE); -VALUE rb_parser_dump_tree(NODE *node, int comment); +VALUE rb_parser_dump_tree(const NODE *node, int comment); void rb_parser_set_options(VALUE, int, int, int, int); rb_ast_t *rb_parser_compile_cstr(VALUE, const char*, const char*, int, int);