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/range.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/range.c') diff --git a/src/range.c b/src/range.c index be611b2a3..ec764e39b 100644 --- a/src/range.c +++ b/src/range.c @@ -88,7 +88,7 @@ range_ptr_init(mrb_state *mrb, struct RRange *r, mrb_value beg, mrb_value end, m } } else { - r = (struct RRange*)mrb_obj_alloc(mrb, MRB_TT_RANGE, mrb->range_class); + r = MRB_OBJ_ALLOC(mrb, MRB_TT_RANGE, mrb->range_class); range_ptr_alloc_edges(mrb, r); } -- cgit v1.2.3