Browse Source

Keep header file free of 'possible loss of data' warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36832 91177308-0d34-0410-b5e6-96231b3b80d8
Jeff Cohen 18 years ago
parent
commit
650c938c41
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lib/Bitcode/Reader/BitcodeReader.h

+ 3 - 3
lib/Bitcode/Reader/BitcodeReader.h

@@ -154,7 +154,7 @@ private:
   bool getValueTypePair(SmallVector<uint64_t, 64> &Record, unsigned &Slot,
   bool getValueTypePair(SmallVector<uint64_t, 64> &Record, unsigned &Slot,
                         unsigned InstNum, Value *&ResVal) {
                         unsigned InstNum, Value *&ResVal) {
     if (Slot == Record.size()) return true;
     if (Slot == Record.size()) return true;
-    unsigned ValNo = Record[Slot++];
+    unsigned ValNo = (unsigned)Record[Slot++];
     if (ValNo < InstNum) {
     if (ValNo < InstNum) {
       // If this is not a forward reference, just return the value we already
       // If this is not a forward reference, just return the value we already
       // have.
       // have.
@@ -164,14 +164,14 @@ private:
       return true;
       return true;
     }
     }
     
     
-    unsigned TypeNo = Record[Slot++];
+    unsigned TypeNo = (unsigned)Record[Slot++];
     ResVal = getFnValueByID(ValNo, getTypeByID(TypeNo));
     ResVal = getFnValueByID(ValNo, getTypeByID(TypeNo));
     return ResVal == 0;
     return ResVal == 0;
   }
   }
   bool getValue(SmallVector<uint64_t, 64> &Record, unsigned &Slot,
   bool getValue(SmallVector<uint64_t, 64> &Record, unsigned &Slot,
                 const Type *Ty, Value *&ResVal) {
                 const Type *Ty, Value *&ResVal) {
     if (Slot == Record.size()) return true;
     if (Slot == Record.size()) return true;
-    unsigned ValNo = Record[Slot++];
+    unsigned ValNo = (unsigned)Record[Slot++];
     ResVal = getFnValueByID(ValNo, Ty);
     ResVal = getFnValueByID(ValNo, Ty);
     return ResVal == 0;
     return ResVal == 0;
   }
   }