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`.
This commit is contained in:
dearblue
2021-06-20 11:08:28 +09:00
parent f678620a43
commit cc95e346fd
17 changed files with 79 additions and 56 deletions
+1 -1
View File
@@ -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,