Skip to content

Commit aeb412e

Browse files
committed
merge revision(s) 44579: [Backport ruby#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): git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@44904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent a21d16c commit aeb412e

7 files changed

Lines changed: 15 additions & 15 deletions

File tree

ext/bigdecimal/bigdecimal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,8 +2519,8 @@ BigDecimal_new(int argc, VALUE *argv)
25192519
case T_RATIONAL:
25202520
if (NIL_P(nFig)) {
25212521
rb_raise(rb_eArgError,
2522-
"can't omit precision for a %s.",
2523-
rb_class2name(CLASS_OF(iniValue)));
2522+
"can't omit precision for a %"PRIsVALUE".",
2523+
rb_obj_class(iniValue));
25242524
}
25252525
return GetVpValueWithPrec(iniValue, mf, 1);
25262526

ext/openssl/ossl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ extern VALUE eOSSLError;
9595
*/
9696
#define OSSL_Check_Kind(obj, klass) do {\
9797
if (!rb_obj_is_kind_of((obj), (klass))) {\
98-
ossl_raise(rb_eTypeError, "wrong argument (%s)! (Expected kind of %s)",\
99-
rb_obj_classname(obj), rb_class2name(klass));\
98+
ossl_raise(rb_eTypeError, "wrong argument (%"PRIsVALUE")! (Expected kind of %"PRIsVALUE")",\
99+
rb_obj_class(obj), (klass));\
100100
}\
101101
} while (0)
102102

103103
#define OSSL_Check_Instance(obj, klass) do {\
104104
if (!rb_obj_is_instance_of((obj), (klass))) {\
105-
ossl_raise(rb_eTypeError, "wrong argument (%s)! (Expected instance of %s)",\
106-
rb_obj_classname(obj), rb_class2name(klass));\
105+
ossl_raise(rb_eTypeError, "wrong argument (%"PRIsVALUE")! (Expected instance of %"PRIsVALUE")",\
106+
rb_obj_class(obj), (klass));\
107107
}\
108108
} while (0)
109109

ext/openssl/ossl_asn1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,8 @@ ossl_asn1_default_tag(VALUE obj)
624624
}
625625
tmp_class = rb_class_superclass(tmp_class);
626626
}
627-
ossl_raise(eASN1Error, "universal tag for %s not found",
628-
rb_class2name(CLASS_OF(obj)));
627+
ossl_raise(eASN1Error, "universal tag for %"PRIsVALUE" not found",
628+
rb_obj_class(obj));
629629

630630
return -1; /* dummy */
631631
}

ext/openssl/ossl_cipher.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ ossl_cipher_init(int argc, VALUE *argv, VALUE self, int mode)
213213
* We deprecated the arguments for this method, but we decided
214214
* keeping this behaviour for backward compatibility.
215215
*/
216-
const char *cname = rb_class2name(rb_obj_class(self));
217-
rb_warn("arguments for %s#encrypt and %s#decrypt were deprecated; "
218-
"use %s#pkcs5_keyivgen to derive key and IV",
216+
VALUE cname = rb_class_path(rb_obj_class(self));
217+
rb_warn("arguments for %"PRIsVALUE"#encrypt and %"PRIsVALUE"#decrypt were deprecated; "
218+
"use %"PRIsVALUE"#pkcs5_keyivgen to derive key and IV",
219219
cname, cname, cname);
220220
StringValue(pass);
221221
GetCipher(self, ctx);

ext/racc/cparse/cparse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,10 @@ extract_user_token(struct cparse_params *v, VALUE block_args,
418418

419419
if (!RB_TYPE_P(block_args, T_ARRAY)) {
420420
rb_raise(rb_eTypeError,
421-
"%s() %s %s (must be Array[2])",
421+
"%s() %s %"PRIsVALUE" (must be Array[2])",
422422
v->lex_is_iterator ? rb_id2name(v->lexmid) : "next_token",
423423
v->lex_is_iterator ? "yielded" : "returned",
424-
rb_class2name(CLASS_OF(block_args)));
424+
rb_obj_class(block_args));
425425
}
426426
if (RARRAY_LEN(block_args) != 2) {
427427
rb_raise(rb_eArgError,

ext/syslog/syslog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static VALUE mSyslog_log(int argc, VALUE *argv, VALUE self)
312312
pri = *argv++;
313313

314314
if (!FIXNUM_P(pri)) {
315-
rb_raise(rb_eTypeError, "type mismatch: %s given", rb_class2name(CLASS_OF(pri)));
315+
rb_raise(rb_eTypeError, "type mismatch: %"PRIsVALUE" given", rb_obj_class(pri));
316316
}
317317

318318
syslog_write(FIX2INT(pri), argc, argv);

version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#define RUBY_VERSION "2.1.1"
22
#define RUBY_RELEASE_DATE "2014-02-10"
3-
#define RUBY_PATCHLEVEL 29
3+
#define RUBY_PATCHLEVEL 30
44

55
#define RUBY_RELEASE_YEAR 2014
66
#define RUBY_RELEASE_MONTH 2

0 commit comments

Comments
 (0)