summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-27 07:08:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-27 07:08:32 +0000
commit92d7cdc29a3850b49dded341cf2708ad069bd4d1 (patch)
tree5ca11159c5f7eadebcb146392b2036a6889297ce
parent69c8ab256d8e3609dec98a763288b87cd1278f6b (diff)
vm_eval.c: constify
* vm_eval.c (rb_check_funcall, rb_check_funcall_with_hook): constify argv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--include/ruby/intern.h2
-rw-r--r--internal.h4
-rw-r--r--vm_eval.c8
4 files changed, 12 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index f9cb8ad4e2..3e84a1439a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Aug 27 16:08:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * vm_eval.c (rb_check_funcall, rb_check_funcall_with_hook): constify
+ argv.
+
Tue Aug 27 13:03:33 2013 Koichi Sasada <ko1@atdot.net>
* ext/stringio/stringio.c (strio_read_nonblock): declare local
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index d2699caca8..e8821acda4 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -289,7 +289,7 @@ void rb_check_copyable(VALUE obj, VALUE orig);
/* 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 */
diff --git a/internal.h b/internal.h
index e196b23cd2..efbf31fece 100644
--- a/internal.h
+++ b/internal.h
@@ -479,8 +479,8 @@ void rb_print_backtrace(void);
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 */
diff --git a/vm_eval.c b/vm_eval.c
index 99a98d5cf5..037deecf13 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -328,7 +328,7 @@ struct rescue_funcall_args {
VALUE recv;
VALUE sym;
int argc;
- VALUE *argv;
+ const VALUE *argv;
};
static VALUE
@@ -385,7 +385,7 @@ check_funcall_callable(rb_thread_t *th, const rb_method_entry_t *me)
}
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, VALUE klass, VALUE recv, ID mid, int argc
}
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 argc, VALUE *argv)
}
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);