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-catch/src/catch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mrbgems/mruby-catch/src') diff --git a/mrbgems/mruby-catch/src/catch.c b/mrbgems/mruby-catch/src/catch.c index d54c49dfe..048a44738 100644 --- a/mrbgems/mruby-catch/src/catch.c +++ b/mrbgems/mruby-catch/src/catch.c @@ -92,7 +92,7 @@ mrb_f_throw(mrb_state *mrb, mrb_value self) const mrb_callinfo *ci = find_catcher(mrb, tag); if (ci) { - struct RBreak *b = (struct RBreak *)mrb_obj_alloc(mrb, MRB_TT_BREAK, NULL); + struct RBreak *b = MRB_OBJ_ALLOC(mrb, MRB_TT_BREAK, NULL); mrb_break_value_set(b, obj); mrb_break_proc_set(b, ci[2].proc); /* Back to the closure in `catch` method */ mrb_exc_raise(mrb, mrb_obj_value(b)); -- cgit v1.2.3