llvm.org GIT mirror llvm / 8ecbe8d
Mark constants as unsigned, as pointed out by icc warnings (#174). Patch by Erick Tryzelaar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81111 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan Sands 11 years ago
1 changed file(s) with 10 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
6262 // Provide DenseMapInfo for unsigned ints.
6363 template<> struct DenseMapInfo {
6464 static inline unsigned getEmptyKey() { return ~0; }
65 static inline unsigned getTombstoneKey() { return ~0 - 1; }
65 static inline unsigned getTombstoneKey() { return ~0U - 1; }
6666 static unsigned getHashValue(const unsigned& Val) { return Val * 37; }
6767 static bool isPod() { return true; }
6868 static bool isEqual(const unsigned& LHS, const unsigned& RHS) {
69 return LHS == RHS;
69 return LHS == RHS;
7070 }
7171 };
7272
7373 // Provide DenseMapInfo for unsigned longs.
7474 template<> struct DenseMapInfo {
75 static inline unsigned long getEmptyKey() { return ~0L; }
76 static inline unsigned long getTombstoneKey() { return ~0L - 1L; }
75 static inline unsigned long getEmptyKey() { return ~0UL; }
76 static inline unsigned long getTombstoneKey() { return ~0UL - 1L; }
7777 static unsigned getHashValue(const unsigned long& Val) {
78 return (unsigned)(Val * 37L);
78 return Val * 37UL;
7979 }
8080 static bool isPod() { return true; }
8181 static bool isEqual(const unsigned long& LHS, const unsigned long& RHS) {
82 return LHS == RHS;
82 return LHS == RHS;
8383 }
8484 };
8585
8686 // Provide DenseMapInfo for unsigned long longs.
8787 template<> struct DenseMapInfo {
88 static inline unsigned long long getEmptyKey() { return ~0LL; }
89 static inline unsigned long long getTombstoneKey() { return ~0LL - 1LL; }
88 static inline unsigned long long getEmptyKey() { return ~0ULL; }
89 static inline unsigned long long getTombstoneKey() { return ~0ULL - 1ULL; }
9090 static unsigned getHashValue(const unsigned long long& Val) {
91 return (unsigned)(Val * 37LL);
91 return Val * 37ULL;
9292 }
9393 static bool isPod() { return true; }
9494 static bool isEqual(const unsigned long long& LHS,
9595 const unsigned long long& RHS) {
96 return LHS == RHS;
96 return LHS == RHS;
9797 }
9898 };
9999