From de45840d9ee470e24b102145a0fd6f9d641e3ad8 Mon Sep 17 00:00:00 2001 From: Remy Obein Date: Wed, 30 Oct 2024 14:45:04 -0300 Subject: [PATCH 1/2] Update for Ruby 2.7.0 --- ext/oj/dump.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ext/oj/dump.c b/ext/oj/dump.c index 235f89d3..1d0665fd 100644 --- a/ext/oj/dump.c +++ b/ext/oj/dump.c @@ -76,9 +76,9 @@ static void dump_sym_obj(VALUE obj, Out out); static void dump_class_comp(VALUE obj, Out out); static void dump_class_obj(VALUE obj, Out out); static void dump_array(VALUE obj, VALUE clas, int depth, Out out); -static int hash_cb_strict(VALUE key, VALUE value, Out out); -static int hash_cb_compat(VALUE key, VALUE value, Out out); -static int hash_cb_object(VALUE key, VALUE value, Out out); +static int hash_cb_strict(VALUE key, VALUE value, VALUE ov); +static int hash_cb_compat(VALUE key, VALUE value, VALUE ov); +static int hash_cb_object(VALUE key, VALUE value, VALUE ov); static void dump_hash(VALUE obj, VALUE clas, int depth, int mode, Out out); static void dump_time(VALUE obj, Out out, int withZone); static void dump_ruby_time(VALUE obj, Out out); @@ -92,7 +92,7 @@ static void dump_obj_obj(VALUE obj, int depth, Out out); static void dump_struct_comp(VALUE obj, int depth, Out out, int argc, VALUE *argv, bool as_ok); static void dump_struct_obj(VALUE obj, int depth, Out out); #if HAS_IVAR_HELPERS -static int dump_attr_cb(ID key, VALUE value, Out out); +static int dump_attr_cb(ID key, VALUE value, VALUE ov); #endif static void dump_obj_attrs(VALUE obj, VALUE clas, slot_t id, int depth, Out out); static void dump_odd(VALUE obj, Odd odd, VALUE clas, int depth, Out out); @@ -827,7 +827,8 @@ dump_array(VALUE a, VALUE clas, int depth, Out out) { } static int -hash_cb_strict(VALUE key, VALUE value, Out out) { +hash_cb_strict(VALUE key, VALUE value, VALUE ov) { + Out out = (Out) ov; int depth = out->depth; long size; int rtype = rb_type(key); @@ -893,7 +894,8 @@ hash_cb_strict(VALUE key, VALUE value, Out out) { } static int -hash_cb_compat(VALUE key, VALUE value, Out out) { +hash_cb_compat(VALUE key, VALUE value, VALUE ov) { + Out out = (Out) ov; int depth = out->depth; long size; @@ -960,7 +962,8 @@ hash_cb_compat(VALUE key, VALUE value, Out out) { } static int -hash_cb_object(VALUE key, VALUE value, Out out) { +hash_cb_object(VALUE key, VALUE value, VALUE ov) { + Out out = (Out) ov; int depth = out->depth; long size = depth * out->indent + 1; @@ -1594,7 +1597,8 @@ isRbxHashAttr(const char *attr) { #if HAS_IVAR_HELPERS static int -dump_attr_cb(ID key, VALUE value, Out out) { +dump_attr_cb(ID key, VALUE value, VALUE ov) { + Out out = (Out) ov; int depth = out->depth; size_t size = depth * out->indent + 1; const char *attr = rb_id2name(key); From 1062f3d7f4d7d5ff8e0529803e64e3cdf284c6bf Mon Sep 17 00:00:00 2001 From: Remy Obein Date: Wed, 30 Oct 2024 15:36:11 -0300 Subject: [PATCH 2/2] Bump version to 2.18.6 --- lib/oj/version.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/oj/version.rb b/lib/oj/version.rb index c9658d05..8d915a86 100644 --- a/lib/oj/version.rb +++ b/lib/oj/version.rb @@ -1,5 +1,5 @@ module Oj - # Current version of the module. - VERSION = '2.18.5' + # Current version of the module. + VERSION = '2.18.6' end