[llvm-commits] [llvm] r74430 - in /llvm/trunk/include/llvm: ADT/PointerUnion.h Bitcode/BitstreamReader.h

Sebastian Redl sebastian.redl at getdesigned.at
Mon Jun 29 10:12:17 PDT 2009


Author: cornedbee
Date: Mon Jun 29 12:12:06 2009
New Revision: 74430

URL: http://llvm.org/viewvc/llvm-project?rev=74430&view=rev
Log:
Fix three MSVC 2008 warnings that completely clutter the build output.

Modified:
    llvm/trunk/include/llvm/ADT/PointerUnion.h
    llvm/trunk/include/llvm/Bitcode/BitstreamReader.h

Modified: llvm/trunk/include/llvm/ADT/PointerUnion.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/PointerUnion.h?rev=74430&r1=74429&r2=74430&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/PointerUnion.h (original)
+++ llvm/trunk/include/llvm/ADT/PointerUnion.h Mon Jun 29 12:12:06 2009
@@ -89,7 +89,7 @@
     int is() const {
       int TyNo = ::llvm::getPointerUnionTypeNum<PT1, PT2>((T*)0);
       assert(TyNo != -1 && "Type query could never succeed on PointerUnion!");
-      return Val.getInt() == TyNo;
+      return static_cast<int>(Val.getInt()) == TyNo;
     }
     
     /// get<T>() - Return the value of the specified pointer type. If the

Modified: llvm/trunk/include/llvm/Bitcode/BitstreamReader.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/BitstreamReader.h?rev=74430&r1=74429&r2=74430&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Bitcode/BitstreamReader.h (original)
+++ llvm/trunk/include/llvm/Bitcode/BitstreamReader.h Mon Jun 29 12:12:06 2009
@@ -324,7 +324,7 @@
 
   uint64_t ReadVBR64(unsigned NumBits) {
     uint64_t Piece = Read(NumBits);
-    if ((Piece & (1U << (NumBits-1))) == 0)
+    if ((Piece & (uint64_t(1) << (NumBits-1))) == 0)
       return Piece;
 
     uint64_t Result = 0;
@@ -332,7 +332,7 @@
     while (1) {
       Result |= (Piece & ((1U << (NumBits-1))-1)) << NextBit;
 
-      if ((Piece & (1U << (NumBits-1))) == 0)
+      if ((Piece & (uint64_t(1) << (NumBits-1))) == 0)
         return Result;
 
       NextBit += NumBits-1;





More information about the llvm-commits mailing list