@@ -222,10 +222,10 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
222
222
arg = modf (arg , & fi );
223
223
p1 = & buf [CVTBUFSIZE ];
224
224
225
- if (fi != 0 )
225
+ if (fi != 0 )
226
226
{
227
227
p1 = & buf [CVTBUFSIZE ];
228
- while (fi != 0 )
228
+ while (fi != 0 )
229
229
{
230
230
fj = modf (fi / 10 , & fi );
231
231
* -- p1 = (int )((fj + 0.03 ) * 10 ) + '0' ;
@@ -235,7 +235,7 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
235
235
}
236
236
else if (arg > 0 )
237
237
{
238
- while ((fj = arg * 10 ) < 1 )
238
+ while ((fj = arg * 10 ) < 1 )
239
239
{
240
240
arg = fj ;
241
241
r2 -- ;
@@ -244,7 +244,7 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
244
244
p1 = & buf [ndigits ];
245
245
if (eflag == 0 ) p1 += r2 ;
246
246
* decpt = r2 ;
247
- if (p1 < & buf [0 ])
247
+ if (p1 < & buf [0 ])
248
248
{
249
249
buf [0 ] = '\0' ;
250
250
return buf ;
@@ -255,7 +255,7 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
255
255
arg = modf (arg , & fj );
256
256
* p ++ = (int ) fj + '0' ;
257
257
}
258
- if (p1 >= & buf [CVTBUFSIZE ])
258
+ if (p1 >= & buf [CVTBUFSIZE ])
259
259
{
260
260
buf [CVTBUFSIZE - 1 ] = '\0' ;
261
261
return buf ;
@@ -292,9 +292,9 @@ char *fcvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf)
292
292
return cvt (arg , ndigits , decpt , sign , buf , 0 );
293
293
}
294
294
295
- static void ee_bufcpy ( char * d , char * s , int count );
296
-
297
- void ee_bufcpy (char * pd , char * ps , int count ) {
295
+ #ifndef DISABLE_PRINT_FLOAT
296
+
297
+ static void ee_bufcpy (char * pd , char * ps , int count ) {
298
298
char * pe = ps + count ;
299
299
while (ps != pe )
300
300
* pd ++ = * ps ++ ;
@@ -415,7 +415,7 @@ static void decimal_point(char *buffer)
415
415
if (* buffer )
416
416
{
417
417
int n = strnlen (buffer ,256 );
418
- while (n > 0 )
418
+ while (n > 0 )
419
419
{
420
420
buffer [n + 1 ] = buffer [n ];
421
421
n -- ;
@@ -500,6 +500,7 @@ static char *flt(char *str, double num, int size, int precision, char fmt, int f
500
500
501
501
return str ;
502
502
}
503
+ #endif // DISABLE_PRINT_FLOAT
503
504
504
505
505
506
/*use O0 preventing consuming more stack*/
0 commit comments