Date: Sat, 13 Jun 2009 00:13:45 +0000 (UTC) From: Dag-Erling Smorgrav <des@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r194091 - head/usr.sbin/nscd Message-ID: <200906130013.n5D0DjHh097317@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: des Date: Sat Jun 13 00:13:44 2009 New Revision: 194091 URL: http://svn.freebsd.org/changeset/base/194091 Log: Make the debugging macros expand to (void)0 instead of simply nothing when debugging is turned off. Rename debugging functions due to namespace violation. MFC after: 1 week Modified: head/usr.sbin/nscd/debug.c head/usr.sbin/nscd/debug.h Modified: head/usr.sbin/nscd/debug.c ============================================================================== --- head/usr.sbin/nscd/debug.c Sat Jun 13 00:12:02 2009 (r194090) +++ head/usr.sbin/nscd/debug.c Sat Jun 13 00:13:44 2009 (r194091) @@ -35,7 +35,7 @@ static int trace_level = 0; static int trace_level_bk = 0; void -__trace_in(const char *s, const char *f, int l) +nscd_trace_in(const char *s, const char *f, int l) { int i; if (trace_level < TRACE_WANTED) @@ -50,7 +50,7 @@ __trace_in(const char *s, const char *f, } void -__trace_point(const char *f, int l) +nscd_trace_point(const char *f, int l) { int i; @@ -64,7 +64,7 @@ __trace_point(const char *f, int l) } void -__trace_msg(const char *msg, const char *f, int l) +nscd_trace_msg(const char *msg, const char *f, int l) { int i; @@ -78,7 +78,7 @@ __trace_msg(const char *msg, const char } void -__trace_ptr(const char *desc, const void *p, const char *f, int l) +nscd_trace_ptr(const char *desc, const void *p, const char *f, int l) { int i; @@ -92,7 +92,7 @@ __trace_ptr(const char *desc, const void } void -__trace_int(const char *desc, int i, const char *f, int l) +nscd_trace_int(const char *desc, int i, const char *f, int l) { int j; @@ -106,7 +106,7 @@ __trace_int(const char *desc, int i, con } void -__trace_str(const char *desc, const char *s, const char *f, int l) +nscd_trace_str(const char *desc, const char *s, const char *f, int l) { int i; @@ -120,7 +120,7 @@ __trace_str(const char *desc, const char } void -__trace_out(const char *s, const char *f, int l) +nscd_trace_out(const char *s, const char *f, int l) { int i; @@ -135,14 +135,14 @@ __trace_out(const char *s, const char *f } void -__trace_on(void) +nscd_trace_on(void) { trace_level = trace_level_bk; trace_level_bk = 0; } void -__trace_off(void) +nscd_trace_off(void) { trace_level_bk = trace_level; trace_level = 1024; Modified: head/usr.sbin/nscd/debug.h ============================================================================== --- head/usr.sbin/nscd/debug.h Sat Jun 13 00:12:02 2009 (r194090) +++ head/usr.sbin/nscd/debug.h Sat Jun 13 00:13:44 2009 (r194091) @@ -33,35 +33,35 @@ /* #ifndef NDEBUG */ #if 0 -#define TRACE_IN(x) __trace_in(#x, __FILE__, __LINE__) -#define TRACE_POINT() __trace_point(__FILE__, __LINE__) -#define TRACE_MSG(x) __trace_msg(x, __FILE__, __LINE__) -#define TRACE_PTR(p) __trace_ptr(#p, p, __FILE__, __LINE__) -#define TRACE_INT(i) __trace_int(#i, i, __FILE__, __LINE__) -#define TRACE_STR(s) __trace_str(#s, s, __FILE__, __LINE__) -#define TRACE_OUT(x) __trace_out(#x, __FILE__, __LINE__) -#define TRACE_ON() __trace_on() -#define TRACE_OFF() __trace_off() +#define TRACE_IN(x) nscd_trace_in(#x, __FILE__, __LINE__) +#define TRACE_POINT() nscd_trace_point(__FILE__, __LINE__) +#define TRACE_MSG(x) nscd_trace_msg(x, __FILE__, __LINE__) +#define TRACE_PTR(p) nscd_trace_ptr(#p, p, __FILE__, __LINE__) +#define TRACE_INT(i) nscd_trace_int(#i, i, __FILE__, __LINE__) +#define TRACE_STR(s) nscd_trace_str(#s, s, __FILE__, __LINE__) +#define TRACE_OUT(x) nscd_trace_out(#x, __FILE__, __LINE__) +#define TRACE_ON() nscd_trace_on() +#define TRACE_OFF() nscd_trace_off() #else -#define TRACE_IN(x) -#define TRACE_POINT() -#define TRACE_MSG(x) -#define TRACE_PTR(p) -#define TRACE_INT(i) -#define TRACE_STR(s) -#define TRACE_OUT(x) -#define TRACE_ON() -#define TRACE_OFF() +#define TRACE_IN(x) (void)0 +#define TRACE_POINT() (void)0 +#define TRACE_MSG(x) (void)0 +#define TRACE_PTR(p) (void)0 +#define TRACE_INT(i) (void)0 +#define TRACE_STR(s) (void)0 +#define TRACE_OUT(x) (void)0 +#define TRACE_ON() (void)0 +#define TRACE_OFF() (void)0 #endif -extern void __trace_in(const char *, const char *, int); -extern void __trace_point(const char *, int); -extern void __trace_msg(const char *, const char *, int); -extern void __trace_ptr(const char *, const void *, const char *, int); -extern void __trace_int(const char *, int, const char *, int); -extern void __trace_str(const char *, const char *, const char *, int); -extern void __trace_out(const char *, const char *, int); -extern void __trace_on(void); -extern void __trace_off(void); +extern void nscd_trace_in(const char *, const char *, int); +extern void nscd_trace_point(const char *, int); +extern void nscd_trace_msg(const char *, const char *, int); +extern void nscd_trace_ptr(const char *, const void *, const char *, int); +extern void nscd_trace_int(const char *, int, const char *, int); +extern void nscd_trace_str(const char *, const char *, const char *, int); +extern void nscd_trace_out(const char *, const char *, int); +extern void nscd_trace_on(void); +extern void nscd_trace_off(void); #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906130013.n5D0DjHh097317>