Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit232720b

Browse files
committed
Fix incidental warnings from cpluspluscheck.
Remove use of "register" keyword in hashfn.c. It's obsolescentaccording to recent C++ compilers, and no modern C compiler paysmuch 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 parent5f11093 commit232720b

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(registerconstunsignedchar*k, registerintkeylen)
148+
hash_any(constunsignedchar*k,intkeylen)
149149
{
150-
registeruint32a,
150+
uint32a,
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-
registerconstuint32*ka= (constuint32*)k;
163+
constuint32*ka= (constuint32*)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(registerconstunsignedchar*k, registerintkeylen,
374+
hash_any_extended(constunsignedchar*k,intkeylen,
375375
uint64seed)
376376
{
377-
registeruint32a,
377+
uint32a,
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-
registerconstuint32*ka= (constuint32*)k;
403+
constuint32*ka= (constuint32*)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(uint32k)
614614
{
615-
registeruint32a,
615+
uint32a,
616616
b,
617617
c;
618618

@@ -633,7 +633,7 @@ hash_uint32(uint32 k)
633633
Datum
634634
hash_uint32_extended(uint32k,uint64seed)
635635
{
636-
registeruint32a,
636+
uint32a,
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
#defineEOH_HEADER_MAGIC (-1)
128128
#defineVARATT_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-
externDatumhash_any(registerconstunsignedchar*k, registerintkeylen);
24-
externDatumhash_any_extended(registerconstunsignedchar*k,
25-
registerintkeylen,uint64seed);
23+
externDatumhash_any(constunsignedchar*k,intkeylen);
24+
externDatumhash_any_extended(constunsignedchar*k,
25+
intkeylen,uint64seed);
2626
externDatumhash_uint32(uint32k);
2727
externDatumhash_uint32_extended(uint32k,uint64seed);
2828

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp