diff options
author | Aleric Inglewood | 2010-09-30 02:17:43 +0200 |
---|---|---|
committer | McCabe Maxsted | 2010-10-01 23:56:59 -0700 |
commit | b5b6e556ed7e9fa6bdea2365e82765981ee9f28c (patch) | |
tree | f984604269dc1d49b271cbfefbe9dd2ce6bf13c7 /linden/indra/llcommon | |
parent | Update of doc/contributions.txt (diff) | |
download | meta-impy-b5b6e556ed7e9fa6bdea2365e82765981ee9f28c.zip meta-impy-b5b6e556ed7e9fa6bdea2365e82765981ee9f28c.tar.gz meta-impy-b5b6e556ed7e9fa6bdea2365e82765981ee9f28c.tar.bz2 meta-impy-b5b6e556ed7e9fa6bdea2365e82765981ee9f28c.tar.xz |
SNOW-86: Dangerous macro leads to possible wrong code
See http://redmine.imprudenceviewer.org/issues/571
This patch appeared to already have been partially applied.
I added more semi-colons after all llendl (and LLENDL) macros,
and wrapped the lllog ... llendl construct into do { ... } while(0)
as is usual for macros that mimic a single statement.
The patch was double checked with regular expression greps and a compile.
Diffstat (limited to 'linden/indra/llcommon')
-rw-r--r-- | linden/indra/llcommon/llerror.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linden/indra/llcommon/llerror.h b/linden/indra/llcommon/llerror.h index 6794be4..37e922d 100644 --- a/linden/indra/llcommon/llerror.h +++ b/linden/indra/llcommon/llerror.h | |||
@@ -239,7 +239,7 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG; | |||
239 | */ | 239 | */ |
240 | 240 | ||
241 | #define lllog(level, broadTag, narrowTag, once) \ | 241 | #define lllog(level, broadTag, narrowTag, once) \ |
242 | { \ | 242 | do { \ |
243 | static LLError::CallSite _site( \ | 243 | static LLError::CallSite _site( \ |
244 | level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), __FUNCTION__, broadTag, narrowTag, once);\ | 244 | level, __FILE__, __LINE__, typeid(_LL_CLASS_TO_LOG), __FUNCTION__, broadTag, narrowTag, once);\ |
245 | if (_site.shouldLog()) \ | 245 | if (_site.shouldLog()) \ |
@@ -252,7 +252,7 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG; | |||
252 | LLError::End(); \ | 252 | LLError::End(); \ |
253 | LLError::Log::flush(_out, _site); \ | 253 | LLError::Log::flush(_out, _site); \ |
254 | } \ | 254 | } \ |
255 | } | 255 | } while(0) |
256 | 256 | ||
257 | // DEPRECATED: Use the new macros that allow tags and *look* like macros. | 257 | // DEPRECATED: Use the new macros that allow tags and *look* like macros. |
258 | #define lldebugs lllog(LLError::LEVEL_DEBUG, NULL, NULL, false) | 258 | #define lldebugs lllog(LLError::LEVEL_DEBUG, NULL, NULL, false) |