bigdecimal.c: rename macros

* ext/bigdecimal/bigdecimal.c (RB_OBJ_CLASSNAME): rename from CLASS_NAME().

* ext/bigdecimal/bigdecimal.c (RB_OBJ_STRING): for object itself.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-01-15 08:16:33 +00:00
parent 405ad52ad7
commit f5a12ac596

View File

@ -105,10 +105,12 @@ static ID id_eq;
#endif #endif
#ifdef PRIsVALUE #ifdef PRIsVALUE
# define CLASS_NAME(obj) rb_obj_class(obj) # define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj)
# define RB_OBJ_STRING(obj) (obj)
#else #else
# define PRIsVALUE "s" # define PRIsVALUE "s"
# define CLASS_NAME(obj) rb_obj_classname(obj) # define RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj)
# define RB_OBJ_STRING(obj) StringValueCStr(obj)
#endif #endif
/* /*
@ -287,7 +289,7 @@ unable_to_coerce_without_prec:
if (must) { if (must) {
rb_raise(rb_eArgError, rb_raise(rb_eArgError,
"%"PRIsVALUE" can't be coerced into BigDecimal without a precision", "%"PRIsVALUE" can't be coerced into BigDecimal without a precision",
CLASS_NAME(v)); RB_OBJ_CLASSNAME(v));
} }
return NULL; return NULL;
} }
@ -2274,7 +2276,7 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
default: default:
rb_raise(rb_eTypeError, rb_raise(rb_eTypeError,
"wrong argument type %"PRIsVALUE" (expected scalar Numeric)", "wrong argument type %"PRIsVALUE" (expected scalar Numeric)",
CLASS_NAME(vexp)); RB_OBJ_CLASSNAME(vexp));
} }
if (VpIsZero(x)) { if (VpIsZero(x)) {
@ -2533,7 +2535,7 @@ BigDecimal_new(int argc, VALUE *argv)
if (NIL_P(nFig)) { if (NIL_P(nFig)) {
rb_raise(rb_eArgError, rb_raise(rb_eArgError,
"can't omit precision for a %"PRIsVALUE".", "can't omit precision for a %"PRIsVALUE".",
CLASS_NAME(iniValue)); RB_OBJ_CLASSNAME(iniValue));
} }
return GetVpValueWithPrec(iniValue, mf, 1); return GetVpValueWithPrec(iniValue, mf, 1);