diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-06-05 16:04:30 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-06-05 16:04:30 +0900 |
| commit | 106f4c4e9d703f709ff3053848afb849c83b8ea4 (patch) | |
| tree | b93ed4a4076aa9b90daa41de4feeb9eeec8c2ffa /src/fmt_fp.c | |
| parent | f1523d24042ca3416dc5b9be7b3fc220ddaed896 (diff) | |
| download | mruby-106f4c4e9d703f709ff3053848afb849c83b8ea4.tar.gz mruby-106f4c4e9d703f709ff3053848afb849c83b8ea4.zip | |
Add proper casts to silence VC warnings.
Diffstat (limited to 'src/fmt_fp.c')
| -rw-r--r-- | src/fmt_fp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/fmt_fp.c b/src/fmt_fp.c index 9ae5dd177..b151e81fb 100644 --- a/src/fmt_fp.c +++ b/src/fmt_fp.c @@ -160,7 +160,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t w, ptrdiff_t p, uint32_t fl, out(f, prefix, pl); out(f, ss, 3); pad(f, ' ', w, 3+pl, fl^LEFT_ADJ); - return MAX(w, 3+(int)pl); + return (int)MAX(w, 3+pl); } y = frexp((double)y, &e2) * 2; @@ -215,7 +215,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t w, ptrdiff_t p, uint32_t fl, pad(f, '0', l-(ebuf-estr)-(s-buf), 0, 0); out(f, estr, ebuf-estr); pad(f, ' ', w, pl+l, fl^LEFT_ADJ); - return MAX(w, (int)pl+(int)l); + return (int)MAX(w, pl+l); } if (p<0) p=6; @@ -366,7 +366,7 @@ fmt_fp(struct fmt_args *f, long double y, ptrdiff_t w, ptrdiff_t p, uint32_t fl, pad(f, ' ', w, pl+l, fl^LEFT_ADJ); - return MAX(w, (int)pl+(int)l); + return (int)MAX(w, pl+l); } static int @@ -440,7 +440,7 @@ mrb_float_to_cstr(mrb_state *mrb, char *buf, size_t len, const char *fmt, mrb_fl mrb_raise(mrb, E_ARGUMENT_ERROR, "invalid format string"); } *cstr.buf = '\0'; - return cstr.buf - buf; + return (int)cstr.buf - buf; } #else /* MRB_DISABLE_STDIO || _WIN32 || _WIN64 */ #include <mruby.h> |
