diff options
author | Mike Buland <eichlan@xagasoft.com> | 2008-06-04 15:40:49 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2008-06-04 15:40:49 +0000 |
commit | dc95fa94c1a8bb7249034d6fd2e61f80df48b317 (patch) | |
tree | b3482bc7122c18a037f3b7b38cc8270a3c0d8eb9 /src | |
parent | b84120127c21e6be693f554d7f170b73faacc09d (diff) | |
download | libbu++-dc95fa94c1a8bb7249034d6fd2e61f80df48b317.tar.gz libbu++-dc95fa94c1a8bb7249034d6fd2e61f80df48b317.tar.bz2 libbu++-dc95fa94c1a8bb7249034d6fd2e61f80df48b317.tar.xz libbu++-dc95fa94c1a8bb7249034d6fd2e61f80df48b317.zip |
Corrected a few macro definitions to make them more function-like and safe to
use.
Diffstat (limited to 'src')
-rw-r--r-- | src/protocolhttp.cpp | 2 | ||||
-rw-r--r-- | src/trace.h | 4 | ||||
-rw-r--r-- | src/unitsuite.h | 4 |
3 files changed, 5 insertions, 5 deletions
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 ) | |||
33 | iState = 0; | 33 | iState = 0; |
34 | } | 34 | } |
35 | 35 | ||
36 | #define SDB( i ) { } | 36 | #define SDB( i ) (void)0 |
37 | //#define SDB( i ) printf("state %d: %d, \"%s\"\n", i, tt, sToken.getStr() ) | 37 | //#define SDB( i ) printf("state %d: %d, \"%s\"\n", i, tt, sToken.getStr() ) |
38 | 38 | ||
39 | void Bu::ProtocolHttp::onNewData( Bu::Client *pClient ) | 39 | 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 | |||
34 | n++; \ | 34 | n++; \ |
35 | break; \ | 35 | break; \ |
36 | } \ | 36 | } \ |
37 | } | 37 | } (void)0 |
38 | 38 | ||
39 | template<typename t1> void __tracer( const char *pf, t1 &v1 ) | 39 | template<typename t1> void __tracer( const char *pf, t1 &v1 ) |
40 | { | 40 | { |
@@ -163,7 +163,7 @@ namespace Bu | |||
163 | #ifdef BU_TRACE | 163 | #ifdef BU_TRACE |
164 | # define TRACE(args...) Bu::__tracer( __PRETTY_FUNCTION__, ##args ) | 164 | # define TRACE(args...) Bu::__tracer( __PRETTY_FUNCTION__, ##args ) |
165 | #else | 165 | #else |
166 | # define TRACE(args...) {} | 166 | # define TRACE(args...) (void)0 |
167 | #endif | 167 | #endif |
168 | 168 | ||
169 | #endif | 169 | #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 | |||
105 | #define unitTest( tst ) if( !(tst) ) \ | 105 | #define unitTest( tst ) if( !(tst) ) \ |
106 | { \ | 106 | { \ |
107 | throw Bu::UnitSuite::Failed( #tst, __FILE__, __LINE__ ); \ | 107 | throw Bu::UnitSuite::Failed( #tst, __FILE__, __LINE__ ); \ |
108 | } | 108 | } else (void)0 |
109 | #define unitFailed( msg ) throw Bu::UnitSuite::Failed(msg, __FILE__, __LINE__); | 109 | #define unitFailed( msg ) throw Bu::UnitSuite::Failed(msg, __FILE__, __LINE__) |
110 | 110 | ||
111 | #endif | 111 | #endif |