1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Use rb_str2cstr() instead of STR2CSTR() macro.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shigek 2003-03-28 07:50:28 +00:00
parent 640c19405c
commit 15e11a88c6
2 changed files with 10 additions and 12 deletions

View file

@ -8,21 +8,19 @@
* License or the Artistic License, as specified in the README file * License or the Artistic License, as specified in the README file
* of this BigDecimal distribution. * of this BigDecimal distribution.
* *
* BigDecimal was originally copied from BigFloat(http://www.tinyforest.gr.jp/ruby/bigfloat_en.html), * NOTES:
* and has been modified so that it is fit in Ruby style. * 2003-03-28
* (Apr 2,2002). * V1.0 checked in to CVS(ruby/ext/bigdecimal).
* * use rb_str2cstr() instead of STR2CSTR().
* 2003-01-03 * 2003-01-03
* assign instead of asign(by knu),use string.h functions(by t.saito). * assign instead of asign(by knu),use string.h functions(by t.saito).
* 2002-12-06 * 2002-12-06
* The sqrt() bug reported by Bret Jolly fixed. * The sqrt() bug reported by Bret Jolly fixed.
* 2002-5-6 * 2002-5-6
* The bug reported by Sako Hiroshi <sakoh@ba2.so-net.ne.jp>(ruby-list:34988) * The bug reported by Sako Hiroshi (ruby-list:34988) in to_i fixed.
* in to_i fixed.
* 2002-4-17 * 2002-4-17
* methods prec and double_fig(class method) added(S.K). * methods prec and double_fig(class method) added(S.K).
* * 2002-04-04
* Version 1.0.0(2002/04/04)
* Copied from BigFloat 1.1.9 and * Copied from BigFloat 1.1.9 and
* hash method changed according to the suggestion from Akinori MUSHA <knu@iDaemons.org>. * hash method changed according to the suggestion from Akinori MUSHA <knu@iDaemons.org>.
* All ! class methods deactivated(but not actually removed). * All ! class methods deactivated(but not actually removed).
@ -91,7 +89,7 @@ coerce_rescue(VALUE *x)
{ {
rb_raise(rb_eTypeError, "%s can't be coerced into %s", rb_raise(rb_eTypeError, "%s can't be coerced into %s",
rb_special_const_p(x[1])? rb_special_const_p(x[1])?
STR2CSTR(rb_inspect(x[1])): rb_str2cstr(rb_inspect(x[1]),0):
rb_class2name(CLASS_OF(x[1])), rb_class2name(CLASS_OF(x[1])),
rb_class2name(CLASS_OF(x[0]))); rb_class2name(CLASS_OF(x[0])));
return (VALUE)0; return (VALUE)0;
@ -205,7 +203,7 @@ SomeOneMayDoIt:
if(must) { if(must) {
rb_raise(rb_eTypeError, "%s can't be coerced into BigDecimal", rb_raise(rb_eTypeError, "%s can't be coerced into BigDecimal",
rb_special_const_p(v)? rb_special_const_p(v)?
STR2CSTR(rb_inspect(v)): rb_str2cstr(rb_inspect(v),0):
rb_class2name(CLASS_OF(v)) rb_class2name(CLASS_OF(v))
); );
} }

View file

@ -8,8 +8,8 @@
* License or the Artistic License, as specified in the README file * License or the Artistic License, as specified in the README file
* of this BigDecimal distribution. * of this BigDecimal distribution.
* *
* 2002-12-06 * NOTES:
* The sqrt() bug reported by Bret Jolly fixed. * 2003-03-28 V1.0 checked in.
* *
*/ */