diff --git a/ext/iou/ring.c b/ext/iou/ring.c index 204d57d..ccafbbd 100644 --- a/ext/iou/ring.c +++ b/ext/iou/ring.c @@ -4,7 +4,6 @@ VALUE mIOU; VALUE cRing; -VALUE cArgumentError; VALUE SYM_accept; VALUE SYM_block; @@ -152,7 +151,7 @@ static inline struct io_uring_sqe *get_sqe(IOURing_t *iour) { static inline void get_required_kwargs(VALUE spec, VALUE *values, int argc, ...) { if (TYPE(spec) != T_HASH) - rb_raise(cArgumentError, "Expected keyword arguments"); + rb_raise(rb_eArgError, "Expected keyword arguments"); va_list ptr; va_start(ptr, argc); @@ -160,7 +159,7 @@ static inline void get_required_kwargs(VALUE spec, VALUE *values, int argc, ...) VALUE k = va_arg(ptr, VALUE); VALUE v = rb_hash_aref(spec, k); if (NIL_P(v)) - rb_raise(cArgumentError, "Missing %"PRIsVALUE" value", k); + rb_raise(rb_eArgError, "Missing %"PRIsVALUE" value", k); values[i] = v; } va_end(ptr); @@ -302,13 +301,13 @@ VALUE IOURing_prep_cancel(VALUE self, VALUE spec) { return prep_cancel_id(iour, NUM2UINT(spec)); if (TYPE(spec) != T_HASH) - rb_raise(cArgumentError, "Expected operation id or keyword arguments"); + rb_raise(rb_eArgError, "Expected operation id or keyword arguments"); VALUE id = rb_hash_aref(spec, SYM_id); if (!NIL_P(id)) return prep_cancel_id(iour, NUM2UINT(id)); - rb_raise(cArgumentError, "Missing operation id"); + rb_raise(rb_eArgError, "Missing operation id"); } VALUE IOURing_prep_close(VALUE self, VALUE spec) { @@ -727,8 +726,6 @@ void Init_IOURing(void) { rb_define_method(cRing, "process_completions", IOURing_process_completions, -1); rb_define_method(cRing, "process_completions_loop", IOURing_process_completions_loop, 0); - cArgumentError = rb_const_get(rb_cObject, rb_intern("ArgumentError")); - SYM_accept = MAKE_SYM("accept"); SYM_block = MAKE_SYM("block"); SYM_buffer = MAKE_SYM("buffer");