In debug.c, don't compile code we aren't calling. (#31)

This commit is contained in:
Robert Lipe 2020-11-19 11:33:08 -06:00 committed by GitHub
parent 59050e6d33
commit b96c037be0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -222,10 +222,10 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
arg = modf(arg, &fi);
p1 = &buf[CVTBUFSIZE];
if (fi != 0)
if (fi != 0)
{
p1 = &buf[CVTBUFSIZE];
while (fi != 0)
while (fi != 0)
{
fj = modf(fi / 10, &fi);
*--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
}
else if (arg > 0)
{
while ((fj = arg * 10) < 1)
while ((fj = arg * 10) < 1)
{
arg = fj;
r2--;
@ -244,7 +244,7 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
p1 = &buf[ndigits];
if (eflag == 0) p1 += r2;
*decpt = r2;
if (p1 < &buf[0])
if (p1 < &buf[0])
{
buf[0] = '\0';
return buf;
@ -255,7 +255,7 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
arg = modf(arg, &fj);
*p++ = (int) fj + '0';
}
if (p1 >= &buf[CVTBUFSIZE])
if (p1 >= &buf[CVTBUFSIZE])
{
buf[CVTBUFSIZE - 1] = '\0';
return buf;
@ -292,9 +292,9 @@ char *fcvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf)
return cvt(arg, ndigits, decpt, sign, buf, 0);
}
static void ee_bufcpy(char *d, char *s, int count);
void ee_bufcpy(char *pd, char *ps, int count) {
#ifndef DISABLE_PRINT_FLOAT
static void ee_bufcpy(char *pd, char *ps, int count) {
char *pe=ps+count;
while (ps!=pe)
*pd++=*ps++;
@ -415,7 +415,7 @@ static void decimal_point(char *buffer)
if (*buffer)
{
int n = strnlen(buffer,256);
while (n > 0)
while (n > 0)
{
buffer[n + 1] = buffer[n];
n--;
@ -500,6 +500,7 @@ static char *flt(char *str, double num, int size, int precision, char fmt, int f
return str;
}
#endif // DISABLE_PRINT_FLOAT
/*use O0 preventing consuming more stack*/