summaryrefslogtreecommitdiffhomepage
path: root/src/error.c
diff options
context:
space:
mode:
authorKOBAYASHI Shuji <[email protected]>2019-08-05 12:41:15 +0900
committerKOBAYASHI Shuji <[email protected]>2019-08-05 13:18:50 +0900
commit334afb167c0a1fa478a53c3844f37c0f1fd866dd (patch)
treecf67a9759a8608edbe1cad3146c155852445bc1d /src/error.c
parent0e2e8b79d327da9b2ba0ce42e02cf6653c3e3fae (diff)
downloadmruby-334afb167c0a1fa478a53c3844f37c0f1fd866dd.tar.gz
mruby-334afb167c0a1fa478a53c3844f37c0f1fd866dd.zip
Use new specifiers/modifiers of `mrb_vfromat()`
The binary sizes (gems are only `mruby-bin-mruby`) are reduced slightly in my environment than before the introduction of new specifiers/modifiers (5116789a) with this change. ------------+-------------------+-------------------+-------- BINARY | BEFORE (5116789a) | AFTER (This PR) | RATIO ------------+-------------------+-------------------+-------- mruby | 593416 bytes | 593208 bytes | -0.04% libmruby.a | 769048 bytes | 767264 bytes | -0.23% ------------+-------------------+-------------------+-------- BTW, I accidentally changed `tasks/toolchains/visualcpp.rake` at #4613, so I put it back.
Diffstat (limited to 'src/error.c')
-rw-r--r--src/error.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/error.c b/src/error.c
index 0ca7f5917..664da3fd6 100644
--- a/src/error.c
+++ b/src/error.c
@@ -151,14 +151,14 @@ exc_inspect(mrb_state *mrb, mrb_value exc)
str = mrb_str_new_cstr(mrb, cname);
if (mrb_string_p(file) && mrb_fixnum_p(line)) {
if (append_mesg) {
- str = mrb_format(mrb, "%S:%S: %S (%S)", file, line, mesg, str);
+ str = mrb_format(mrb, "%v:%v: %v (%v)", file, line, mesg, str);
}
else {
- str = mrb_format(mrb, "%S:%S: %S", file, line, str);
+ str = mrb_format(mrb, "%v:%v: %v", file, line, str);
}
}
else if (append_mesg) {
- str = mrb_format(mrb, "%S: %S", str, mesg);
+ str = mrb_format(mrb, "%v: %v", str, mesg);
}
return str;
}
@@ -523,7 +523,7 @@ exception_call:
break;
default:
- mrb_raisef(mrb, E_ARGUMENT_ERROR, "wrong number of arguments (%S for 0..3)", mrb_fixnum_value(argc));
+ mrb_raisef(mrb, E_ARGUMENT_ERROR, "wrong number of arguments (%i for 0..3)", argc);
break;
}
if (argc > 0) {
@@ -576,8 +576,7 @@ mrb_no_method_error(mrb_state *mrb, mrb_sym id, mrb_value args, char const* fmt,
MRB_API mrb_noreturn void
mrb_frozen_error(mrb_state *mrb, void *frozen_obj)
{
- mrb_raisef(mrb, E_FROZEN_ERROR, "can't modify frozen %S",
- mrb_obj_value(mrb_class(mrb, mrb_obj_value(frozen_obj))));
+ mrb_raisef(mrb, E_FROZEN_ERROR, "can't modify frozen %t", mrb_obj_value(frozen_obj));
}
void