Fixes warnings emitted by Visual Studio 2010 compiler.
authorOscar Fuentes <ofv@wanadoo.es>
Tue, 1 Mar 2011 23:11:57 +0000 (23:11 +0000)
committerOscar Fuentes <ofv@wanadoo.es>
Tue, 1 Mar 2011 23:11:57 +0000 (23:11 +0000)
Patch by Erik Olofsson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126796 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MachObjectWriter.cpp
unittests/Support/MathExtrasTest.cpp
utils/unittest/googletest/include/gtest/gtest.h

index 8af07c74fdfe707b194da7e613e7a3fdba655fdf..de5349459d1c2d71de3f35eff98b32c987daf86b 100644 (file)
@@ -274,8 +274,8 @@ public:
     if (is64Bit())
       Write32(0); // reserved3
 
-    assert(OS.tell() - Start == is64Bit() ? macho::Section64Size :
-           macho::Section32Size);
+    assert(OS.tell() - Start == (is64Bit() ? macho::Section64Size :
+           macho::Section32Size));
   }
 
   void WriteSymtabLoadCommand(uint32_t SymbolOffset, uint32_t NumSymbols,
index 3db1f77d444d5701359cf1be24fa2ecdd835e86c..0a6724c7e70807c9b98398192c9274bc08f4ae2f 100644 (file)
@@ -73,7 +73,7 @@ TEST(MathExtras, CountLeadingOnes_64) {
 }
 
 TEST(MathExtras, FloatBits) {
-  static const float kValue = 5632.34;
+  static const float kValue = 5632.34f;
   EXPECT_FLOAT_EQ(kValue, BitsToFloat(FloatToBits(kValue)));
 }
 
index 921fad11fcc8f24c0dd22394a4867ab24b6ea0c3..5470082abd4504fecd0205e648f15a8872bc977c 100644 (file)
@@ -1258,6 +1258,8 @@ AssertionResult CmpHelperEQ(const char* expected_expression,
 #pragma warning(push)          // Saves the current warning state.
 #pragma warning(disable:4389)  // Temporarily disables warning on
                                // signed/unsigned mismatch.
+#pragma warning(disable:4805)  // Temporarily disables warning on
+                               // unsafe mix of types
 #endif
 
   if (expected == actual) {