summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2012-08-20 13:12:49 +0200
committerPierre Bourdon <delroth@gmail.com>2012-08-20 13:12:49 +0200
commit54fc4029dd3dad0744fecc192cbee9d26a2601e6 (patch)
treeb266a88408824dbb551ca6cffbd6ceed07deae05 /Source/Core
parent603bd9982d89b917af83bae2e45b3eaa8e2accec (diff)
Use do { ... } while (0) for the *_LOG macros
Without this patch, such code would not compile: if (cond) WARN_LOG(FOO, "msg"); else WARN_LOG(FOO, "msg2");
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Src/Log.h10
-rw-r--r--Source/Core/Core/Src/HW/DVDInterface.cpp2
-rw-r--r--Source/Core/DiscIO/Src/DiscScrubber.cpp2
-rw-r--r--Source/Core/VideoCommon/Src/VideoCommon.h4
4 files changed, 9 insertions, 9 deletions
diff --git a/Source/Core/Common/Src/Log.h b/Source/Core/Common/Src/Log.h
index 3be97d54d4..e24fd8583c 100644
--- a/Source/Core/Common/Src/Log.h
+++ b/Source/Core/Common/Src/Log.h
@@ -114,11 +114,11 @@ void GenericLog(LOGTYPES_LEVELS level, LOGTYPES_TYPE type,
}
#endif
-#define ERROR_LOG(t,...) { GENERIC_LOG(LogTypes::t, LogTypes::LERROR, __VA_ARGS__) }
-#define WARN_LOG(t,...) { GENERIC_LOG(LogTypes::t, LogTypes::LWARNING, __VA_ARGS__) }
-#define NOTICE_LOG(t,...) { GENERIC_LOG(LogTypes::t, LogTypes::LNOTICE, __VA_ARGS__) }
-#define INFO_LOG(t,...) { GENERIC_LOG(LogTypes::t, LogTypes::LINFO, __VA_ARGS__) }
-#define DEBUG_LOG(t,...) { GENERIC_LOG(LogTypes::t, LogTypes::LDEBUG, __VA_ARGS__) }
+#define ERROR_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LERROR, __VA_ARGS__) } while (0)
+#define WARN_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LWARNING, __VA_ARGS__) } while (0)
+#define NOTICE_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LNOTICE, __VA_ARGS__) } while (0)
+#define INFO_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LINFO, __VA_ARGS__) } while (0)
+#define DEBUG_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LDEBUG, __VA_ARGS__) } while (0)
#if MAX_LOGLEVEL >= DEBUG_LEVEL
#define _dbg_assert_(_t_, _a_) \
diff --git a/Source/Core/Core/Src/HW/DVDInterface.cpp b/Source/Core/Core/Src/HW/DVDInterface.cpp
index cb400f43a9..f2b387fbd6 100644
--- a/Source/Core/Core/Src/HW/DVDInterface.cpp
+++ b/Source/Core/Core/Src/HW/DVDInterface.cpp
@@ -675,7 +675,7 @@ void ExecuteCommand(UDICR& _DICR)
_dbg_assert_(DVDINTERFACE, m_DILENGTH.Length == 0x20);
if (!DVDRead(m_DICMDBUF[1].Hex, m_DIMAR.Address, m_DILENGTH.Length))
PanicAlertT("Cant read from DVD_Plugin - DVD-Interface: Fatal Error");
- WARN_LOG(DVDINTERFACE, "Read DiscID %08x", Memory::Read_U32(m_DIMAR.Address))
+ WARN_LOG(DVDINTERFACE, "Read DiscID %08x", Memory::Read_U32(m_DIMAR.Address));
break;
default:
diff --git a/Source/Core/DiscIO/Src/DiscScrubber.cpp b/Source/Core/DiscIO/Src/DiscScrubber.cpp
index 1f99b8d867..841c8283cc 100644
--- a/Source/Core/DiscIO/Src/DiscScrubber.cpp
+++ b/Source/Core/DiscIO/Src/DiscScrubber.cpp
@@ -284,7 +284,7 @@ bool ParsePartitionData(SPartition& _rPartition)
if (!FileSystem)
{
- ERROR_LOG(DISCIO, "Failed to create filesystem for group %d partition %u", _rPartition.GroupNumber, _rPartition.Number)
+ ERROR_LOG(DISCIO, "Failed to create filesystem for group %d partition %u", _rPartition.GroupNumber, _rPartition.Number);
ParsedOK = false;
}
else
diff --git a/Source/Core/VideoCommon/Src/VideoCommon.h b/Source/Core/VideoCommon/Src/VideoCommon.h
index 9f6dd59cd3..f067fb9d6b 100644
--- a/Source/Core/VideoCommon/Src/VideoCommon.h
+++ b/Source/Core/VideoCommon/Src/VideoCommon.h
@@ -88,9 +88,9 @@ struct TargetRectangle : public MathUtil::Rectangle<int>
};
#ifdef _WIN32
-#define PRIM_LOG(...) {DEBUG_LOG(VIDEO, __VA_ARGS__)}
+#define PRIM_LOG(...) DEBUG_LOG(VIDEO, __VA_ARGS__)
#else
-#define PRIM_LOG(...) {DEBUG_LOG(VIDEO, ##__VA_ARGS__)}
+#define PRIM_LOG(...) DEBUG_LOG(VIDEO, ##__VA_ARGS__)
#endif