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

ruby-changes:35085

From: suke <ko1@a...>
Date: Wed, 13 Aug 2014 19:35:36 +0900 (JST)
Subject: [ruby-changes:35085] suke:r47167 (trunk): * ext/win32ole/win32ole.c(ole_search_handler_method, rescue_callback,

suke	2014-08-13 19:35:20 +0900 (Wed, 13 Aug 2014)

  New Revision: 47167

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

  Log:
    * ext/win32ole/win32ole.c(ole_search_handler_method, rescue_callback,
      folerecord_inspect): use PRIsVALUE in rb_sprintf.
    
    * ext/win32ole/win32ole_param.c(foleparam_inspect): ditto.
    
    * ext/win32ole/win32ole_variable.c(folevariable_inspect): use
      PRIsVALUE in rb_sprintf, use rb_inspect.

  Modified files:
    trunk/ChangeLog
    trunk/ext/win32ole/win32ole.c
    trunk/ext/win32ole/win32ole_param.c
    trunk/ext/win32ole/win32ole_variable.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47166)
+++ ChangeLog	(revision 47167)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Aug 13 19:31:27 2014  Masaki Suketa <masaki.suketa@n...>
+
+	* ext/win32ole/win32ole.c(ole_search_handler_method, rescue_callback,
+	  folerecord_inspect): use PRIsVALUE in rb_sprintf.
+
+	* ext/win32ole/win32ole_param.c(foleparam_inspect): ditto.
+
+	* ext/win32ole/win32ole_variable.c(folevariable_inspect): use
+	  PRIsVALUE in rb_sprintf, use rb_inspect.
+
 Wed Aug 13 11:54:41 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
 
 	* lib/irb/completion.rb: reverted r47163.
@@ -25,7 +35,7 @@ Wed Aug 13 00:07:01 2014  Masaki Suketa https://github.com/ruby/ruby/blob/trunk/ChangeLog#L35
 
 Tue Aug 12 23:17:47 2014  Masaki Suketa <masaki.suketa@n...>
 
-	* ext/win32ole/win32ole.c: refactoring. move some methods 
+	* ext/win32ole/win32ole.c: refactoring. move some methods
 	  into win32ole_type.c / win32ole_method.c
 	* ext/win32ole/win32ole.h: ditto.
 	* ext/win32ole/win32ole_method.c: ditto.
Index: ext/win32ole/win32ole.c
===================================================================
--- ext/win32ole/win32ole.c	(revision 47166)
+++ ext/win32ole/win32ole.c	(revision 47167)
@@ -4389,7 +4389,7 @@ ole_search_handler_method(VALUE handler, https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L4389
     VALUE mid;
 
     *is_default_handler = FALSE;
-    mid = rb_to_id(rb_sprintf("on%s", StringValuePtr(ev)));
+    mid = rb_to_id(rb_sprintf("on%"PRIsVALUE, ev));
     if (rb_respond_to(handler, mid)) {
 	return mid;
     }
@@ -4482,7 +4482,7 @@ rescue_callback(VALUE arg) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L4482
     VALUE bt = rb_funcall(e, rb_intern("backtrace"), 0);
     VALUE msg = rb_funcall(e, rb_intern("message"), 0);
     bt = rb_ary_entry(bt, 0);
-    error = rb_sprintf("%s: %s (%s)\n", StringValuePtr(bt), StringValuePtr(msg), rb_obj_classname(e));
+    error = rb_sprintf("%"PRIsVALUE": %"PRIsVALUE" (%s)\n", bt, msg, rb_obj_classname(e));
     rb_write_error(StringValuePtr(error));
     rb_backtrace();
     ruby_finalize();
@@ -6264,9 +6264,9 @@ folerecord_inspect(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole.c#L6264
         tname = rb_inspect(tname);
     }
     field = rb_inspect(folerecord_to_h(self));
-    return rb_sprintf("#<WIN32OLE_RECORD(%s) %s>",
-                      StringValuePtr(tname),
-                      StringValuePtr(field));
+    return rb_sprintf("#<WIN32OLE_RECORD(%"PRIsVALUE") %"PRIsVALUE">",
+                      tname,
+                      field);
 }
 
 static void
Index: ext/win32ole/win32ole_variable.c
===================================================================
--- ext/win32ole/win32ole_variable.c	(revision 47166)
+++ ext/win32ole/win32ole_variable.c	(revision 47167)
@@ -345,9 +345,9 @@ folevariable_varkind(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variable.c#L345
 static VALUE
 folevariable_inspect(VALUE self)
 {
-    VALUE v = rb_funcall(folevariable_value(self), rb_intern("inspect"), 0);
+    VALUE v = rb_inspect(folevariable_value(self));
     VALUE n = folevariable_name(self);
-    VALUE detail = rb_sprintf("%s=%s", StringValueCStr(n), StringValueCStr(v));
+    VALUE detail = rb_sprintf("%"PRIsVALUE"=%"PRIsVALUE, n, v);
     return make_inspect("WIN32OLE_VARIABLE", detail);
 }
 
Index: ext/win32ole/win32ole_param.c
===================================================================
--- ext/win32ole/win32ole_param.c	(revision 47166)
+++ ext/win32ole/win32ole_param.c	(revision 47167)
@@ -394,7 +394,7 @@ foleparam_inspect(VALUE self) https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_param.c#L394
     VALUE defval = foleparam_default(self);
     if (defval != Qnil) {
         rb_str_cat2(detail, "=");
-        rb_str_concat(detail, rb_funcall(defval, rb_intern("inspect"), 0));
+        rb_str_concat(detail, rb_inspect(defval));
     }
     return make_inspect("WIN32OLE_PARAM", detail);
 }

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

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