Remove traces of long in dynahash.c - Mailing list pgsql-hackers

From Michael Paquier
Subject Remove traces of long in dynahash.c
Date
Msg-id aKQYp-bKTRtRauZ6@paquier.xyz
Whole thread Raw
Responses Re: Remove traces of long in dynahash.c
Re: Remove traces of long in dynahash.c
List pgsql-hackers
Hi all,

While looking at the recent business with dynahash.c in [1], I have
been reminded of the fact that this code still depends on long.  Based
on my lookup of the code, I don't think that there is any issue with
the current uses, but I've never been a fan of using a type that's 8
byte everywhere except on WIN32, and we have been bitten by that in
the past depending on the code paths where long is used, even if WIN32
should be niche these days.

So I have looked at this file, and finished with the attached.  The
result is nice, removing long from hsearch.h, as well as dynahash.c,
cleaning up some variable declarations on the way.

While monitoring the callers of the function signatures updated in
this patch, there is a mix of Size, int or int32 used in the variable
declarations used with the callers.  There were a couple of long
declared in a couple of places like pgss, locking, predicate, shmem
that were declared as such to map with dynahash.  These can be
replaced.

Thoughts?

[1]: https://www.postgresql.org/message-id/aKF8mPDqgQb3uBjG@paquier.xyz
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Kirill Reshke
Date:
Subject: Re: VM corruption on standby
Next
From: Kirill Reshke
Date:
Subject: Re: VM corruption on standby