remove compiler warnings by using '#ifdef DEBUG' on a large section

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@859 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2002-05-31 13:15:48 +00:00
parent cccf7f8bb1
commit 7e8615757c

View file

@ -22,8 +22,10 @@
#include <stdarg.h> #include <stdarg.h>
#include "config.h" #include "config.h"
#ifdef DEBUG
static char debugmembuf[100]; static char debugmembuf[100];
static char debugbuf[200]; static char debugbuf[200];
#endif
#ifndef SIMULATOR /* allow non archos platforms to display output */ #ifndef SIMULATOR /* allow non archos platforms to display output */
@ -39,6 +41,7 @@ void debug_init(void)
IPRE |= 0xf000; /* Set to highest priority */ IPRE |= 0xf000; /* Set to highest priority */
} }
#ifdef DEBUG
static int debug_tx_ready(void) static int debug_tx_ready(void)
{ {
return (SSR1 & SCI_TDRE); return (SSR1 & SCI_TDRE);
@ -60,6 +63,7 @@ static void debug_tx_char(char ch)
static void debug_handle_error(char ssr) static void debug_handle_error(char ssr)
{ {
(void)ssr;
SSR1 &= ~(SCI_ORER | SCI_PER | SCI_FER); SSR1 &= ~(SCI_ORER | SCI_PER | SCI_FER);
} }
@ -163,6 +167,7 @@ static void putpacket (char *buffer)
SCR1 |= 0x40; SCR1 |= 0x40;
} }
/* convert the memory, pointed to by mem into hex, placing result in buf */ /* convert the memory, pointed to by mem into hex, placing result in buf */
/* return a pointer to the last char put in buf (null) */ /* return a pointer to the last char put in buf (null) */
static char *mem2hex (char *mem, char *buf, int count) static char *mem2hex (char *mem, char *buf, int count)
@ -186,6 +191,7 @@ static void debug(char *msg)
mem2hex(msg, &debugbuf[1], strlen(msg)); mem2hex(msg, &debugbuf[1], strlen(msg));
putpacket(debugbuf); putpacket(debugbuf);
} }
#endif /* end of DEBUG section */
void debugf(char *fmt, ...) void debugf(char *fmt, ...)
{ {
@ -196,6 +202,8 @@ void debugf(char *fmt, ...)
vsnprintf(debugmembuf, sizeof(debugmembuf), fmt, ap); vsnprintf(debugmembuf, sizeof(debugmembuf), fmt, ap);
va_end(ap); va_end(ap);
debug(debugmembuf); debug(debugmembuf);
#else
(void)fmt;
#endif #endif
} }