Rename `mrb_num_args_error` to `mrb_argnum_error`; ref #4863

parent b9c78c3f
......@@ -1232,7 +1232,7 @@ MRB_API mrb_noreturn void mrb_raise(mrb_state *mrb, struct RClass *c, const char
MRB_API mrb_noreturn void mrb_raisef(mrb_state *mrb, struct RClass *c, const char *fmt, ...);
MRB_API mrb_noreturn void mrb_name_error(mrb_state *mrb, mrb_sym id, const char *fmt, ...);
MRB_API mrb_noreturn void mrb_frozen_error(mrb_state *mrb, void *frozen_obj);
MRB_API mrb_noreturn void mrb_num_args_error(mrb_state *mrb, mrb_int argc, int min, int max);
MRB_API mrb_noreturn void mrb_argnum_error(mrb_state *mrb, mrb_int argc, int min, int max);
MRB_API void mrb_warn(mrb_state *mrb, const char *fmt, ...);
MRB_API mrb_noreturn void mrb_bug(mrb_state *mrb, const char *fmt, ...);
MRB_API void mrb_print_backtrace(mrb_state *mrb);
......
......@@ -1047,7 +1047,7 @@ mrb_io_s_select(mrb_state *mrb, mrb_value klass)
mrb_get_args(mrb, "*", &argv, &argc);
if (argc < 1 || argc > 4) {
mrb_num_args_error(mrb, argc, 1, 4);
mrb_argnum_error(mrb, argc, 1, 4);
}
timeout = mrb_nil_value();
......
......@@ -476,7 +476,7 @@ mrb_basicsocket_setsockopt(mrb_state *mrb, mrb_value self)
optname = mrb_fixnum(mrb_funcall(mrb, so, "optname", 0));
optval = mrb_funcall(mrb, so, "data", 0);
} else {
mrb_num_args_error(mrb, argc, 3, 3);
mrb_argnum_error(mrb, argc, 3, 3);
}
s = socket_fd(mrb, self);
......
......@@ -274,7 +274,7 @@ mrb_struct_s_def(mrb_state *mrb, mrb_value klass)
name = mrb_nil_value();
mrb_get_args(mrb, "*&", &argv, &argc, &b);
if (argc == 0) { /* special case to avoid crash */
mrb_num_args_error(mrb, argc, 1, -1);
mrb_argnum_error(mrb, argc, 1, -1);
}
else {
pargv = argv;
......
......@@ -481,7 +481,7 @@ exception_call:
break;
default:
mrb_num_args_error(mrb, argc, 0, 3);
mrb_argnum_error(mrb, argc, 0, 3);
break;
}
if (argc > 0) {
......@@ -538,7 +538,7 @@ mrb_frozen_error(mrb_state *mrb, void *frozen_obj)
}
MRB_API mrb_noreturn void
mrb_num_args_error(mrb_state *mrb, mrb_int argc, int min, int max)
mrb_argnum_error(mrb_state *mrb, mrb_int argc, int min, int max)
{
#define FMT(exp) "wrong number of arguments (given %i, expected " exp ")"
if (min == max)
......
......@@ -800,7 +800,7 @@ mrb_hash_init(mrb_state *mrb, mrb_value hash)
mrb_hash_modify(mrb, hash);
if (!mrb_nil_p(block)) {
if (ifnone_p) {
mrb_num_args_error(mrb, 1, 0, 0);
mrb_argnum_error(mrb, 1, 0, 0);
}
RHASH(hash)->flags |= MRB_HASH_PROC_DEFAULT;
ifnone = block;
......
......@@ -384,7 +384,7 @@ mrb_obj_extend(mrb_state *mrb, mrb_int argc, mrb_value *argv, mrb_value obj)
mrb_int i;
if (argc == 0) {
mrb_num_args_error(mrb, argc, 1, -1);
mrb_argnum_error(mrb, argc, 1, -1);
}
for (i = 0; i < argc; i++) {
mrb_check_type(mrb, argv[i], MRB_TT_MODULE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment