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/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/hash.c') diff --git a/src/hash.c b/src/hash.c index 3b5d17761..2704be0c4 100644 --- a/src/hash.c +++ b/src/hash.c @@ -970,7 +970,7 @@ h_key_for(mrb_state *mrb, mrb_value key) static struct RHash* h_alloc(mrb_state *mrb) { - return (struct RHash*)mrb_obj_alloc(mrb, MRB_TT_HASH, mrb->hash_class); + return MRB_OBJ_ALLOC(mrb, MRB_TT_HASH, mrb->hash_class); } static void -- cgit v1.2.3