From 5d099e40e6b8d7432053453ac93ab12aa9bb3411 Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Fri, 25 Aug 2017 14:10:24 +0200 Subject: fix fmt_fp.c(123) : warning C4244: 'return' : conversion from 'ptrdiff_t' to 'int', possible loss of data --- src/fmt_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/fmt_fp.c b/src/fmt_fp.c index 6966cfef8..e44788242 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -120,7 +120,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t p, uint8_t fl, int t) out(f, prefix, pl); out(f, ss, 3); pad(f, ' ', 0, 3+pl, fl^LEFT_ADJ); - return 3+pl; + return 3+(int)pl; } y = frexp((double)y, &e2) * 2; -- cgit v1.2.3 From c8341dbf7ce634af2b4cfb3aff6791fe97848cf1 Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Fri, 25 Aug 2017 14:10:43 +0200 Subject: fix fmt_fp.c(178) : warning C4244: 'return' : conversion from 'ptrdiff_t' to 'int', possible loss of data --- src/fmt_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/fmt_fp.c b/src/fmt_fp.c index e44788242..739211206 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -175,7 +175,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t p, uint8_t fl, int t) pad(f, '0', l-(ebuf-estr)-(s-buf), 0, 0); out(f, estr, ebuf-estr); pad(f, ' ', 0, pl+l, fl^LEFT_ADJ); - return pl+l; + return (int)pl+(int)l; } if (p<0) p=6; -- cgit v1.2.3 From b2a16d6bf720356738ae46a5dabbb1661dc7234d Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Fri, 25 Aug 2017 14:12:08 +0200 Subject: fix fmt_fp.c(206) : warning C4244: 'initializing' : conversion from 'ptrdiff_t' to 'int', possible loss of data --- src/fmt_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/fmt_fp.c b/src/fmt_fp.c index 739211206..2c8b14d2f 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -203,7 +203,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t p, uint8_t fl, int t) } while (e2<0) { uint32_t carry=0, *b; - int sh=MIN(9,-e2), need=1+(p+LDBL_MANT_DIG/3+8)/9; + int sh=MIN(9,-e2), need=1+((int)p+LDBL_MANT_DIG/3+8)/9; for (d=a; d>sh) + carry; -- cgit v1.2.3 From bac37a9f1aa7fa6e16884c6172fffdeeebacfe90 Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Fri, 25 Aug 2017 14:13:06 +0200 Subject: fix fmt_fp.c(220) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data --- src/fmt_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/fmt_fp.c b/src/fmt_fp.c index 2c8b14d2f..37f7c7a4b 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -217,7 +217,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t p, uint8_t fl, int t) e2+=sh; } - if (a=i; i*=10, e++); + if (a=i; i*=10, e++); else e=0; /* Perform rounding: j is precision after the radix (possibly neg) */ -- cgit v1.2.3 From ef6a762d41f40e1580e94a7e8e5a23df7af4d6a4 Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Fri, 25 Aug 2017 14:14:17 +0200 Subject: fix fmt_fp.c(224) : warning C4244: '=' : conversion from 'ptrdiff_t' to 'int', possible loss of data --- src/fmt_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/fmt_fp.c b/src/fmt_fp.c index 37f7c7a4b..bfaec05c9 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -221,7 +221,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t p, uint8_t fl, int t) else e=0; /* Perform rounding: j is precision after the radix (possibly neg) */ - j = p - ((t|32)!='f')*e - ((t|32)=='g' && p); + j = (int)p - ((t|32)!='f')*e - ((t|32)=='g' && p); if (j < 9*(z-r-1)) { uint32_t x; /* We avoid C's broken division of negative numbers */ -- cgit v1.2.3 From 78b13b3955afae412739e5dd347ed2fc444ceacd Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Fri, 25 Aug 2017 14:18:05 +0200 Subject: fix fmt_fp.c(251) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data --- src/fmt_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/fmt_fp.c b/src/fmt_fp.c index bfaec05c9..53b74e445 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -248,7 +248,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t p, uint8_t fl, int t) if (d=i; i*=10, e++); + for (i=10, e=9*(int)(r-a); *a>=i; i*=10, e++); } } if (z>d+1) z=d+1; -- cgit v1.2.3 From 5d9b84ef40413bb48230d7f93a0a0c4a208efef2 Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Fri, 25 Aug 2017 14:18:31 +0200 Subject: fix fmt_fp.c(329) : warning C4244: 'return' : conversion from 'ptrdiff_t' to 'int', possible loss of data --- src/fmt_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/fmt_fp.c b/src/fmt_fp.c index 53b74e445..0a8b22b41 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -326,7 +326,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t p, uint8_t fl, int t) pad(f, ' ', 0, pl+l, fl^LEFT_ADJ); - return pl+l; + return (int)pl+(int)l; } static int -- cgit v1.2.3