[前][次][番号順一覧][スレッド一覧]

ruby-changes:32529

From: nobu <ko1@a...>
Date: Wed, 15 Jan 2014 17:16:38 +0900 (JST)
Subject: [ruby-changes:32529] nobu:r44608 (trunk): bigdecimal.c: rename macros

nobu	2014-01-15 17:16:33 +0900 (Wed, 15 Jan 2014)

  New Revision: 44608

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=44608

  Log:
    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.

  Modified files:
    trunk/ext/bigdecimal/bigdecimal.c
Index: ext/bigdecimal/bigdecimal.c
===================================================================
--- ext/bigdecimal/bigdecimal.c	(revision 44607)
+++ ext/bigdecimal/bigdecimal.c	(revision 44608)
@@ -105,10 +105,12 @@ static ID id_eq; https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L105
 #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: https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L289
     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, V https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L2276
       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) https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/bigdecimal.c#L2535
 	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);
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]