@@ -511,7 +511,7 @@ w_object(obj, arg, limit)
511
511
if (OBJ_TAINTED (obj )) arg -> taint = Qtrue ;
512
512
513
513
st_add_direct (arg -> data , obj , arg -> data -> num_entries );
514
- if (rb_obj_respond_to (obj , s_mdump , Qtrue )) {
514
+ if (rb_respond_to (obj , s_mdump )) {
515
515
volatile VALUE v ;
516
516
517
517
v = rb_funcall (obj , s_mdump , 0 , 0 );
@@ -521,7 +521,7 @@ w_object(obj, arg, limit)
521
521
if (ivtbl ) w_ivar (0 , & c_arg );
522
522
return ;
523
523
}
524
- if (rb_obj_respond_to (obj , s_dump , Qtrue )) {
524
+ if (rb_respond_to (obj , s_dump )) {
525
525
VALUE v ;
526
526
527
527
v = rb_funcall (obj , s_dump , 1 , INT2NUM (limit ));
@@ -664,7 +664,7 @@ w_object(obj, arg, limit)
664
664
{
665
665
VALUE v ;
666
666
667
- if (!rb_obj_respond_to (obj , s_dump_data , Qtrue )) {
667
+ if (!rb_respond_to (obj , s_dump_data )) {
668
668
rb_raise (rb_eTypeError ,
669
669
"no marshal_dump is defined for class %s" ,
670
670
rb_obj_classname (obj ));
@@ -765,12 +765,12 @
8000
@ marshal_dump(argc, argv)
765
765
arg .str = rb_str_buf_new (0 );
766
766
RBASIC (arg .str )-> klass = 0 ;
767
767
if (!NIL_P (port )) {
768
- if (!rb_obj_respond_to (port , s_write , Qtrue )) {
768
+ if (!rb_respond_to (port , s_write )) {
769
769
type_error :
770
770
rb_raise (rb_eTypeError , "instance of IO needed" );
771
771
}
772
772
arg .dest = port ;
773
- if (rb_obj_respond_to (port , s_binmode , Qtrue )) {
773
+ if (rb_respond_to (port , s_binmode )) {
774
774
rb_funcall2 (port , s_binmode , 0 , 0 );
775
775
reentrant_check (arg .str , s_dump_data );
776
776
}
@@ -1248,7 +1248,7 @@ r_object0(arg, proc, ivp, extmod)
1248
1248
VALUE klass = path2class (r_unique (arg ));
1249
1249
VALUE data ;
1250
1250
1251
- if (!rb_obj_respond_to (klass , s_load , Qtrue )) {
1251
+ if (!rb_respond_to (klass , s_load )) {
1252
1252
rb_raise (rb_eTypeError , "class %s needs to have method `_load'" ,
1253
1253
rb_class2name (klass ));
1254
1254
}
@@ -1275,7 +1275,7 @@ r_object0(arg, proc, ivp, extmod)
1275
1275
rb_extend_object (v , m );
1276
1276
}
1277
1277
}
1278
- if (!rb_obj_respond_to (v , s_mload , Qtrue )) {
1278
+ if (!rb_respond_to (v , s_mload )) {
1279
1279
rb_raise (rb_eTypeError , "instance of %s needs to have method `marshal_load'" ,
1280
1280
rb_class2name (klass ));
1281
1281
}
@@ -1302,7 +1302,7 @@ r_object0(arg, proc, ivp, extmod)
1302
1302
case TYPE_DATA :
1303
1303
{
1304
1304
VALUE klass = path2class (r_unique (arg ));
1305
- if (rb_obj_respond_to (klass , s_alloc , Qtrue )) {
1305
+ if (rb_respond_to (klass , s_alloc )) {
1306
1306
static int warn = Qtrue ;
1307
1307
if (warn ) {
1308
1308
rb_warn ("define `allocate' instead of `_alloc'" );
@@ -1318,7 +1318,7 @@ r_object0(arg, proc, ivp, extmod)
1318
1318
rb_raise (rb_eArgError , "dump format error" );
1319
1319
}
1320
1320
r_entry (v , arg );
1321
- if (!rb_obj_respond_to (v , s_load_data , Qtrue )) {
1321
+ if (!rb_respond_to (v , s_load_data )) {
1322
1322
rb_raise (rb_eTypeError ,
1323
1323
"class %s needs to have instance method `_load_data'" ,
1324
1324
rb_class2name (klass ));
@@ -1423,8 +1423,8 @@ marshal_load(argc, argv)
1423
1423
arg .taint = OBJ_TAINTED (port ); /* original taintedness */
1424
1424
port = v ;
1425
1425
}
1426
- else if (rb_obj_respond_to (port , s_getc , Qtrue ) && rb_obj_respond_to (port , s_read , Qtrue )) {
1427
- if (rb_obj_respond_to (port , s_binmode , Qtrue )) {
1426
+ else if (rb_respond_to (port , s_getc ) && rb_respond_to (port , s_read )) {
1427
+ if (rb_respond_to (port , s_binmode )) {
1428
1428
rb_funcall2 (port , s_binmode , 0 , 0 );
1429
1429
}
1430
1430
arg .taint = Qtrue ;
0 commit comments