From: VMware, Inc <> Date: Thu, 27 Oct 2011 18:48:33 +0000 (-0700) Subject: Fix ternary operator usage in assert macros X-Git-Tag: 2011.10.26-514583~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=da93243d46b3d0ee80034f4b404c6be584be52e2;p=thirdparty%2Fopen-vm-tools.git Fix ternary operator usage in assert macros A couple of our ASSERT macros use the ternary operator without casting both operands to the same type. This is required for C++. bora does not have any usage of these macros in C++ code, but it breaks the build on sysimg branch. Signed-off-by: Marcelo Vanzin --- diff --git a/open-vm-tools/lib/include/vm_assert.h b/open-vm-tools/lib/include/vm_assert.h index c5eee3260..32caf2803 100644 --- a/open-vm-tools/lib/include/vm_assert.h +++ b/open-vm-tools/lib/include/vm_assert.h @@ -251,7 +251,7 @@ EXTERN void WarningThrottled(uint32 *count, const char *fmt, ...) #define ASSERT_HAS_INTERRUPTS() ASSERT(INTERRUPTS_ENABLED()) #define ASSERT_LOG_UNEXPECTED(bug, cond) \ - (UNLIKELY(!(cond)) ? LOG_UNEXPECTED(bug) : 0) + (UNLIKELY(!(cond)) ? LOG_UNEXPECTED(bug) : (void)0) #ifdef VMX86_DEVEL #define LOG_UNEXPECTED(bug) \ Warning(AssertUnexpectedFmt, __FILE__, __LINE__, bug) @@ -260,7 +260,7 @@ EXTERN void WarningThrottled(uint32 *count, const char *fmt, ...) Log(AssertUnexpectedFmt, __FILE__, __LINE__, bug) #endif -#define ASSERT_NOT_TESTED(cond) (UNLIKELY(!(cond)) ? NOT_TESTED() : 0) +#define ASSERT_NOT_TESTED(cond) (UNLIKELY(!(cond)) ? NOT_TESTED() : (void)0) #ifdef VMX86_DEVEL #define NOT_TESTED() Warning(AssertNotTestedFmt, __FILE__, __LINE__) #else