Commit a860735d authored by cubicdaiya's avatar cubicdaiya

use mrb_str_cat_lit() more widely

parent 6b3801c3
......@@ -39,29 +39,29 @@ mrb_proc_inspect(mrb_state *mrb, mrb_value self)
if (!MRB_PROC_CFUNC_P(p)) {
mrb_irep *irep = p->body.irep;
mrb_str_cat_cstr(mrb, str, "@");
mrb_str_cat_lit(mrb, str, "@");
if (irep->filename) {
mrb_str_cat_cstr(mrb, str, irep->filename);
}
else {
mrb_str_cat_cstr(mrb, str, "-");
mrb_str_cat_lit(mrb, str, "-");
}
mrb_str_cat_cstr(mrb, str, ":");
mrb_str_cat_lit(mrb, str, ":");
if (irep->lines) {
mrb_str_append(mrb, str, mrb_fixnum_value(*irep->lines));
}
else {
mrb_str_cat_cstr(mrb, str, "-");
mrb_str_cat_lit(mrb, str, "-");
}
}
if (MRB_PROC_STRICT_P(p)) {
mrb_str_cat_cstr(mrb, str, " (lambda)");
mrb_str_cat_lit(mrb, str, " (lambda)");
}
mrb_str_cat_cstr(mrb, str, ">");
mrb_str_cat_lit(mrb, str, ">");
return str;
}
......
......@@ -450,7 +450,7 @@ inspect_struct(mrb_state *mrb, mrb_value s, int recur)
mrb_str_append(mrb, str, mrb_str_new_cstr(mrb, cn));
}
if (recur) {
return mrb_str_cat_cstr(mrb, str, ":...>");
return mrb_str_cat_lit(mrb, str, ":...>");
}
members = mrb_struct_members(mrb, s);
......@@ -462,10 +462,10 @@ inspect_struct(mrb_state *mrb, mrb_value s, int recur)
mrb_sym id;
if (i > 0) {
mrb_str_cat_cstr(mrb, str, ", ");
mrb_str_cat_lit(mrb, str, ", ");
}
else if (cn) {
mrb_str_cat_cstr(mrb, str, " ");
mrb_str_cat_lit(mrb, str, " ");
}
slot = ptr_members[i];
id = mrb_symbol(slot);
......@@ -479,10 +479,10 @@ inspect_struct(mrb_state *mrb, mrb_value s, int recur)
else {
mrb_str_append(mrb, str, mrb_inspect(mrb, slot));
}
mrb_str_cat_cstr(mrb, str, "=");
mrb_str_cat_lit(mrb, str, "=");
mrb_str_append(mrb, str, mrb_inspect(mrb, ptr[i]));
}
mrb_str_cat_cstr(mrb, str, ">");
mrb_str_cat_lit(mrb, str, ">");
return str;
}
......
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