From dc95fa94c1a8bb7249034d6fd2e61f80df48b317 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 4 Jun 2008 15:40:49 +0000 Subject: Corrected a few macro definitions to make them more function-like and safe to use. --- src/protocolhttp.cpp | 2 +- src/trace.h | 4 ++-- src/unitsuite.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/protocolhttp.cpp b/src/protocolhttp.cpp index f512eda..534cb02 100644 --- a/src/protocolhttp.cpp +++ b/src/protocolhttp.cpp @@ -33,7 +33,7 @@ void Bu::ProtocolHttp::onNewConnection( Bu::Client *pClient ) iState = 0; } -#define SDB( i ) { } +#define SDB( i ) (void)0 //#define SDB( i ) printf("state %d: %d, \"%s\"\n", i, tt, sToken.getStr() ) void Bu::ProtocolHttp::onNewData( Bu::Client *pClient ) diff --git a/src/trace.h b/src/trace.h index 91e2094..e115d66 100644 --- a/src/trace.h +++ b/src/trace.h @@ -34,7 +34,7 @@ namespace Bu n++; \ break; \ } \ - } + } (void)0 template void __tracer( const char *pf, t1 &v1 ) { @@ -163,7 +163,7 @@ namespace Bu #ifdef BU_TRACE # define TRACE(args...) Bu::__tracer( __PRETTY_FUNCTION__, ##args ) #else -# define TRACE(args...) {} +# define TRACE(args...) (void)0 #endif #endif diff --git a/src/unitsuite.h b/src/unitsuite.h index d281e6a..d27e322 100644 --- a/src/unitsuite.h +++ b/src/unitsuite.h @@ -105,7 +105,7 @@ namespace Bu #define unitTest( tst ) if( !(tst) ) \ { \ throw Bu::UnitSuite::Failed( #tst, __FILE__, __LINE__ ); \ -} -#define unitFailed( msg ) throw Bu::UnitSuite::Failed(msg, __FILE__, __LINE__); +} else (void)0 +#define unitFailed( msg ) throw Bu::UnitSuite::Failed(msg, __FILE__, __LINE__) #endif -- cgit v1.2.3