summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--mrbgems/mruby-numeric-ext/src/numeric_ext.c2
-rw-r--r--src/array.c4
-rw-r--r--src/vm.c9
3 files changed, 9 insertions, 6 deletions
diff --git a/mrbgems/mruby-numeric-ext/src/numeric_ext.c b/mrbgems/mruby-numeric-ext/src/numeric_ext.c
index 09904c1a9..f193fb531 100644
--- a/mrbgems/mruby-numeric-ext/src/numeric_ext.c
+++ b/mrbgems/mruby-numeric-ext/src/numeric_ext.c
@@ -10,7 +10,7 @@ mrb_int_chr(mrb_state *mrb, mrb_value x)
chr = mrb_fixnum(x);
if (chr >= (1 << CHAR_BIT)) {
- mrb_raisef(mrb, E_RANGE_ERROR, "%" PRIdMRB_INT " out of char range", chr);
+ mrb_raisef(mrb, E_RANGE_ERROR, "%S out of char range", x);
}
c = (char)chr;
diff --git a/src/array.c b/src/array.c
index 88f56f6b4..b1f05b450 100644
--- a/src/array.c
+++ b/src/array.c
@@ -38,11 +38,11 @@ ary_new_capa(mrb_state *mrb, mrb_int capa)
mrb_int blen;
if (capa > ARY_MAX_SIZE) {
- mrb_raise(mrb, E_ARGUMENT_ERROR, "ary size too big");
+ mrb_raise(mrb, E_ARGUMENT_ERROR, "array size too big");
}
blen = capa * sizeof(mrb_value) ;
if (blen < capa) {
- mrb_raise(mrb, E_ARGUMENT_ERROR, "ary size too big");
+ mrb_raise(mrb, E_ARGUMENT_ERROR, "array size too big");
}
a = (struct RArray*)mrb_obj_alloc(mrb, MRB_TT_ARRAY, mrb->array_class);
diff --git a/src/vm.c b/src/vm.c
index b81ae249e..24b2945dc 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -55,6 +55,9 @@ The value below allows about 60000 recursive calls in the simplest case. */
# define DEBUG(x)
#endif
+#define TO_STR(x) TO_STR_(x)
+#define TO_STR_(x) #x
+
static inline void
stack_clear(mrb_value *from, size_t count)
{
@@ -133,9 +136,9 @@ stack_extend(mrb_state *mrb, int room, int keep)
mrb->stend = mrb->stbase + size;
envadjust(mrb, oldbase, mrb->stbase);
/* Raise an exception if the new stack size will be too large,
- to prevent infinite recursion. However, do this only after resizing the stack, so mrb_raisef has stack space to work with. */
+ to prevent infinite recursion. However, do this only after resizing the stack, so mrb_raise has stack space to work with. */
if (size > MRB_STACK_MAX) {
- mrb_raisef(mrb, E_RUNTIME_ERROR, "stack level too deep. (limit=%S)", mrb_fixnum_value(MRB_STACK_MAX));
+ mrb_raise(mrb, E_RUNTIME_ERROR, "stack level too deep. (limit=" TO_STR(MRB_STACK_MAX) ")");
}
}
@@ -275,7 +278,7 @@ mrb_funcall(mrb_state *mrb, mrb_value self, const char *name, int argc, ...)
int i;
if (argc > MRB_FUNCALL_ARGC_MAX) {
- mrb_raisef(mrb, E_ARGUMENT_ERROR, "Too long arguments. (limit=%S)", mrb_fixnum_value(MRB_FUNCALL_ARGC_MAX));
+ mrb_raise(mrb, E_ARGUMENT_ERROR, "Too long arguments. (limit=" TO_STR(MRB_FUNCALL_ARGC_MAX) ")");
}
va_start(ap, argc);