mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Consistently use unsigned arithmetic for alignment calculations.
This avoids an assumption about the signed number representation. It is anticipated to have no functional changes on supported configurations; many two's complement assumptions remain elsewhere. Per a suggestion from Andres Freund.
This commit is contained in:
@@ -314,7 +314,7 @@ hash_any(register const unsigned char *k, register int keylen)
|
||||
a = b = c = 0x9e3779b9 + len + 3923095;
|
||||
|
||||
/* If the source pointer is word-aligned, we use word-wide fetches */
|
||||
if (((intptr_t) k & UINT32_ALIGN_MASK) == 0)
|
||||
if (((uintptr_t) k & UINT32_ALIGN_MASK) == 0)
|
||||
{
|
||||
/* Code path for aligned source data */
|
||||
register const uint32 *ka = (const uint32 *) k;
|
||||
|
Reference in New Issue
Block a user