summaryrefslogtreecommitdiff
path: root/ext/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-13 10:35:20 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-13 10:35:20 +0000
commit651b31e3677289df968eaec416494e5b9536b0e1 (patch)
tree19e158602da6ffccfcc909d87dc19e3d779b3fe2 /ext/win32ole
parent643551f0d3c2897bf15007c9476cab05bf431563 (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole')
-rw-r--r--ext/win32ole/win32ole.c10
-rw-r--r--ext/win32ole/win32ole_param.c2
-rw-r--r--ext/win32ole/win32ole_variable.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 5a57813a75..c86835eb4f 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -4389,7 +4389,7 @@ ole_search_handler_method(VALUE handler, VALUE ev, BOOL *is_default_handler)
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)
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)
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
diff --git a/ext/win32ole/win32ole_param.c b/ext/win32ole/win32ole_param.c
index f91945c351..661bd23578 100644
--- a/ext/win32ole/win32ole_param.c
+++ b/ext/win32ole/win32ole_param.c
@@ -394,7 +394,7 @@ foleparam_inspect(VALUE self)
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);
}
diff --git a/ext/win32ole/win32ole_variable.c b/ext/win32ole/win32ole_variable.c
index 5a0fd5cf04..85f3341f98 100644
--- a/ext/win32ole/win32ole_variable.c
+++ b/ext/win32ole/win32ole_variable.c
@@ -345,9 +345,9 @@ folevariable_varkind(VALUE self)
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);
}