ruby-changes:32825
From: naruse <ko1@a...>
Date: Mon, 10 Feb 2014 22:35:13 +0900 (JST)
Subject: [ruby-changes:32825] naruse:r44904 (ruby_2_1): merge revision(s) 44579: [Backport #9500]
naruse 2014-02-10 22:35:07 +0900 (Mon, 10 Feb 2014) New Revision: 44904 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44904 Log: merge revision(s) 44579: [Backport #9500] 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): Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ext/bigdecimal/bigdecimal.c branches/ruby_2_1/ext/openssl/ossl.h branches/ruby_2_1/ext/openssl/ossl_asn1.c branches/ruby_2_1/ext/openssl/ossl_cipher.c branches/ruby_2_1/ext/racc/cparse/cparse.c branches/ruby_2_1/ext/syslog/syslog.c branches/ruby_2_1/version.h Index: ruby_2_1/ext/bigdecimal/bigdecimal.c =================================================================== --- ruby_2_1/ext/bigdecimal/bigdecimal.c (revision 44903) +++ ruby_2_1/ext/bigdecimal/bigdecimal.c (revision 44904) @@ -2519,8 +2519,8 @@ BigDecimal_new(int argc, VALUE *argv) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/bigdecimal/bigdecimal.c#L2519 case T_RATIONAL: if (NIL_P(nFig)) { rb_raise(rb_eArgError, - "can't omit precision for a %s.", - rb_class2name(CLASS_OF(iniValue))); + "can't omit precision for a %"PRIsVALUE".", + rb_obj_class(iniValue)); } return GetVpValueWithPrec(iniValue, mf, 1); Index: ruby_2_1/ext/syslog/syslog.c =================================================================== --- ruby_2_1/ext/syslog/syslog.c (revision 44903) +++ ruby_2_1/ext/syslog/syslog.c (revision 44904) @@ -312,7 +312,7 @@ static VALUE mSyslog_log(int argc, VALUE https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/syslog/syslog.c#L312 pri = *argv++; if (!FIXNUM_P(pri)) { - rb_raise(rb_eTypeError, "type mismatch: %s given", rb_class2name(CLASS_OF(pri))); + rb_raise(rb_eTypeError, "type mismatch: %"PRIsVALUE" given", rb_obj_class(pri)); } syslog_write(FIX2INT(pri), argc, argv); Index: ruby_2_1/ext/openssl/ossl_cipher.c =================================================================== --- ruby_2_1/ext/openssl/ossl_cipher.c (revision 44903) +++ ruby_2_1/ext/openssl/ossl_cipher.c (revision 44904) @@ -213,9 +213,9 @@ ossl_cipher_init(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/openssl/ossl_cipher.c#L213 * 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); Index: ruby_2_1/ext/openssl/ossl.h =================================================================== --- ruby_2_1/ext/openssl/ossl.h (revision 44903) +++ ruby_2_1/ext/openssl/ossl.h (revision 44904) @@ -95,15 +95,15 @@ extern VALUE eOSSLError; https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/openssl/ossl.h#L95 */ #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) Index: ruby_2_1/ext/openssl/ossl_asn1.c =================================================================== --- ruby_2_1/ext/openssl/ossl_asn1.c (revision 44903) +++ ruby_2_1/ext/openssl/ossl_asn1.c (revision 44904) @@ -624,8 +624,8 @@ ossl_asn1_default_tag(VALUE obj) https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/openssl/ossl_asn1.c#L624 } 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 */ } Index: ruby_2_1/ext/racc/cparse/cparse.c =================================================================== --- ruby_2_1/ext/racc/cparse/cparse.c (revision 44903) +++ ruby_2_1/ext/racc/cparse/cparse.c (revision 44904) @@ -418,10 +418,10 @@ extract_user_token(struct cparse_params https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ext/racc/cparse/cparse.c#L418 if (!RB_TYPE_P(block_args, T_ARRAY)) { rb_raise(rb_eTypeError, - "%s() %s %s (must be Array[2])", + "%s() %s %"PRIsVALUE" (must be Array[2])", v->lex_is_iterator ? rb_id2name(v->lexmid) : "next_token", v->lex_is_iterator ? "yielded" : "returned", - rb_class2name(CLASS_OF(block_args))); + rb_obj_class(block_args)); } if (RARRAY_LEN(block_args) != 2) { rb_raise(rb_eArgError, Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 44903) +++ ruby_2_1/version.h (revision 44904) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.1" #define RUBY_RELEASE_DATE "2014-02-10" -#define RUBY_PATCHLEVEL 29 +#define RUBY_PATCHLEVEL 30 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 2 Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r44579 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/