summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-13 00:57:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-13 00:57:38 +0000
commiteadaa8ba8ba78cfb7fb2a0766bca318220fc4e0c (patch)
tree1f9a9461f9ff8d4e5f7fbbad82fbfcb8bfd061db /ext/openssl
parent7e9bd8f72c643b7b7ac3ca90293d96fe8a7e7a2d (diff)
ext: use PRIsVALUE for rb_raise and rb_warn
* ext/bigdecimal/bigdecimal.c (BigDecimal_new): use PRIsVALUE for rb_raise() and rb_warn(). * ext/openssl/ossl_cipher.c (ossl_cipher_init): ditto. * ext/racc/cparse/cparse.c (extract_user_token): ditto. * ext/syslog/syslog.c (mSyslog_log): ditto. * ext/openssl/ossl.h (OSSL_Check_Kind, OSSL_Check_Instance): now ossl_raise() also accepts PRIsVALUE. * ext/openssl/ossl_asn1.c (ossl_asn1_default_tag): git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/ossl.h8
-rw-r--r--ext/openssl/ossl_asn1.c4
-rw-r--r--ext/openssl/ossl_cipher.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h
index 96d0ade11e0..83a927dabe5 100644
--- a/ext/openssl/ossl.h
+++ b/ext/openssl/ossl.h
@@ -95,15 +95,15 @@ extern VALUE eOSSLError;
*/
#define OSSL_Check_Kind(obj, klass) do {\
if (!rb_obj_is_kind_of((obj), (klass))) {\
- ossl_raise(rb_eTypeError, "wrong argument (%s)! (Expected kind of %s)",\
- rb_obj_classname(obj), rb_class2name(klass));\
+ ossl_raise(rb_eTypeError, "wrong argument (%"PRIsVALUE")! (Expected kind of %"PRIsVALUE")",\
+ rb_obj_class(obj), (klass));\
}\
} while (0)
#define OSSL_Check_Instance(obj, klass) do {\
if (!rb_obj_is_instance_of((obj), (klass))) {\
- ossl_raise(rb_eTypeError, "wrong argument (%s)! (Expected instance of %s)",\
- rb_obj_classname(obj), rb_class2name(klass));\
+ ossl_raise(rb_eTypeError, "wrong argument (%"PRIsVALUE")! (Expected instance of %"PRIsVALUE")",\
+ rb_obj_class(obj), (klass));\
}\
} while (0)
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index e3f59bfe1e1..c2344affa69 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -624,8 +624,8 @@ ossl_asn1_default_tag(VALUE obj)
}
tmp_class = rb_class_superclass(tmp_class);
}
- ossl_raise(eASN1Error, "universal tag for %s not found",
- rb_class2name(CLASS_OF(obj)));
+ ossl_raise(eASN1Error, "universal tag for %"PRIsVALUE" not found",
+ rb_obj_class(obj));
return -1; /* dummy */
}
diff --git a/ext/openssl/ossl_cipher.c b/ext/openssl/ossl_cipher.c
index 03374372ad0..df6fd108878 100644
--- a/ext/openssl/ossl_cipher.c
+++ b/ext/openssl/ossl_cipher.c
@@ -213,9 +213,9 @@ ossl_cipher_init(int argc, VALUE *argv, VALUE self, int mode)
* We deprecated the arguments for this method, but we decided
* keeping this behaviour for backward compatibility.
*/
- const char *cname = rb_class2name(rb_obj_class(self));
- rb_warn("arguments for %s#encrypt and %s#decrypt were deprecated; "
- "use %s#pkcs5_keyivgen to derive key and IV",
+ VALUE cname = rb_class_path(rb_obj_class(self));
+ rb_warn("arguments for %"PRIsVALUE"#encrypt and %"PRIsVALUE"#decrypt were deprecated; "
+ "use %"PRIsVALUE"#pkcs5_keyivgen to derive key and IV",
cname, cname, cname);
StringValue(pass);
GetCipher(self, ctx);