diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-15 08:16:33 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-15 08:16:33 +0000 |
commit | f5a12ac596f6d4884ba64d56f50594e028b00839 (patch) | |
tree | dbb8c0b17c27c3684993f5d067977ecfd13c7bb9 /ext | |
parent | 405ad52ad735fb70cb6381cf8f1a79a12a55ed02 (diff) | |
download | ruby-f5a12ac596f6d4884ba64d56f50594e028b00839.tar.gz |
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
Diffstat (limited to 'ext')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 3459300564..206e5d3f5a 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -105,10 +105,12 @@ static ID id_eq; #endif #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 # 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 /* @@ -287,7 +289,7 @@ unable_to_coerce_without_prec: if (must) { rb_raise(rb_eArgError, "%"PRIsVALUE" can't be coerced into BigDecimal without a precision", - CLASS_NAME(v)); + RB_OBJ_CLASSNAME(v)); } return NULL; } @@ -2274,7 +2276,7 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self) default: rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE" (expected scalar Numeric)", - CLASS_NAME(vexp)); + RB_OBJ_CLASSNAME(vexp)); } if (VpIsZero(x)) { @@ -2533,7 +2535,7 @@ BigDecimal_new(int argc, VALUE *argv) if (NIL_P(nFig)) { rb_raise(rb_eArgError, "can't omit precision for a %"PRIsVALUE".", - CLASS_NAME(iniValue)); + RB_OBJ_CLASSNAME(iniValue)); } return GetVpValueWithPrec(iniValue, mf, 1); |