From 6990d4b16b1b816ab39115e83df3317f30db8449 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Fri, 1 Mar 2024 12:05:52 -0300 Subject: [PATCH] Cast to Ruby integers --- ext/hbsdctl.rb/hbsdctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/hbsdctl.rb/hbsdctl.c b/ext/hbsdctl.rb/hbsdctl.c index c97bdd9..c39faa6 100644 --- a/ext/hbsdctl.rb/hbsdctl.c +++ b/ext/hbsdctl.rb/hbsdctl.c @@ -69,9 +69,9 @@ Init_hbsdctl(void) rb_cFeature = rb_const_get(rb_mControl, rb_intern("Feature")), rb_mFFI = rb_const_get(rb_mControl, rb_intern("FFI")); - rb_define_const(rb_mControl, "SysDef", -1); - rb_define_const(rb_mControl, "Disable", 0); - rb_define_const(rb_mControl, "Enable", 1); + rb_define_const(rb_mControl, "SysDef", INT2NUM(-1)); + rb_define_const(rb_mControl, "Disable", INT2NUM(0)); + rb_define_const(rb_mControl, "Enable", INT2NUM(1)); rb_define_singleton_method(rb_mFFI, "available_features", ffi_available_features, 0); rb_define_singleton_method(rb_mFFI, "library_version", ffi_library_version, 0); rb_define_method(rb_cFeature, "set!", feature_set, 2);