Skip to content

Commit d8bacef

Browse files
committed
Fix optional/capi/ext/digest_spec.c on Ruby 3.4.2
Original error: ``` $ ruby /Users/runner/work/spec/mspec/bin/mspec-run :capi ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [arm64-darwin23] digest_spec.cpp:106:12: error: assigning to 'rb_digest_metadata_t *' from incompatible type 'void *' algo = RTYPEDDATA_DATA(obj); ^~~~~~~~~~~~~~~~~~~~ /Users/runner/hostedtoolcache/Ruby/3.4.2/arm64/include/ruby-3.4.0/ruby/internal/core/rtypeddata.h:102:38: note: expanded from macro 'RTYPEDDATA_DATA' #define RTYPEDDATA_DATA(v) (RTYPEDDATA(v)->data) ^~~~~~~~~~~~~~~~~~~~~ 1 error generated. make: *** [digest_spec.o] Error 1 ```
1 parent 47fa42a commit d8bacef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

optional/capi/ext/digest_spec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static rb_digest_metadata_t * get_metadata_ptr(VALUE obj) {
103103
// In the digest gem there is an additional data type check performed before reading the value out.
104104
// Since the type definition isn't public, we can't use it as part of a type check here so we omit it.
105105
// This is safe to do because this code is intended to only load digest plugins written as part of this test suite.
106-
algo = RTYPEDDATA_DATA(obj);
106+
algo = (rb_digest_metadata_t *) RTYPEDDATA_DATA(obj);
107107
#else
108108
# undef RUBY_UNTYPED_DATA_WARNING
109109
# define RUBY_UNTYPED_DATA_WARNING 0

0 commit comments

Comments
 (0)