]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix ternary operator usage in assert macros
authorVMware, Inc <>
Thu, 27 Oct 2011 18:48:33 +0000 (11:48 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 27 Oct 2011 18:48:33 +0000 (11:48 -0700)
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 <mvanzin@vmware.com>
open-vm-tools/lib/include/vm_assert.h

index c5eee326058180cb81916165390b9f820d4a0e60..32caf2803c88b2efae8215d7d25e622a69eb7a7d 100644 (file)
@@ -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