[前][次][番号順一覧][スレッド一覧]

ruby-changes:49492

From: mame <ko1@a...>
Date: Fri, 5 Jan 2018 16:47:56 +0900 (JST)
Subject: [ruby-changes:49492] mame:r61607 (trunk): node.c: constify NODE* arguments in node.c

mame	2018-01-05 16:47:51 +0900 (Fri, 05 Jan 2018)

  New Revision: 61607

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61607

  Log:
    node.c: constify NODE* arguments in node.c

  Modified files:
    trunk/node.c
    trunk/node.h
Index: node.c
===================================================================
--- node.c	(revision 61606)
+++ node.c	(revision 61607)
@@ -132,11 +132,11 @@ dump_option(VALUE buf, VALUE indent, VAL https://github.com/ruby/ruby/blob/trunk/node.c#L132
     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 https://github.com/ruby/ruby/blob/trunk/node.c#L151
 }
 
 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 c https://github.com/ruby/ruby/blob/trunk/node.c#L1056
 }
 
 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"
Index: node.h
===================================================================
--- node.h	(revision 61606)
+++ node.h	(revision 61607)
@@ -470,7 +470,7 @@ typedef struct node_buffer_struct node_b https://github.com/ruby/ruby/blob/trunk/node.h#L470
 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); https://github.com/ruby/ruby/blob/trunk/node.h#L488
 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);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]