summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorNoah Misch2013-10-21 01:04:52 +0000
committerNoah Misch2013-10-21 01:04:52 +0000
commit709170b790c11b4012004a6baf11a0fc6ec950de (patch)
tree5194f18a7586d5612e3eb2b2cce06e4ecaf316ca /src/backend
parent713a9f210d5cf5d94cc420b01eef5183569402e0 (diff)
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.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/access/hash/hashfunc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/hash/hashfunc.c b/src/backend/access/hash/hashfunc.c
index d5992821933..cb3b7e92783 100644
--- a/src/backend/access/hash/hashfunc.c
+++ b/src/backend/access/hash/hashfunc.c
@@ -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;