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

ruby-changes:30622

From: nobu <ko1@a...>
Date: Tue, 27 Aug 2013 16:08:41 +0900 (JST)
Subject: [ruby-changes:30622] nobu:r42701 (trunk): vm_eval.c: constify

nobu	2013-08-27 16:08:32 +0900 (Tue, 27 Aug 2013)

  New Revision: 42701

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

  Log:
    vm_eval.c: constify
    
    * vm_eval.c (rb_check_funcall, rb_check_funcall_with_hook): constify
      argv.

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/intern.h
    trunk/internal.h
    trunk/vm_eval.c
Index: include/ruby/intern.h
===================================================================
--- include/ruby/intern.h	(revision 42700)
+++ include/ruby/intern.h	(revision 42701)
@@ -289,7 +289,7 @@ void rb_check_copyable(VALUE obj, VALUE https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L289
 /* eval.c */
 int rb_sourceline(void);
 const char *rb_sourcefile(void);
-VALUE rb_check_funcall(VALUE, ID, int, VALUE*);
+VALUE rb_check_funcall(VALUE, ID, int, const VALUE*);
 
 NORETURN(void rb_error_arity(int, int, int));
 #define rb_check_arity rb_check_arity /* for ifdef */
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42700)
+++ ChangeLog	(revision 42701)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Aug 27 16:08:26 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* vm_eval.c (rb_check_funcall, rb_check_funcall_with_hook): constify
+	  argv.
+
 Tue Aug 27 13:03:33 2013  Koichi Sasada  <ko1@a...>
 
 	* ext/stringio/stringio.c (strio_read_nonblock): declare local
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 42700)
+++ vm_eval.c	(revision 42701)
@@ -328,7 +328,7 @@ struct rescue_funcall_args { https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L328
     VALUE recv;
     VALUE sym;
     int argc;
-    VALUE *argv;
+    const VALUE *argv;
 };
 
 static VALUE
@@ -385,7 +385,7 @@ check_funcall_callable(rb_thread_t *th, https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L385
 }
 
 static VALUE
-check_funcall_missing(rb_thread_t *th, VALUE klass, VALUE recv, ID mid, int argc, VALUE *argv)
+check_funcall_missing(rb_thread_t *th, VALUE klass, VALUE recv, ID mid, int argc, const VALUE *argv)
 {
     if (rb_method_basic_definition_p(klass, idMethodMissing)) {
 	return Qundef;
@@ -405,7 +405,7 @@ check_funcall_missing(rb_thread_t *th, V https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L405
 }
 
 VALUE
-rb_check_funcall(VALUE recv, ID mid, int argc, VALUE *argv)
+rb_check_funcall(VALUE recv, ID mid, int argc, const VALUE *argv)
 {
     VALUE klass = CLASS_OF(recv);
     const rb_method_entry_t *me;
@@ -424,7 +424,7 @@ rb_check_funcall(VALUE recv, ID mid, int https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L424
 }
 
 VALUE
-rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, VALUE *argv,
+rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, const VALUE *argv,
 			   rb_check_funcall_hook *hook, VALUE arg)
 {
     VALUE klass = CLASS_OF(recv);
Index: internal.h
===================================================================
--- internal.h	(revision 42700)
+++ internal.h	(revision 42701)
@@ -479,8 +479,8 @@ void rb_print_backtrace(void); https://github.com/ruby/ruby/blob/trunk/internal.h#L479
 void Init_vm_eval(void);
 VALUE rb_current_realfilepath(void);
 VALUE rb_check_block_call(VALUE, ID, int, VALUE *, VALUE (*)(ANYARGS), VALUE);
-typedef void rb_check_funcall_hook(int, VALUE, ID, int, VALUE *, VALUE);
-VALUE rb_check_funcall_with_hook(VALUE recv, ID mid, int argc, VALUE *argv,
+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);
 
 /* vm_method.c */

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

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