Bug 678051 - Fix c++0x initializer list error found by clang. r=nnethercote.

--HG--
extra : convert_revision : 55c10227eece4a02b593997eda3dedef39af7beb
This commit is contained in:
Rafael Ávila de Espíndola 2011-08-21 20:18:18 -07:00
Родитель c6add17d55
Коммит f387a0c914
1 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -197,14 +197,14 @@ namespace nanojit
# pragma intrinsic(_BitScanReverse)
// Returns the index of the most significant bit that is set.
static inline int msbSet32(uint32_t x) {
static inline unsigned msbSet32(uint32_t x) {
unsigned long idx;
_BitScanReverse(&idx, (unsigned long)(x | 1)); // the '| 1' ensures a 0 result when x==0
return idx;
}
// Returns the index of the least significant bit that is set.
static inline int lsbSet32(uint32_t x) {
static inline unsigned lsbSet32(uint32_t x) {
unsigned long idx;
_BitScanForward(&idx, (unsigned long)(x | 0x80000000)); // the '| 0x80000000' ensures a 0 result when x==0
return idx;
@ -217,25 +217,25 @@ namespace nanojit
# pragma intrinsic(_BitScanReverse64)
// Returns the index of the most significant bit that is set.
static inline int msbSet64(uint64_t x) {
static inline unsigned msbSet64(uint64_t x) {
unsigned long idx;
_BitScanReverse64(&idx, (unsigned __int64)(x | 1)); // the '| 1' ensures a 0 result when x==0
return idx;
}
// Returns the index of the least significant bit that is set.
static inline int lsbSet64(uint64_t x) {
static inline unsigned lsbSet64(uint64_t x) {
unsigned long idx;
_BitScanForward64(&idx, (unsigned __int64)(x | 0x8000000000000000LL)); // the '| 0x80000000' ensures a 0 result when x==0
return idx;
}
#else
// Returns the index of the most significant bit that is set.
static int msbSet64(uint64_t x) {
static unsigned msbSet64(uint64_t x) {
return (x & 0xffffffff00000000LL) ? msbSet32(uint32_t(x >> 32)) + 32 : msbSet32(uint32_t(x));
}
// Returns the index of the least significant bit that is set.
static int lsbSet64(uint64_t x) {
static unsigned lsbSet64(uint64_t x) {
return (x & 0x00000000ffffffffLL) ? lsbSet32(uint32_t(x)) : lsbSet32(uint32_t(x >> 32)) + 32;
}
#endif
@ -243,29 +243,29 @@ namespace nanojit
#elif (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
// Returns the index of the most significant bit that is set.
static inline int msbSet32(uint32_t x) {
static inline unsigned msbSet32(uint32_t x) {
return 31 - __builtin_clz(x | 1);
}
// Returns the index of the least significant bit that is set.
static inline int lsbSet32(uint32_t x) {
static inline unsigned lsbSet32(uint32_t x) {
return __builtin_ctz(x | 0x80000000);
}
// Returns the index of the most significant bit that is set.
static inline int msbSet64(uint64_t x) {
static inline unsigned msbSet64(uint64_t x) {
return 63 - __builtin_clzll(x | 1);
}
// Returns the index of the least significant bit that is set.
static inline int lsbSet64(uint64_t x) {
static inline unsigned lsbSet64(uint64_t x) {
return __builtin_ctzll(x | 0x8000000000000000LL);
}
#else
// Slow fall-back: return most significant bit set by searching iteratively.
static int msbSet32(uint32_t x) {
static unsigned msbSet32(uint32_t x) {
for (int i = 31; i >= 0; i--)
if ((1 << i) & x)
return i;
@ -273,7 +273,7 @@ namespace nanojit
}
// Slow fall-back: return least significant bit set by searching iteratively.
static int lsbSet32(uint32_t x) {
static unsigned lsbSet32(uint32_t x) {
for (int i = 0; i < 32; i++)
if ((1 << i) & x)
return i;
@ -281,7 +281,7 @@ namespace nanojit
}
// Slow fall-back: return most significant bit set by searching iteratively.
static int msbSet64(uint64_t x) {
static unsigned msbSet64(uint64_t x) {
for (int i = 63; i >= 0; i--)
if ((1LL << i) & x)
return i;
@ -289,7 +289,7 @@ namespace nanojit
}
// Slow fall-back: return least significant bit set by searching iteratively.
static int lsbSet64(uint64_t x) {
static unsigned lsbSet64(uint64_t x) {
for (int i = 0; i < 64; i++)
if ((1LL << i) & x)
return i;