diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/access/common/heaptuple.c | 8 | ||||
-rw-r--r-- | src/backend/access/hash/hashfunc.c | 4 | ||||
-rw-r--r-- | src/backend/port/hpux/tas.c.template | 2 | ||||
-rw-r--r-- | src/backend/storage/lmgr/lwlock.c | 4 | ||||
-rw-r--r-- | src/backend/utils/misc/guc.c | 5 |
5 files changed, 12 insertions, 11 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c index ac5749c7133..49164a06975 100644 --- a/src/backend/access/common/heaptuple.c +++ b/src/backend/access/common/heaptuple.c @@ -50,7 +50,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.127 2009/06/11 14:48:53 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.128 2009/12/31 19:41:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -192,7 +192,7 @@ heap_fill_tuple(TupleDesc tupleDesc, if (att[i]->attbyval) { /* pass-by-value */ - data = (char *) att_align_nominal((long) data, att[i]->attalign); + data = (char *) att_align_nominal(data, att[i]->attalign); store_att_byval(data, values[i], att[i]->attlen); data_length = att[i]->attlen; } @@ -226,7 +226,7 @@ heap_fill_tuple(TupleDesc tupleDesc, else { /* full 4-byte header varlena */ - data = (char *) att_align_nominal((long) data, + data = (char *) att_align_nominal(data, att[i]->attalign); data_length = VARSIZE(val); memcpy(data, val, data_length); @@ -243,7 +243,7 @@ heap_fill_tuple(TupleDesc tupleDesc, else { /* fixed-length pass-by-reference */ - data = (char *) att_align_nominal((long) data, att[i]->attalign); + data = (char *) att_align_nominal(data, att[i]->attalign); Assert(att[i]->attlen > 0); data_length = att[i]->attlen; memcpy(data, DatumGetPointer(values[i]), data_length); diff --git a/src/backend/access/hash/hashfunc.c b/src/backend/access/hash/hashfunc.c index 3242e2713ea..167d5c97ca5 100644 --- a/src/backend/access/hash/hashfunc.c +++ b/src/backend/access/hash/hashfunc.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/hash/hashfunc.c,v 1.59 2009/06/11 14:48:53 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/hash/hashfunc.c,v 1.60 2009/12/31 19:41:33 tgl Exp $ * * NOTES * These functions are stored in pg_amproc. For each operator class @@ -319,7 +319,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 (((long) k & UINT32_ALIGN_MASK) == 0) + if (((intptr_t) k & UINT32_ALIGN_MASK) == 0) { /* Code path for aligned source data */ register const uint32 *ka = (const uint32 *) k; diff --git a/src/backend/port/hpux/tas.c.template b/src/backend/port/hpux/tas.c.template index 45782948df6..5ccbbcde9aa 100644 --- a/src/backend/port/hpux/tas.c.template +++ b/src/backend/port/hpux/tas.c.template @@ -20,7 +20,7 @@ tas(lock) * LDCWX requires that we align the "semaphore" to a 16-byte * boundary. The actual datum is a single word (4 bytes). */ - lock = ((long) lock + 15) & ~15; + lock = ((uintptr_t) lock + 15) & ~15; /* * The LDCWX instruction atomically clears the target word and diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index b92ee50c0dd..920f3a6b523 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -15,7 +15,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.53 2009/01/01 17:23:48 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/storage/lmgr/lwlock.c,v 1.54 2009/12/31 19:41:34 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -245,7 +245,7 @@ CreateLWLocks(void) ptr += 2 * sizeof(int); /* Ensure desired alignment of LWLock array */ - ptr += LWLOCK_PADDED_SIZE - ((unsigned long) ptr) % LWLOCK_PADDED_SIZE; + ptr += LWLOCK_PADDED_SIZE - ((uintptr_t) ptr) % LWLOCK_PADDED_SIZE; LWLockArray = (LWLockPadded *) ptr; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 626983d8bd4..8b38e8d00f2 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -10,7 +10,7 @@ * Written by Peter Eisentraut <peter_e@gmx.net>. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.529 2009/12/21 01:34:11 rhaas Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.530 2009/12/31 19:41:34 tgl Exp $ * *-------------------------------------------------------------------- */ @@ -87,7 +87,8 @@ #endif /* upper limit for GUC variables measured in kilobytes of memory */ -#if SIZEOF_SIZE_T > 4 +/* note that various places assume the byte size fits in a "long" variable */ +#if SIZEOF_SIZE_T > 4 && SIZEOF_LONG > 4 #define MAX_KILOBYTES INT_MAX #else #define MAX_KILOBYTES (INT_MAX / 1024) |