summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-18 06:16:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-18 06:16:39 +0000
commite99ee55abcdbd3057f5ef7d4ef6692457815afaa (patch)
tree11045e400ee148e10afd1a8908da076cea4d1387 /process.c
parenta1660e97f574033cfe7df9e9cc629073af37969c (diff)
constify parameters
* include/ruby/intern.h: constify `argv` parameters. * include/ruby/ruby.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/process.c b/process.c
index bf9f42b..cd498fe 100644
--- a/process.c
+++ b/process.c
@@ -2435,7 +2435,7 @@ static int rb_exec_without_timer_thread(const struct rb_execarg *eargp, char *er
*/
VALUE
-rb_f_exec(int argc, VALUE *argv)
+rb_f_exec(int argc, const VALUE *argv)
{
VALUE execarg_obj, fail_str;
struct rb_execarg *eargp;
@@ -3585,7 +3585,7 @@ rb_exit(int status)
*/
VALUE
-rb_f_exit(int argc, VALUE *argv)
+rb_f_exit(int argc, const VALUE *argv)
{
VALUE status;
int istatus;
@@ -3614,8 +3614,9 @@ rb_f_exit(int argc, VALUE *argv)
*/
VALUE
-rb_f_abort(int argc, VALUE *argv)
+rb_f_abort(int argc, const VALUE *argv)
{
+ rb_check_arity(argc, 0, 1);
if (argc == 0) {
if (!NIL_P(GET_THREAD()->errinfo)) {
ruby_error_print();
@@ -3625,9 +3626,9 @@ rb_f_abort(int argc, VALUE *argv)
else {
VALUE args[2];
- rb_scan_args(argc, argv, "1", &args[1]);
- StringValue(argv[0]);
- rb_io_puts(argc, argv, rb_stderr);
+ args[1] = args[0] = argv[0];
+ StringValue(args[0]);
+ rb_io_puts(1, args, rb_stderr);
args[0] = INT2NUM(EXIT_FAILURE);
rb_exc_raise(rb_class_new_instance(2, args, rb_eSystemExit));
}
@@ -3694,7 +3695,7 @@ rb_spawn_process(struct rb_execarg *eargp, char *errmsg, size_t errmsg_buflen)
}
static rb_pid_t
-rb_spawn_internal(int argc, VALUE *argv, char *errmsg, size_t errmsg_buflen)
+rb_spawn_internal(int argc, const VALUE *argv, char *errmsg, size_t errmsg_buflen)
{
VALUE execarg_obj;
struct rb_execarg *eargp;
@@ -3709,13 +3710,13 @@ rb_spawn_internal(int argc, VALUE *argv, char *errmsg, size_t errmsg_buflen)
}
rb_pid_t
-rb_spawn_err(int argc, VALUE *argv, char *errmsg, size_t errmsg_buflen)
+rb_spawn_err(int argc, const VALUE *argv, char *errmsg, size_t errmsg_buflen)
{
return rb_spawn_internal(argc, argv, errmsg, errmsg_buflen);
}
rb_pid_t
-rb_spawn(int argc, VALUE *argv)
+rb_spawn(int argc, const VALUE *argv)
{
return rb_spawn_internal(argc, argv, NULL, 0);
}