From a860735d0c3cf25610ec02c463cf4bc239424966 Mon Sep 17 00:00:00 2001 From: cubicdaiya Date: Wed, 26 Feb 2014 03:03:47 +0900 Subject: use mrb_str_cat_lit() more widely --- mrbgems/mruby-proc-ext/src/proc.c | 12 ++++++------ mrbgems/mruby-struct/src/struct.c | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/mrbgems/mruby-proc-ext/src/proc.c b/mrbgems/mruby-proc-ext/src/proc.c index f27356bb7..3bb0d3570 100644 --- a/mrbgems/mruby-proc-ext/src/proc.c +++ b/mrbgems/mruby-proc-ext/src/proc.c @@ -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; } diff --git a/mrbgems/mruby-struct/src/struct.c b/mrbgems/mruby-struct/src/struct.c index 00a938dbf..85e01eddb 100644 --- a/mrbgems/mruby-struct/src/struct.c +++ b/mrbgems/mruby-struct/src/struct.c @@ -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; } -- cgit v1.2.3