mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
fix: mrbgems\mruby-sprintf\src\sprintf.c(1052): warning C4244: '+=': conversion from 'mrb_int' to 'int', possible loss of data
This commit is contained in:
committed by
Tomasz Dabrowski
parent
1e2c962fa5
commit
a94525d4ea
@@ -999,13 +999,15 @@ retry:
|
||||
case 'A': {
|
||||
mrb_value val = GETARG();
|
||||
double fval;
|
||||
int i, need = 6;
|
||||
mrb_int i;
|
||||
mrb_int need = 6;
|
||||
char fbuf[32];
|
||||
int frexp_result;
|
||||
|
||||
fval = mrb_float(mrb_Float(mrb, val));
|
||||
if (!isfinite(fval)) {
|
||||
const char *expr;
|
||||
const int elen = 3;
|
||||
const mrb_int elen = 3;
|
||||
char sign = '\0';
|
||||
|
||||
if (isnan(fval)) {
|
||||
@@ -1045,7 +1047,8 @@ retry:
|
||||
need = 0;
|
||||
if (*p != 'e' && *p != 'E') {
|
||||
i = INT_MIN;
|
||||
frexp(fval, &i);
|
||||
frexp(fval, &frexp_result);
|
||||
i = (mrb_int)frexp_result;
|
||||
if (i > 0)
|
||||
need = BIT_DIGITS(i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user