@@ -5848,7 +5848,7 @@ rb_call(klass, recv, mid, argc, argv, scope)
5848
5848
struct cache_entry * ent ;
5849
5849
5850
5850
if (!klass ) {
5851
- rb_raise (rb_eNotImpError , "method `%s' called on terminated object (0x%lx )" ,
5851
+ rb_raise (rb_eNotImpError , "method `%s' called on terminated object (%p )" ,
5852
5852
rb_id2name (mid ), recv );
5853
5853
}
5854
5854
/* is it in the method cache? */
@@ -8502,7 +8502,7 @@ proc_to_s(self)
8502
8502
struct BLOCK * data ;
8503
8503
NODE * node ;
8504
8504
char * cname = rb_obj_classname (self );
8505
- const int w = (SIZEOF_LONG * CHAR_BIT ) / 4 ;
8505
+ const int w = (sizeof ( VALUE ) * CHAR_BIT ) / 4 ;
8506
8506
long len = strlen (cname )+ 6 + w ; /* 6:tags 16:addr */
8507
8507
VALUE str ;
8508
8508
@@ -8511,13 +8511,13 @@ proc_to_s(self)
8511
8511
len += strlen (node -> nd_file ) + 2 + (SIZEOF_LONG * CHAR_BIT - NODE_LSHIFT )/3 ;
8512
8512
str = rb_str_new (0 , len );
8513
8513
snprintf (RSTRING (str )-> ptr , len + 1 ,
8514
- "#<%s:0x%.*lx @%s:%d>" , cname , w , (VALUE )data -> body ,
8514
+ "#<%s:%p @%s:%d>" , cname , (VALUE )data -> body ,
8515
8515
node -> nd_file , nd_line (node ));
8516
8516
}
8517
8517
else {
8518
8518
str = rb_str_new (0 , len );
8519
8519
snprintf (RSTRING (str )-> ptr , len + 1 ,
8520
- "#<%s:0x%.*lx >" , cname , w , (VALUE )data -> body );
8520
+ "#<%s:%p >" , cname , (VALUE )data -> body );
8521
8521
}
8522
8522
RSTRING (str )-> len = strlen (RSTRING (str )-> ptr );
8523
8523
if (OBJ_TAINTED (self )) OBJ_TAINT (str );
@@ -10229,7 +10229,7 @@ rb_thread_deadlock()
10229
10229
char msg [21 + SIZEOF_LONG * 2 ];
10230
10230
VALUE e ;
10231
10231
10232
- sprintf (msg , "Thread(0x%lx ): deadlock" , curr_thread -> thread );
10232
+ sprintf (msg , "Thread(%p ): deadlock" , curr_thread -> thread );
10233
10233
e = rb_exc_new2 (rb_eFatal , msg );
10234
10234
if (curr_thread == main_thread ) {
10235
10235
rb_exc_raise (e );
@@ -10509,13 +10509,13 @@ rb_thread_schedule()
10509
10509
TRAP_END ;
10510
10510
}
10511
10511
FOREACH_THREAD_FROM (curr , th ) {
10512
- warn_printf ("deadlock 0x%lx : %s:" ,
10512
+ warn_printf ("deadlock %p : %s:" ,
10513
10513
th -> thread , thread_status_name (th -> status ));
10514
10514
if (th -> wait_for & WAIT_FD ) warn_printf ("F(%d)" , th -> fd );
10515
10515
if (th -> wait_for & WAIT_SELECT ) warn_printf ("S" );
10516
10516
if (th -> wait_for & WAIT_TIME ) warn_printf ("T(%f)" , th -> delay );
10517
10517
if (th -> wait_for & WAIT_JOIN )
10518
- warn_printf ("J(0x%lx )" , th -> join ? th -> join -> thread : 0 );
10518
+ warn_printf ("J(%p )" , th -> join ? th -> join -> thread : 0 );
10519
10519
if (th -> wait_for & WAIT_PID ) warn_printf ("P" );
10520
10520
if (!th -> wait_for ) warn_printf ("-" );
10521
10521
warn_printf (" %s - %s:%d\n" ,
@@ -10752,10 +10752,10 @@ rb_thread_join(th, limit)
10752
10752
if (rb_thread_critical ) rb_thread_deadlock ();
10753
10753
if (!rb_thread_dead (th )) {
10754
10754
if (th == curr_thread )
10755
- rb_raise (rb_eThreadError , "thread 0x%lx tried to join itself" ,
10755
+ rb_raise (rb_eThreadError , "thread %p tried to join itself" ,
10756
10756
th -> thread );
10757
10757
if ((th -> wait_for & WAIT_JOIN ) && th -> join == curr_thread )
10758
- rb_raise (rb_eThreadError , "Thread#join: deadlock 0x%lx - mutual join(0x%lx )" ,
10758
+ rb_raise (rb_eThreadError , "Thread#join: deadlock %p - mutual join(%p )" ,
10759
10759
curr_thread -> thread , th -> thread );
10760
10760
if (curr_thread -> status == THREAD_TO_KILL )
10761
10761
last_status = THREAD_TO_KILL ;
@@ -12269,7 +12269,7 @@ rb_thread_inspect(thread)
12269
12269
size_t len = strlen (cname )+ 7 + 16 + 9 + 1 ;
12270
12270
12271
12271
str = rb_str_new (0 , len ); /* 7:tags 16:addr 9:status 1:nul */
12272
- snprintf (RSTRING (str )-> ptr , len , "#<%s:0x%lx %s>" , cname , thread , status );
12272
+ snprintf (RSTRING (str )-> ptr , len , "#<%s:%p %s>" , cname , thread , status );
12273
12273
RSTRING (str )-> len = strlen (RSTRING (str )-> ptr );
12274
12274
OBJ_INFECT (str , thread );
12275
12275
@@ -12803,7 +12803,7 @@ rb_f_throw(argc, argv)
12803
12803
break ;
12804
12804
}
12805
12805
if (tt -> tag == PROT_THREAD ) {
12806
- rb_raise (rb_eThreadError , "uncaught throw `%s' in thread 0x%lx " ,
12806
+ rb_raise (rb_eThreadError , "uncaught throw `%s' in thread %p " ,
12807
12807
rb_id2name (SYM2ID (tag )),
12808
12808
curr_thread );
12809
12809
}
0 commit comments