diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2011-03-08 02:03:31 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:13:08 +0300 |
commit | 8c5dcd829f821b43e89156a901917cad16ddf5c7 (patch) | |
tree | 2a8e3604da89f16ae99d9ebf299d84c806f730de | |
parent | b4584b1b312fb41aec696cf50958258217de4592 (diff) |
fixed LOG macros for "natural" use in "if" expressions.
-rw-r--r-- | base/logging.hpp | 4 | ||||
-rw-r--r-- | indexer/scale_index_builder.hpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/base/logging.hpp b/base/logging.hpp index 18d9644b05..f4c65a6c29 100644 --- a/base/logging.hpp +++ b/base/logging.hpp @@ -31,8 +31,8 @@ using ::my::LCRITICAL; // Logging macro. // Example usage: LOG(LINFO, (Calc(), m_Var, "Some string constant")); #define LOG(level, msg) if (level < ::my::g_LogLevel) {} \ - else { ::my::LogMessage(level, SRC(), ::my::impl::Message msg); } + else do { ::my::LogMessage(level, SRC(), ::my::impl::Message msg); } while (false) // Logging macro with short info (without entry point) #define LOG_SHORT(level, msg) if (level < ::my::g_LogLevel) {} \ - else { ::my::LogMessage(level, my::SrcPoint(), ::my::impl::Message msg); } + else do { ::my::LogMessage(level, my::SrcPoint(), ::my::impl::Message msg); } while (false) diff --git a/indexer/scale_index_builder.hpp b/indexer/scale_index_builder.hpp index 21ca14e7d4..ef5c798b76 100644 --- a/indexer/scale_index_builder.hpp +++ b/indexer/scale_index_builder.hpp @@ -150,7 +150,7 @@ inline void IndexScales(FeaturesVectorT const & featuresVector, VarSerialVectorWriter<WriterT> recordWriter(writer, ScaleIndexBase::NUM_BUCKETS); for (uint32_t bucket = 0; bucket < ScaleIndexBase::NUM_BUCKETS; ++bucket) { - LOG(LINFO, ("Building scale index for bucket:", bucket)) + LOG(LINFO, ("Building scale index for bucket:", bucket)); uint32_t numFeatures = 0; { FileWriter cellsToFeaturesWriter(tmpFilePrefix + ".c2f.sorted"); |