Compile error fix for GFILE_ALLOW_FLOAT
This commit is contained in:
parent
6132b7f349
commit
5e0a0bfd9b
1 changed files with 6 additions and 6 deletions
|
@ -59,7 +59,7 @@ int vfnprintg(GFILE *f, int maxlen, const char *fmt, va_list arg) {
|
||||||
bool_t is_long, left_align;
|
bool_t is_long, left_align;
|
||||||
long l;
|
long l;
|
||||||
#if GFILE_ALLOW_FLOATS
|
#if GFILE_ALLOW_FLOATS
|
||||||
float f;
|
float fpv;
|
||||||
char tmpbuf[2*MAX_FILLER + 1];
|
char tmpbuf[2*MAX_FILLER + 1];
|
||||||
#else
|
#else
|
||||||
char tmpbuf[MAX_FILLER + 1];
|
char tmpbuf[MAX_FILLER + 1];
|
||||||
|
@ -156,15 +156,15 @@ int vfnprintg(GFILE *f, int maxlen, const char *fmt, va_list arg) {
|
||||||
break;
|
break;
|
||||||
#if GFILE_ALLOW_FLOATS
|
#if GFILE_ALLOW_FLOATS
|
||||||
case 'f':
|
case 'f':
|
||||||
f = (float) va_arg(arg, double);
|
fpv = (float) va_arg(arg, double);
|
||||||
if (f < 0) {
|
if (fpv < 0) {
|
||||||
*p++ = '-';
|
*p++ = '-';
|
||||||
f = -f;
|
fpv = -fpv;
|
||||||
}
|
}
|
||||||
l = f;
|
l = fpv;
|
||||||
p = ltoa_wd(p, l, 10, 0);
|
p = ltoa_wd(p, l, 10, 0);
|
||||||
*p++ = '.';
|
*p++ = '.';
|
||||||
l = (f - l) * FLOAT_PRECISION;
|
l = (fpv - l) * FLOAT_PRECISION;
|
||||||
p = ltoa_wd(p, l, 10, FLOAT_PRECISION / 10);
|
p = ltoa_wd(p, l, 10, FLOAT_PRECISION / 10);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue