diff options
| author | cubicdaiya <[email protected]> | 2014-02-26 03:03:47 +0900 |
|---|---|---|
| committer | cubicdaiya <[email protected]> | 2014-02-26 03:03:47 +0900 |
| commit | a860735d0c3cf25610ec02c463cf4bc239424966 (patch) | |
| tree | 06076142eeb3ed2f43f95704a1d59fbb7f472464 | |
| parent | 6b3801c30d6d398024727c1065cac42407814a50 (diff) | |
| download | mruby-a860735d0c3cf25610ec02c463cf4bc239424966.tar.gz mruby-a860735d0c3cf25610ec02c463cf4bc239424966.zip | |
use mrb_str_cat_lit() more widely
| -rw-r--r-- | mrbgems/mruby-proc-ext/src/proc.c | 12 | ||||
| -rw-r--r-- | 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; } |
