ruby-changes:20005
From: mrkn <ko1@a...>
Date: Mon, 13 Jun 2011 18:52:00 +0900 (JST)
Subject: [ruby-changes:20005] mrkn:r32053 (trunk): * ext/bigdecimal/bigdecimal.c (is_kind_of_BigDecimal): new function to
mrkn 2011-06-13 18:51:52 +0900 (Mon, 13 Jun 2011) New Revision: 32053 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32053 Log: * ext/bigdecimal/bigdecimal.c (is_kind_of_BigDecimal): new function to examine the whether the object is kind of BigDecimal. Modified files: trunk/ChangeLog trunk/ext/bigdecimal/bigdecimal.c Index: ChangeLog =================================================================== --- ChangeLog (revision 32052) +++ ChangeLog (revision 32053) @@ -1,3 +1,8 @@ +Mon Jun 13 18:52:00 2011 Kenta Murata <mrkn@m...> + + * ext/bigdecimal/bigdecimal.c (is_kind_of_BigDecimal): new function to + examine the whether the object is kind of BigDecimal. + Mon Jun 13 18:49:00 2011 Kenta Murata <mrkn@m...> * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): use GetVpValueWithPrec Index: ext/bigdecimal/bigdecimal.c =================================================================== --- ext/bigdecimal/bigdecimal.c (revision 32052) +++ ext/bigdecimal/bigdecimal.c (revision 32053) @@ -119,6 +119,12 @@ {0, BigDecimal_delete, BigDecimal_memsize,}, }; +static inline int +is_kind_of_BigDecimal(VALUE const v) +{ + return rb_typeddata_is_kind_of(v, &BigDecimal_data_type); +} + static VALUE ToValue(Real *p) { @@ -168,7 +174,7 @@ goto SomeOneMayDoIt; case T_DATA: - if (rb_typeddata_is_kind_of(v, &BigDecimal_data_type)) { + if (is_kind_of_BigDecimal(v)) { pv = DATA_PTR(v); return pv; } @@ -798,7 +804,7 @@ GUARD_OBJ(a,GetVpValue(self,1)); switch (TYPE(r)) { case T_DATA: - if (!rb_typeddata_is_kind_of(r, &BigDecimal_data_type)) break; + if (!is_kind_of_BigDecimal(r)) break; /* fall through */ case T_FIXNUM: /* fall through */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/