diff options
| -rw-r--r-- | src/class.c | 8 | ||||
| -rw-r--r-- | src/struct.c | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/class.c b/src/class.c index a9bf54a3b..881a0072e 100644 --- a/src/class.c +++ b/src/class.c @@ -966,15 +966,14 @@ mrb_value mrb_class_path(mrb_state *mrb, struct RClass *c) { mrb_value path; + const char *name; + int len; path = mrb_obj_iv_get(mrb, (struct RObject*)c, mrb_intern(mrb, "__classpath__")); if (mrb_nil_p(path)) { struct RClass *outer = mrb_class_outer_module(mrb, c); mrb_sym sym = class_sym(mrb, c, outer); if (outer && outer != mrb->object_class) { - char *name; - int len; - mrb_value base = mrb_class_path(mrb, outer); path = mrb_str_plus(mrb, base, mrb_str_new(mrb, "::", 2)); name = mrb_sym2name_len(mrb, sym, &len); @@ -984,9 +983,6 @@ mrb_class_path(mrb_state *mrb, struct RClass *c) return mrb_nil_value(); } else { - char *name; - int len; - name = mrb_sym2name_len(mrb, sym, &len); path = mrb_str_new(mrb, name, len); } diff --git a/src/struct.c b/src/struct.c index 60a0edb5b..855974182 100644 --- a/src/struct.c +++ b/src/struct.c @@ -521,7 +521,7 @@ inspect_struct(mrb_state *mrb, mrb_value s, mrb_value dummy, int recur) slot = ptr_members[i]; id = SYM2ID(slot); if (mrb_is_local_id(id) || mrb_is_const_id(id)) { - char *name; + const char *name; int len; name = mrb_sym2name_len(mrb, id, &len); |
