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

ruby-changes:31832

From: nobu <ko1@a...>
Date: Fri, 29 Nov 2013 17:02:59 +0900 (JST)
Subject: [ruby-changes:31832] nobu:r43911 (trunk): ruby/ruby.h, enum.c, vm_eval.c: constify argv

nobu	2013-11-29 17:02:51 +0900 (Fri, 29 Nov 2013)

  New Revision: 43911

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43911

  Log:
    ruby/ruby.h, enum.c, vm_eval.c: constify argv
    
    * include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): constify argv.
    * enum.c (rb_enum_values_pack): ditto.
    * vm_eval.c (rb_block_call, rb_check_block_call): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/enum.c
    trunk/include/ruby/intern.h
    trunk/include/ruby/ruby.h
    trunk/internal.h
    trunk/vm_eval.c
Index: include/ruby/intern.h
===================================================================
--- include/ruby/intern.h	(revision 43910)
+++ include/ruby/intern.h	(revision 43911)
@@ -225,7 +225,7 @@ VALUE rb_fiber_yield(int argc, VALUE *ar https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L225
 VALUE rb_fiber_current(void);
 VALUE rb_fiber_alive_p(VALUE);
 /* enum.c */
-VALUE rb_enum_values_pack(int, VALUE*);
+VALUE rb_enum_values_pack(int, const VALUE*);
 /* enumerator.c */
 VALUE rb_enumeratorize(VALUE, VALUE, int, VALUE *);
 typedef VALUE rb_enumerator_size_func(VALUE, VALUE, VALUE);
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 43910)
+++ include/ruby/ruby.h	(revision 43911)
@@ -1495,7 +1495,7 @@ PRINTF_ARGS(void rb_compile_warn(const c https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1495
 
 #define RUBY_BLOCK_CALL_FUNC_TAKES_BLOCKARG 1
 #define RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg) \
-    VALUE yielded_arg, VALUE callback_arg, int argc, VALUE *argv, VALUE blockarg
+    VALUE yielded_arg, VALUE callback_arg, int argc, const VALUE *argv, VALUE blockarg
 typedef VALUE rb_block_call_func(RB_BLOCK_CALL_FUNC_ARGLIST(yielded_arg, callback_arg));
 
 #if defined RB_BLOCK_CALL_FUNC_STRICT && RB_BLOCK_CALL_FUNC_STRICT
@@ -1512,7 +1512,7 @@ VALUE rb_yield_splat(VALUE); https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1512
 int rb_block_given_p(void);
 void rb_need_block(void);
 VALUE rb_iterate(VALUE(*)(VALUE),VALUE,VALUE(*)(ANYARGS),VALUE);
-VALUE rb_block_call(VALUE,ID,int,VALUE*,rb_block_call_func_t,VALUE);
+VALUE rb_block_call(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE);
 VALUE rb_rescue(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE);
 VALUE rb_rescue2(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE,...);
 VALUE rb_ensure(VALUE(*)(ANYARGS),VALUE,VALUE(*)(ANYARGS),VALUE);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43910)
+++ ChangeLog	(revision 43911)
@@ -1,4 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
-Fri Nov 29 16:59:07 2013  Nobuyoshi Nakada  <nobu@r...>
+Fri Nov 29 17:02:48 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): constify argv.
+
+	* enum.c (rb_enum_values_pack): ditto.
+
+	* vm_eval.c (rb_block_call, rb_check_block_call): ditto.
 
 	* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration
 	  argument list of rb_block_call_func.
Index: enum.c
===================================================================
--- enum.c	(revision 43910)
+++ enum.c	(revision 43911)
@@ -30,7 +30,7 @@ static ID id_size; https://github.com/ruby/ruby/blob/trunk/enum.c#L30
 #define id_lshift idLTLT
 
 VALUE
-rb_enum_values_pack(int argc, VALUE *argv)
+rb_enum_values_pack(int argc, const VALUE *argv)
 {
     if (argc == 0) return Qnil;
     if (argc == 1) return argv[0];
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 43910)
+++ vm_eval.c	(revision 43911)
@@ -1122,7 +1122,7 @@ struct iter_method_arg { https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1122
     VALUE obj;
     ID mid;
     int argc;
-    VALUE *argv;
+    const VALUE *argv;
 };
 
 static VALUE
@@ -1135,7 +1135,7 @@ iterate_method(VALUE obj) https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1135
 }
 
 VALUE
-rb_block_call(VALUE obj, ID mid, int argc, VALUE * argv,
+rb_block_call(VALUE obj, ID mid, int argc, const VALUE * argv,
 	      VALUE (*bl_proc) (ANYARGS), VALUE data2)
 {
     struct iter_method_arg arg;
@@ -1157,7 +1157,7 @@ iterate_check_method(VALUE obj) https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1157
 }
 
 VALUE
-rb_check_block_call(VALUE obj, ID mid, int argc, VALUE * argv,
+rb_check_block_call(VALUE obj, ID mid, int argc, const VALUE *argv,
 		    VALUE (*bl_proc) (ANYARGS), VALUE data2)
 {
     struct iter_method_arg arg;
Index: internal.h
===================================================================
--- internal.h	(revision 43910)
+++ internal.h	(revision 43911)
@@ -751,7 +751,7 @@ void rb_print_backtrace(void); https://github.com/ruby/ruby/blob/trunk/internal.h#L751
 /* vm_eval.c */
 void Init_vm_eval(void);
 VALUE rb_current_realfilepath(void);
-VALUE rb_check_block_call(VALUE, ID, int, VALUE *, rb_block_call_func_t, VALUE);
+VALUE rb_check_block_call(VALUE, ID, int, const VALUE *, rb_block_call_func_t, VALUE);
 typedef void rb_check_funcall_hook(int, VALUE, ID, int, const VALUE *, VALUE);
 VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv,
 				 rb_check_funcall_hook *hook, VALUE arg);

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

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