@@ -69,6 +69,12 @@ asn1time_to_time(const ASN1_TIME *time)
6969 return rb_funcall2 (rb_cTime , rb_intern ("utc" ), 6 , argv );
7070}
7171
72+ static VALUE
73+ asn1time_to_time_i (VALUE arg )
74+ {
75+ return asn1time_to_time ((ASN1_TIME * )arg );
76+ }
77+
7278void
7379ossl_time_split (VALUE time , time_t * sec , int * days )
7480{
@@ -136,6 +142,12 @@ num_to_asn1integer(VALUE obj, ASN1_INTEGER *ai)
136142 return ai ;
137143}
138144
145+ static VALUE
146+ asn1integer_to_num_i (VALUE arg )
147+ {
148+ return asn1integer_to_num ((ASN1_INTEGER * )arg );
149+ }
150+
139151/********/
140152/*
141153 * ASN1 module
@@ -325,7 +337,7 @@ decode_int(unsigned char* der, long length)
325337 p = der ;
326338 if (!(ai = d2i_ASN1_INTEGER (NULL , & p , length )))
327339 ossl_raise (eASN1Error , NULL );
328- ret = rb_protect (( VALUE ( * )( VALUE )) asn1integer_to_num ,
340+ ret = rb_protect (asn1integer_to_num_i ,
329341 (VALUE )ai , & status );
330342 ASN1_INTEGER_free (ai );
331343 if (status ) rb_jump_tag (status );
@@ -365,7 +377,7 @@ decode_enum(unsigned char* der, long length)
365377 p = der ;
366378 if (!(ai = d2i_ASN1_ENUMERATED (NULL , & p , length )))
367379 ossl_raise (eASN1Error , NULL );
368- ret = rb_protect (( VALUE ( * )( VALUE )) asn1integer_to_num ,
380+ ret = rb_protect (asn1integer_to_num_i ,
369381 (VALUE )ai , & status );
370382 ASN1_ENUMERATED_free (ai );
371383 if (status ) rb_jump_tag (status );
@@ -427,7 +439,7 @@ decode_time(unsigned char* der, long length)
427439 p = der ;
428440 if (!(time = d2i_ASN1_TIME (NULL , & p , length )))
429441 ossl_raise (eASN1Error , NULL );
430- ret = rb_protect (( VALUE ( * )( VALUE )) asn1time_to_time ,
442+ ret = rb_protect (asn1time_to_time_i ,
431443 (VALUE )time , & status );
432444 ASN1_TIME_free (time );
433445 if (status ) rb_jump_tag (status );
0 commit comments