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`. --- mrbgems/mruby-complex/src/complex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mrbgems/mruby-complex/src/complex.c') diff --git a/mrbgems/mruby-complex/src/complex.c b/mrbgems/mruby-complex/src/complex.c index 2a2f9c49b..286e7e38e 100644 --- a/mrbgems/mruby-complex/src/complex.c +++ b/mrbgems/mruby-complex/src/complex.c @@ -50,7 +50,7 @@ static struct RBasic* complex_alloc(mrb_state *mrb, struct RClass *c, struct mrb_complex **p) { struct RComplex *s; - s = (struct RComplex*)mrb_obj_alloc(mrb, MRB_TT_COMPLEX, c); + s = MRB_OBJ_ALLOC(mrb, MRB_TT_COMPLEX, c); #ifdef COMPLEX_INLINE *p = &s->r; #else -- cgit v1.2.3