Skip to content

Commit 824d345

Browse files
committed
Qualify argv argument of API const.
1 parent b20d711 commit 824d345

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

include/mruby.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ void mrb_define_module_function(mrb_state*, struct RClass*, const char*, mrb_fun
184184
void mrb_define_const(mrb_state*, struct RClass*, const char *name, mrb_value);
185185
void mrb_undef_method(mrb_state*, struct RClass*, const char*);
186186
void mrb_undef_class_method(mrb_state*, struct RClass*, const char*);
187-
mrb_value mrb_obj_new(mrb_state *mrb, struct RClass *c, int argc, mrb_value *argv);
187+
mrb_value mrb_obj_new(mrb_state *mrb, struct RClass *c, int argc, const mrb_value *argv);
188188
#define mrb_class_new_instance(mrb,argc,argv,c) mrb_obj_new(mrb,c,argc,argv)
189189
mrb_value mrb_instance_new(mrb_state *mrb, mrb_value cv);
190190
struct RClass * mrb_class_new(mrb_state *mrb, struct RClass *super);
@@ -243,8 +243,8 @@ int mrb_get_args(mrb_state *mrb, const char *format, ...);
243243
#define mrb_strlen_lit(lit) (sizeof(lit "") - 1)
244244

245245
mrb_value mrb_funcall(mrb_state*, mrb_value, const char*, int,...);
246-
mrb_value mrb_funcall_argv(mrb_state*, mrb_value, mrb_sym, int, mrb_value*);
247-
mrb_value mrb_funcall_with_block(mrb_state*, mrb_value, mrb_sym, int, mrb_value*, mrb_value);
246+
mrb_value mrb_funcall_argv(mrb_state*, mrb_value, mrb_sym, int, const mrb_value*);
247+
mrb_value mrb_funcall_with_block(mrb_state*, mrb_value, mrb_sym, int, const mrb_value*, mrb_value);
248248
mrb_sym mrb_intern_cstr(mrb_state*,const char*);
249249
mrb_sym mrb_intern(mrb_state*,const char*,size_t);
250250
mrb_sym mrb_intern_static(mrb_state*,const char*,size_t);
@@ -390,7 +390,7 @@ mrb_bool mrb_respond_to(mrb_state *mrb, mrb_value obj, mrb_sym mid);
390390
mrb_bool mrb_obj_is_instance_of(mrb_state *mrb, mrb_value obj, struct RClass* c);
391391

392392
/* fiber functions (you need to link mruby-fiber mrbgem to use) */
393-
mrb_value mrb_fiber_yield(mrb_state *mrb, int argc, mrb_value *argv);
393+
mrb_value mrb_fiber_yield(mrb_state *mrb, int argc, const mrb_value *argv);
394394
#define E_FIBER_ERROR (mrb_class_get(mrb, "FiberError"))
395395

396396
/* memory pool implementation */

include/mruby/error.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extern "C" {
1414
void mrb_sys_fail(mrb_state *mrb, const char *mesg);
1515
mrb_value mrb_exc_new_str(mrb_state *mrb, struct RClass* c, mrb_value str);
1616
#define mrb_exc_new_str_lit(mrb, c, lit) mrb_exc_new_str(mrb, c, mrb_str_new_lit(mrb, lit))
17-
mrb_value mrb_make_exception(mrb_state *mrb, int argc, mrb_value *argv);
17+
mrb_value mrb_make_exception(mrb_state *mrb, int argc, const mrb_value *argv);
1818
mrb_value mrb_format(mrb_state *mrb, const char *format, ...);
1919
void mrb_exc_print(mrb_state *mrb, struct RObject *exc);
2020
void mrb_print_backtrace(mrb_state *mrb);

mrbgems/mruby-fiber/src/fiber.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ fiber_transfer(mrb_state *mrb, mrb_value self)
259259
}
260260

261261
mrb_value
262-
mrb_fiber_yield(mrb_state *mrb, int len, mrb_value *a)
262+
mrb_fiber_yield(mrb_state *mrb, int len, const mrb_value *a)
263263
{
264264
struct mrb_context *c = mrb->c;
265265
mrb_callinfo *ci;

src/class.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ mrb_instance_new(mrb_state *mrb, mrb_value cv)
10921092
}
10931093

10941094
mrb_value
1095-
mrb_obj_new(mrb_state *mrb, struct RClass *c, int argc, mrb_value *argv)
1095+
mrb_obj_new(mrb_state *mrb, struct RClass *c, int argc, const mrb_value *argv)
10961096
{
10971097
mrb_value obj;
10981098

src/error.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ set_backtrace(mrb_state *mrb, mrb_value info, mrb_value bt)
353353
}
354354

355355
static mrb_value
356-
make_exception(mrb_state *mrb, int argc, mrb_value *argv, mrb_bool isstr)
356+
make_exception(mrb_state *mrb, int argc, const mrb_value *argv, mrb_bool isstr)
357357
{
358358
mrb_value mesg;
359359
int n;
@@ -406,7 +406,7 @@ make_exception(mrb_state *mrb, int argc, mrb_value *argv, mrb_bool isstr)
406406
}
407407

408408
mrb_value
409-
mrb_make_exception(mrb_state *mrb, int argc, mrb_value *argv)
409+
mrb_make_exception(mrb_state *mrb, int argc, const mrb_value *argv)
410410
{
411411
return make_exception(mrb, argc, argv, TRUE);
412412
}

src/vm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ mrb_funcall(mrb_state *mrb, mrb_value self, const char *name, int argc, ...)
323323
}
324324

325325
mrb_value
326-
mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mrb_value *argv, mrb_value blk)
326+
mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, const mrb_value *argv, mrb_value blk)
327327
{
328328
mrb_value val;
329329

@@ -413,7 +413,7 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mr
413413
}
414414

415415
mrb_value
416-
mrb_funcall_argv(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mrb_value *argv)
416+
mrb_funcall_argv(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, const mrb_value *argv)
417417
{
418418
return mrb_funcall_with_block(mrb, self, mid, argc, argv, mrb_nil_value());
419419
}

0 commit comments

Comments
 (0)