Bug 679832: In nsCheapSets, cast 32-bit value to intptr_t before converting it to 64-bit void*, to silence GCC 4.6 warning. r=bsmedberg

This commit is contained in:
Daniel Holbert 2012-01-11 12:45:55 -08:00
Родитель 528612b255
Коммит d83ace1a19
1 изменённых файлов: 10 добавлений и 1 удалений

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

@ -175,7 +175,16 @@ private:
/** Set the single integer */
void SetInt(PRInt32 aInt)
{
mValOrHash = (void*)((aInt << 1) | 0x1);
/**
* NOTE: on 64-bit GCC, we do an intermediate cast to (intptr_t) to fix
* build warning about converting 32-bit value to 64-bit pointer.
* This is GCC-only since some platforms/compilers lack "intptr_t".
*/
mValOrHash = (void*)
#if (defined(__GNUC__) && defined(__x86_64__))
(intptr_t)
#endif
((aInt << 1) | 0x1);
}
/** Create the hash and initialize */
nsresult InitHash(nsInt32HashSet** aSet);