diff options
| author | Yasuhiro Matsumoto <[email protected]> | 2015-12-22 17:29:10 +0900 |
|---|---|---|
| committer | Yasuhiro Matsumoto <[email protected]> | 2015-12-22 17:46:20 +0900 |
| commit | 7cc33af2dc1137ef819b589e51e3756bdaa222e1 (patch) | |
| tree | 16f444f586b644175032c34253a14e1e2cb403c2 /src/fmt_fp.c | |
| parent | d0727be6eb22932aaf67447d09c9b3751516e891 (diff) | |
| download | mruby-7cc33af2dc1137ef819b589e51e3756bdaa222e1.tar.gz mruby-7cc33af2dc1137ef819b589e51e3756bdaa222e1.zip | |
fix build on VS2012
Diffstat (limited to 'src/fmt_fp.c')
| -rw-r--r-- | src/fmt_fp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fmt_fp.c b/src/fmt_fp.c index b20eb895f..61c7a4cc9 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -156,7 +156,7 @@ fmt_fp(struct fmt_args *f, long double y, int w, int p, int fl, int t) s=buf; do { - int x=y; + int x=(int)y; *s++=xdigits[x]|(t&32); y=16*(y-x); if (s-buf==1 && (y||p>0||(fl&ALT_FORM))) *s++='.'; @@ -184,7 +184,7 @@ fmt_fp(struct fmt_args *f, long double y, int w, int p, int fl, int t) else a=r=z=big+sizeof(big)/sizeof(*big) - LDBL_MANT_DIG - 1; do { - *z = y; + *z = (uint32_t)y; y = 1000000000*(y-*z++); } while (y); @@ -194,7 +194,7 @@ fmt_fp(struct fmt_args *f, long double y, int w, int p, int fl, int t) for (d=z-1; d>=a; d--) { uint64_t x = ((uint64_t)*d<<sh)+carry; *d = x % 1000000000; - carry = x / 1000000000; + carry = (uint32_t)(x / 1000000000); } if (carry) *--a = carry; while (z>a && !z[-1]) z--; |
