Commit 232720be authored by Tom Lane's avatar Tom Lane

Fix incidental warnings from cpluspluscheck.

Remove use of "register" keyword in hashfn.c.  It's obsolescent
according to recent C++ compilers, and no modern C compiler pays
much attention to it either.

Also fix one cosmetic warning about signed vs unsigned comparison.

Discussion: https://postgr.es/m/20518.1559494394@sss.pgh.pa.us
parent 5f110933
...@@ -145,9 +145,9 @@ ...@@ -145,9 +145,9 @@
* well mixed than c, however. * well mixed than c, however.
*/ */
Datum Datum
hash_any(register const unsigned char *k, register int keylen) hash_any(const unsigned char *k, int keylen)
{ {
register uint32 a, uint32 a,
b, b,
c, c,
len; len;
...@@ -160,7 +160,7 @@ hash_any(register const unsigned char *k, register int keylen) ...@@ -160,7 +160,7 @@ hash_any(register const unsigned char *k, register int keylen)
if (((uintptr_t) k & UINT32_ALIGN_MASK) == 0) if (((uintptr_t) k & UINT32_ALIGN_MASK) == 0)
{ {
/* Code path for aligned source data */ /* Code path for aligned source data */
register const uint32 *ka = (const uint32 *) k; const uint32 *ka = (const uint32 *) k;
/* handle most of the key */ /* handle most of the key */
while (len >= 12) while (len >= 12)
...@@ -371,10 +371,10 @@ hash_any(register const unsigned char *k, register int keylen) ...@@ -371,10 +371,10 @@ hash_any(register const unsigned char *k, register int keylen)
* Returns a uint64 value. Otherwise similar to hash_any. * Returns a uint64 value. Otherwise similar to hash_any.
*/ */
Datum Datum
hash_any_extended(register const unsigned char *k, register int keylen, hash_any_extended(const unsigned char *k, int keylen,
uint64 seed) uint64 seed)
{ {
register uint32 a, uint32 a,
b, b,
c, c,
len; len;
...@@ -400,7 +400,7 @@ hash_any_extended(register const unsigned char *k, register int keylen, ...@@ -400,7 +400,7 @@ hash_any_extended(register const unsigned char *k, register int keylen,
if (((uintptr_t) k & UINT32_ALIGN_MASK) == 0) if (((uintptr_t) k & UINT32_ALIGN_MASK) == 0)
{ {
/* Code path for aligned source data */ /* Code path for aligned source data */
register const uint32 *ka = (const uint32 *) k; const uint32 *ka = (const uint32 *) k;
/* handle most of the key */ /* handle most of the key */
while (len >= 12) while (len >= 12)
...@@ -612,7 +612,7 @@ hash_any_extended(register const unsigned char *k, register int keylen, ...@@ -612,7 +612,7 @@ hash_any_extended(register const unsigned char *k, register int keylen,
Datum Datum
hash_uint32(uint32 k) hash_uint32(uint32 k)
{ {
register uint32 a, uint32 a,
b, b,
c; c;
...@@ -633,7 +633,7 @@ hash_uint32(uint32 k) ...@@ -633,7 +633,7 @@ hash_uint32(uint32 k)
Datum Datum
hash_uint32_extended(uint32 k, uint64 seed) hash_uint32_extended(uint32 k, uint64 seed)
{ {
register uint32 a, uint32 a,
b, b,
c; c;
......
...@@ -126,7 +126,7 @@ struct ExpandedObjectHeader ...@@ -126,7 +126,7 @@ struct ExpandedObjectHeader
*/ */
#define EOH_HEADER_MAGIC (-1) #define EOH_HEADER_MAGIC (-1)
#define VARATT_IS_EXPANDED_HEADER(PTR) \ #define VARATT_IS_EXPANDED_HEADER(PTR) \
(((varattrib_4b *) (PTR))->va_4byte.va_header == EOH_HEADER_MAGIC) (((varattrib_4b *) (PTR))->va_4byte.va_header == (uint32) EOH_HEADER_MAGIC)
/* /*
* Generic support functions for expanded objects. * Generic support functions for expanded objects.
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
(((v) >> 31) & UINT64CONST(0x100000001))) (((v) >> 31) & UINT64CONST(0x100000001)))
extern Datum hash_any(register const unsigned char *k, register int keylen); extern Datum hash_any(const unsigned char *k, int keylen);
extern Datum hash_any_extended(register const unsigned char *k, extern Datum hash_any_extended(const unsigned char *k,
register int keylen, uint64 seed); int keylen, uint64 seed);
extern Datum hash_uint32(uint32 k); extern Datum hash_uint32(uint32 k);
extern Datum hash_uint32_extended(uint32 k, uint64 seed); extern Datum hash_uint32_extended(uint32 k, uint64 seed);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment