Skip to content

Commit df44d66

Browse files
authored
Do not depend on c99 for(int
NB: The project requires C11, but sicne this is the only occurrence of such kind, we let it slide. See the PR conversation.
1 parent 4ca6d9b commit df44d66

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

quickjs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11351,6 +11351,7 @@ static int js_ecvt(double d, int n_digits,
1135111351
}
1135211352
} else {
1135311353
#if defined(FE_DOWNWARD) && defined(FE_TONEAREST)
11354+
int i;
1135411355
/* generate 2 extra digits: 99% chances to avoid 2 calls */
1135511356
js_ecvt1(d, n_digits + 2, dest, size, decpt);
1135611357
if (dest[n_digits + 1] < '5')
@@ -11364,7 +11365,7 @@ static int js_ecvt(double d, int n_digits,
1136411365
return n_digits; /* truncate the 2 extra digits */
1136511366
}
1136611367
/* round up in the string */
11367-
for(int i = n_digits;; i--) {
11368+
for(i = n_digits;; i--) {
1136811369
/* ignore the locale specific decimal point */
1136911370
if (is_digit(dest[i])) {
1137011371
if (dest[i]++ < '9')

0 commit comments

Comments
 (0)