Skip to content

Commit b96c037

Browse files
authored
In debug.c, don't compile code we aren't calling. (#31)
1 parent 59050e6 commit b96c037

File tree

1 file changed

+10
-9
lines changed
  • components/bl602/bl602/evb/src

1 file changed

+10
-9
lines changed

components/bl602/bl602/evb/src/debug.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,10 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
222222
arg = modf(arg, &fi);
223223
p1 = &buf[CVTBUFSIZE];
224224

225-
if (fi != 0)
225+
if (fi != 0)
226226
{
227227
p1 = &buf[CVTBUFSIZE];
228-
while (fi != 0)
228+
while (fi != 0)
229229
{
230230
fj = modf(fi / 10, &fi);
231231
*--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
235235
}
236236
else if (arg > 0)
237237
{
238-
while ((fj = arg * 10) < 1)
238+
while ((fj = arg * 10) < 1)
239239
{
240240
arg = fj;
241241
r2--;
@@ -244,7 +244,7 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
244244
p1 = &buf[ndigits];
245245
if (eflag == 0) p1 += r2;
246246
*decpt = r2;
247-
if (p1 < &buf[0])
247+
if (p1 < &buf[0])
248248
{
249249
buf[0] = '\0';
250250
return buf;
@@ -255,7 +255,7 @@ static char *cvt(double arg, int ndigits, int *decpt, int *sign, char *buf, int
255255
arg = modf(arg, &fj);
256256
*p++ = (int) fj + '0';
257257
}
258-
if (p1 >= &buf[CVTBUFSIZE])
258+
if (p1 >= &buf[CVTBUFSIZE])
259259
{
260260
buf[CVTBUFSIZE - 1] = '\0';
261261
return buf;
@@ -292,9 +292,9 @@ char *fcvtbuf(double arg, int ndigits, int *decpt, int *sign, char *buf)
292292
return cvt(arg, ndigits, decpt, sign, buf, 0);
293293
}
294294

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) {
298298
char *pe=ps+count;
299299
while (ps!=pe)
300300
*pd++=*ps++;
@@ -415,7 +415,7 @@ static void decimal_point(char *buffer)
415415
if (*buffer)
416416
{
417417
int n = strnlen(buffer,256);
418-
while (n > 0)
418+
while (n > 0)
419419
{
420420
buffer[n + 1] = buffer[n];
421421
n--;
@@ -500,6 +500,7 @@ static char *flt(char *str, double num, int size, int precision, char fmt, int f
500500

501501
return str;
502502
}
503+
#endif // DISABLE_PRINT_FLOAT
503504

504505

505506
/*use O0 preventing consuming more stack*/

0 commit comments

Comments
 (0)