diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-05-05 18:30:58 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-05-05 18:30:58 +0000 |
commit | 34cd4a484e532cc463fd5a4bf59b88d13c5467c1 (patch) | |
tree | eefdfb1d225da0317e7f7912079c430b5c3ed92c /include/llvm/ADT/BitVector.h | |
parent | b61bfdb56e1c018f10a2c1c9fb49d7e2a78ed24e (diff) |
Fix more -Wshorten-64-to-32 warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/BitVector.h')
-rw-r--r-- | include/llvm/ADT/BitVector.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/llvm/ADT/BitVector.h b/include/llvm/ADT/BitVector.h index a3a8920186..fccb1c6e8a 100644 --- a/include/llvm/ADT/BitVector.h +++ b/include/llvm/ADT/BitVector.h @@ -25,7 +25,7 @@ namespace llvm { class BitVector { typedef unsigned long BitWord; - enum { BITWORD_SIZE = sizeof(BitWord) * 8 }; + enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * 8 }; BitWord *Bits; // Actual bits. unsigned Size; // Size of bitvector in bits. @@ -103,7 +103,7 @@ public: unsigned NumBits = 0; for (unsigned i = 0; i < NumBitWords(size()); ++i) if (sizeof(BitWord) == 4) - NumBits += CountPopulation_32(Bits[i]); + NumBits += CountPopulation_32((uint32_t)Bits[i]); else if (sizeof(BitWord) == 8) NumBits += CountPopulation_64(Bits[i]); else @@ -130,7 +130,7 @@ public: for (unsigned i = 0; i < NumBitWords(size()); ++i) if (Bits[i] != 0) { if (sizeof(BitWord) == 4) - return i * BITWORD_SIZE + CountTrailingZeros_32(Bits[i]); + return i * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Bits[i]); else if (sizeof(BitWord) == 8) return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]); else @@ -154,7 +154,7 @@ public: if (Copy != 0) { if (sizeof(BitWord) == 4) - return WordPos * BITWORD_SIZE + CountTrailingZeros_32(Copy); + return WordPos * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Copy); else if (sizeof(BitWord) == 8) return WordPos * BITWORD_SIZE + CountTrailingZeros_64(Copy); else @@ -165,7 +165,7 @@ public: for (unsigned i = WordPos+1; i < NumBitWords(size()); ++i) if (Bits[i] != 0) { if (sizeof(BitWord) == 4) - return i * BITWORD_SIZE + CountTrailingZeros_32(Bits[i]); + return i * BITWORD_SIZE + CountTrailingZeros_32((uint32_t)Bits[i]); else if (sizeof(BitWord) == 8) return i * BITWORD_SIZE + CountTrailingZeros_64(Bits[i]); else |