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

Commit2579985

Browse files
committed
Fix warnings in cpluspluscheck
Various int variables were compared to macros that are of type size_t,which caused -Wsign-compare warnings in cpluspluscheck. Change thoseto size_t, which also better describes their purpose.Per report from Peter EisentrautDiscussion:https://postgr.es/m/486847dc-6de5-464a-938e-bac98ec2438b%40eisentraut.org
1 parenta4012a6 commit2579985

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

‎src/include/common/hashfn_unstable.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ fasthash_combine(fasthash_state *hs)
138138

139139
/* accumulate up to 8 bytes of input and combine it into the hash */
140140
staticinlinevoid
141-
fasthash_accum(fasthash_state*hs,constchar*k,intlen)
141+
fasthash_accum(fasthash_state*hs,constchar*k,size_tlen)
142142
{
143143
uint32lower_four;
144144

@@ -189,14 +189,14 @@ fasthash_accum(fasthash_state *hs, const char *k, int len)
189189
/*
190190
* all-purpose workhorse for fasthash_accum_cstring
191191
*/
192-
staticinlineint
192+
staticinlinesize_t
193193
fasthash_accum_cstring_unaligned(fasthash_state*hs,constchar*str)
194194
{
195195
constchar*conststart=str;
196196

197197
while (*str)
198198
{
199-
intchunk_len=0;
199+
size_tchunk_len=0;
200200

201201
while (chunk_len<FH_SIZEOF_ACCUM&&str[chunk_len]!='\0')
202202
chunk_len++;
@@ -215,11 +215,11 @@ fasthash_accum_cstring_unaligned(fasthash_state *hs, const char *str)
215215
* Loading the word containing the NUL terminator cannot segfault since
216216
* allocation boundaries are suitably aligned.
217217
*/
218-
staticinlineint
218+
staticinlinesize_t
219219
fasthash_accum_cstring_aligned(fasthash_state*hs,constchar*str)
220220
{
221221
constchar*conststart=str;
222-
intremainder;
222+
size_tremainder;
223223
uint64zero_byte_low;
224224

225225
Assert(PointerIsAligned(start,uint64));
@@ -269,14 +269,14 @@ fasthash_accum_cstring_aligned(fasthash_state *hs, const char *str)
269269
/*
270270
* Mix 'str' into the hash state and return the length of the string.
271271
*/
272-
staticinlineint
272+
staticinlinesize_t
273273
fasthash_accum_cstring(fasthash_state*hs,constchar*str)
274274
{
275275
#ifSIZEOF_VOID_P >=8
276276

277-
intlen;
277+
size_tlen;
278278
#ifdefUSE_ASSERT_CHECKING
279-
intlen_check;
279+
size_tlen_check;
280280
fasthash_statehs_check;
281281

282282
memcpy(&hs_check,hs,sizeof(fasthash_state));
@@ -340,7 +340,7 @@ fasthash_final32(fasthash_state *hs, uint64 tweak)
340340
* 'seed' can be zero.
341341
*/
342342
staticinlineuint64
343-
fasthash64(constchar*k,intlen,uint64seed)
343+
fasthash64(constchar*k,size_tlen,uint64seed)
344344
{
345345
fasthash_statehs;
346346

@@ -362,7 +362,7 @@ fasthash64(const char *k, int len, uint64 seed)
362362

363363
/* like fasthash64, but returns a 32-bit hashcode */
364364
staticinlineuint64
365-
fasthash32(constchar*k,intlen,uint64seed)
365+
fasthash32(constchar*k,size_tlen,uint64seed)
366366
{
367367
returnfasthash_reduce32(fasthash64(k,len,seed));
368368
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp