summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-29 08:02:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-29 08:02:51 +0000
commit58553ca18487083d8a7f72068545e75788e1c8bc (patch)
tree71d6302087f732d1aae088ef54159a9f5df4b2fb
parent7566c49068869c222385ffb26bf91b666b3390b1 (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--enum.c2
-rw-r--r--include/ruby/intern.h2
-rw-r--r--include/ruby/ruby.h4
-rw-r--r--internal.h2
-rw-r--r--vm_eval.c6
6 files changed, 15 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 00345af..d08447f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-Fri Nov 29 16:59:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Nov 29 17:02:48 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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.
diff --git a/enum.c b/enum.c
index 7ff401a..aae4454 100644
--- a/enum.c
+++ b/enum.c
@@ -30,7 +30,7 @@ static ID id_size;
#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];
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 4ee6b09..c1114ae 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -225,7 +225,7 @@ VALUE rb_fiber_yield(int argc, VALUE *args);
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);
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index aa25df1..baa6f47 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1495,7 +1495,7 @@ PRINTF_ARGS(void rb_compile_warn(const char *, int, const char*, ...), 3, 4);
#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);
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);
diff --git a/internal.h b/internal.h
index 2849f4b..3612a98 100644
--- a/internal.h
+++ b/internal.h
@@ -751,7 +751,7 @@ void rb_print_backtrace(void);
/* 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);
diff --git a/vm_eval.c b/vm_eval.c
index 6c248e4..2dcbd45 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -1122,7 +1122,7 @@ struct iter_method_arg {
VALUE obj;
ID mid;
int argc;
- VALUE *argv;
+ const VALUE *argv;
};
static VALUE
@@ -1135,7 +1135,7 @@ iterate_method(VALUE obj)
}
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)
}
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;