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
@@ -892,7 +892,7 @@ break_new(mrb_state *mrb, uint32_t tag, const struct RProc *p, mrb_value val)
{
struct RBreak *brk;
brk = (struct RBreak*)mrb_obj_alloc(mrb, MRB_TT_BREAK, NULL);
brk = MRB_OBJ_ALLOC(mrb, MRB_TT_BREAK, NULL);
mrb_break_proc_set(brk, p);
mrb_break_value_set(brk, val);
mrb_break_tag_set(brk, tag);