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

* ext/bigdecimal/bigdecimal.h (llabs): never never never never never

use "long long".

* ext/bigdecimal.bigdecimal.c (BigDecimal_to_i): get rid of a warning.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2010-08-16 01:02:23 +00:00
parent 56d3b926ce
commit 8eb121d812
3 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,10 @@
Mon Aug 16 10:00:45 2010 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/bigdecimal/bigdecimal.h (llabs): never never never never never
use "long long".
* ext/bigdecimal.bigdecimal.c (BigDecimal_to_i): get rid of a warning.
Sun Aug 15 18:14:20 2010 Kenta Murata <mrkn@mrkn.jp>
* ext/bigdecimal/bigdecimal.c (BigDecimal_dump, BigDecimal_inspect,

View file

@ -481,7 +481,7 @@ BigDecimal_to_i(VALUE self)
if(e<=0) return INT2FIX(0);
nf = VpBaseFig();
if(e<=nf) {
return LONG2NUM(VpGetSign(p)*(BDIGIT_DBL_SIGNED)p->frac[0]);
return LONG2NUM((long)(VpGetSign(p)*(BDIGIT_DBL_SIGNED)p->frac[0]));
}
else {
VALUE a = BigDecimal_split(self);

View file

@ -33,8 +33,8 @@ labs(long const x)
#endif
#ifndef HAVE_LLABS
static inline long long
llabs(long long const x)
static inline LONG_LONG
llabs(LONG_LONG const x)
{
if (x < 0) return -x;
return x;