summaryrefslogtreecommitdiffhomepage
path: root/src/fmt_fp.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-08-19 21:50:36 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-08-19 21:50:36 +0900
commita7d611fb23e26cabf859aadcf5fc476f64054c3d (patch)
tree6b1d7e2d181fe051d66dfa9588db4077400a6ad4 /src/fmt_fp.c
parent5d0fc7e57a02987c15c41c7211b928491227bdc6 (diff)
downloadmruby-a7d611fb23e26cabf859aadcf5fc476f64054c3d.tar.gz
mruby-a7d611fb23e26cabf859aadcf5fc476f64054c3d.zip
Reduce signed/unsigned warnings in dump.c
Diffstat (limited to 'src/fmt_fp.c')
-rw-r--r--src/fmt_fp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fmt_fp.c b/src/fmt_fp.c
index ac76cef0e..6966cfef8 100644
--- a/src/fmt_fp.c
+++ b/src/fmt_fp.c
@@ -61,7 +61,7 @@ out(struct fmt_args *f, const char *s, size_t l)
#define PAD_SIZE 256
static void
-pad(struct fmt_args *f, char c, int w, ptrdiff_t l, uint8_t fl)
+pad(struct fmt_args *f, char c, ptrdiff_t w, ptrdiff_t l, uint8_t fl)
{
char pad[PAD_SIZE];
if (fl & (LEFT_ADJ | ZERO_PAD) || l >= w) return;
@@ -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 MAX(0, 3+pl);
+ return 3+pl;
}
y = frexp((double)y, &e2) * 2;
@@ -128,7 +128,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t p, uint8_t fl, int t)
if ((t|32)=='a') {
long double round = 8.0;
- int re;
+ ptrdiff_t re;
if (t&32) prefix += 9;
pl += 2;
@@ -332,7 +332,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t p, uint8_t fl, int t)
static int
fmt_core(struct fmt_args *f, const char *fmt, mrb_float flo)
{
- int p;
+ ptrdiff_t p;
if (*fmt != '%') {
return -1;