From cc95e346fd9cc26bb6fc3fb7b1082d7d011ef664 Mon Sep 17 00:00:00 2001 From: dearblue Date: Sun, 20 Jun 2021 11:08:28 +0900 Subject: Added `MRB_OBJ_ALLOC()` macro that does not require a cast The `MRB_OBJ_ALLOC()` macro function returns a pointer of the type corresponding to the constant literal defined in `enum mrb_vtype`. --- src/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index 9af361f18..03d9c8a9c 100644 --- a/src/string.c +++ b/src/string.c @@ -32,7 +32,7 @@ typedef struct mrb_shared_string { const char mrb_digitmap[] = "0123456789abcdefghijklmnopqrstuvwxyz"; -#define mrb_obj_alloc_string(mrb) ((struct RString*)mrb_obj_alloc((mrb), MRB_TT_STRING, (mrb)->string_class)) +#define mrb_obj_alloc_string(mrb) MRB_OBJ_ALLOC((mrb), MRB_TT_STRING, (mrb)->string_class) static struct RString* str_init_normal_capa(mrb_state *mrb, struct RString *s, -- cgit v1.2.3