Skip to content

Commit 232720b

Browse files
committed
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
1 parent 5f11093 commit 232720b

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/backend/utils/hash/hashfn.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@
145145
* well mixed than c, however.
146146
*/
147147
Datum
148-
hash_any(register const unsigned char *k, register int keylen)
148+
hash_any(const unsigned char *k, int keylen)
149149
{
150-
register uint32 a,
150+
uint32 a,
151151
b,
152152
c,
153153
len;
@@ -160,7 +160,7 @@ hash_any(register const unsigned char *k, register int keylen)
160160
if (((uintptr_t) k & UINT32_ALIGN_MASK) == 0)
161161
{
162162
/* Code path for aligned source data */
163-
register const uint32 *ka = (const uint32 *) k;
163+
const uint32 *ka = (const uint32 *) k;
164164

165165
/* handle most of the key */
166166
while (len >= 12)
@@ -371,10 +371,10 @@ hash_any(register const unsigned char *k, register int keylen)
371371
* Returns a uint64 value. Otherwise similar to hash_any.
372372
*/
373373
Datum
374-
hash_any_extended(register const unsigned char *k, register int keylen,
374+
hash_any_extended(const unsigned char *k, int keylen,
375375
uint64 seed)
376376
{
377-
register uint32 a,
377+
uint32 a,
378378
b,
379379
c,
380380
len;
@@ -400,7 +400,7 @@ hash_any_extended(register const unsigned char *k, register int keylen,
400400
if (((uintptr_t) k & UINT32_ALIGN_MASK) == 0)
401401
{
402402
/* Code path for aligned source data */
403-
register const uint32 *ka = (const uint32 *) k;
403+
const uint32 *ka = (const uint32 *) k;
404404

405405
/* handle most of the key */
406406
while (len >= 12)
@@ -612,7 +612,7 @@ hash_any_extended(register const unsigned char *k, register int keylen,
612612
Datum
613613
hash_uint32(uint32 k)
614614
{
615-
register uint32 a,
615+
uint32 a,
616616
b,
617617
c;
618618

@@ -633,7 +633,7 @@ hash_uint32(uint32 k)
633633
Datum
634634
hash_uint32_extended(uint32 k, uint64 seed)
635635
{
636-
register uint32 a,
636+
uint32 a,
637637
b,
638638
c;
639639

src/include/utils/expandeddatum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct ExpandedObjectHeader
126126
*/
127127
#define EOH_HEADER_MAGIC (-1)
128128
#define VARATT_IS_EXPANDED_HEADER(PTR) \
129-
(((varattrib_4b *) (PTR))->va_4byte.va_header == EOH_HEADER_MAGIC)
129+
(((varattrib_4b *) (PTR))->va_4byte.va_header == (uint32) EOH_HEADER_MAGIC)
130130

131131
/*
132132
* Generic support functions for expanded objects.

src/include/utils/hashutils.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
(((v) >> 31) & UINT64CONST(0x100000001)))
2121

2222

23-
extern Datum hash_any(register const unsigned char *k, register int keylen);
24-
extern Datum hash_any_extended(register const unsigned char *k,
25-
register int keylen, uint64 seed);
23+
extern Datum hash_any(const unsigned char *k, int keylen);
24+
extern Datum hash_any_extended(const unsigned char *k,
25+
int keylen, uint64 seed);
2626
extern Datum hash_uint32(uint32 k);
2727
extern Datum hash_uint32_extended(uint32 k, uint64 seed);
2828

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy