[前][次][番号順一覧][スレッド一覧]

ruby-changes:32499

From: nobu <ko1@a...>
Date: Mon, 13 Jan 2014 09:57:39 +0900 (JST)
Subject: [ruby-changes:32499] nobu:r44578 (trunk): ext: real class name

nobu	2014-01-13 09:57:36 +0900 (Mon, 13 Jan 2014)

  New Revision: 44578

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44578

  Log:
    ext: real class name
    
    * ext/dl/cptr.c (rb_dlptr_inspect): use real class name, not
      singleton class.
    
    * ext/fiddle/pointer.c (rb_fiddle_ptr_inspect): ditto.
    
    * ext/strscan/strscan.c (strscan_inspect): ditto.

  Modified files:
    trunk/ext/dl/cptr.c
    trunk/ext/fiddle/pointer.c
    trunk/ext/strscan/strscan.c
Index: ext/dl/cptr.c
===================================================================
--- ext/dl/cptr.c	(revision 44577)
+++ ext/dl/cptr.c	(revision 44578)
@@ -391,7 +391,7 @@ rb_dlptr_inspect(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/dl/cptr.c#L391
 
     TypedData_Get_Struct(self, struct ptr_data, &dlptr_data_type, data);
     return rb_sprintf("#<%"PRIsVALUE":%p ptr=%p size=%ld free=%p>",
-		      CLASS_OF(self), data, data->ptr, data->size, data->free);
+		      rb_obj_class(self), data, data->ptr, data->size, data->free);
 }
 
 /*
Index: ext/fiddle/pointer.c
===================================================================
--- ext/fiddle/pointer.c	(revision 44577)
+++ ext/fiddle/pointer.c	(revision 44578)
@@ -430,7 +430,7 @@ rb_fiddle_ptr_inspect(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/fiddle/pointer.c#L430
 
     TypedData_Get_Struct(self, struct ptr_data, &fiddle_ptr_data_type, data);
     return rb_sprintf("#<%"PRIsVALUE":%p ptr=%p size=%ld free=%p>",
-		      CLASS_OF(self), data, data->ptr, data->size, data->free);
+		      rb_obj_class(self), data, data->ptr, data->size, data->free);
 }
 
 /*
Index: ext/strscan/strscan.c
===================================================================
--- ext/strscan/strscan.c	(revision 44577)
+++ ext/strscan/strscan.c	(revision 44578)
@@ -1159,17 +1159,17 @@ strscan_inspect(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/strscan/strscan.c#L1159
 
     p = check_strscan(self);
     if (NIL_P(p->str)) {
-	a = rb_sprintf("#<%"PRIsVALUE" (uninitialized)>", CLASS_OF(self));
+	a = rb_sprintf("#<%"PRIsVALUE" (uninitialized)>", rb_obj_class(self));
 	return infect(a, p);
     }
     if (EOS_P(p)) {
-	a = rb_sprintf("#<%"PRIsVALUE" fin>", CLASS_OF(self));
+	a = rb_sprintf("#<%"PRIsVALUE" fin>", rb_obj_class(self));
 	return infect(a, p);
     }
     if (p->curr == 0) {
 	b = inspect2(p);
 	a = rb_sprintf("#<%"PRIsVALUE" %ld/%ld @ %"PRIsVALUE">",
-		       CLASS_OF(self),
+		       rb_obj_class(self),
 		       p->curr, S_LEN(p),
 		       b);
 	return infect(a, p);
@@ -1177,7 +1177,7 @@ strscan_inspect(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/strscan/strscan.c#L1177
     a = inspect1(p);
     b = inspect2(p);
     a = rb_sprintf("#<%"PRIsVALUE" %ld/%ld %"PRIsVALUE" @ %"PRIsVALUE">",
-		   CLASS_OF(self),
+		   rb_obj_class(self),
 		   p->curr, S_LEN(p),
 		   a, b);
     return infect(a, p);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]