Re: get rid of Pointer type, mostly

From: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, David Geier <geidav(dot)pg(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: get rid of Pointer type, mostly
Date: 2025-11-24 20:08:46
Message-ID: 87jyzf6vn5.fsf@wibble.ilmari.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Mon, Nov 24, 2025 at 1:46 PM David Geier <geidav(dot)pg(at)gmail(dot)com> wrote:
>>> The GIN code makes use of pointer but src/backend/access/gin only has 29
>>> occurrences. If you like I can help out fixing up the GIN code and share
>>> a page here. Let me know.
>
>> I'd go for it! I mean, who knows whether your patch will be accepted?
>> But another pair of eyes couldn't hurt. It seems like we all agree
>> that a full removal of Pointer would be better than a partial removal;
>> it's just a question of whether we can get there without too much
>> other awkwardness.
>
> If there are actually places in GIN where using void* would be less
> readable than using Pointer, that would certainly be interesting
> information. Perhaps the patch would need to spend some effort
> on adding comments, not just mechanically replacing the typedef?

I got curious and did the replacement, and IMO there's no need for any
further commentary than what's already there. I did however take the
opportunity to get rid of some pointless casts (except the return value
of PG_GETARG_POINTER(), which seems to be de rigueur to redundantly
cast), and to convert a nearby char * that's only used for memcpy() to
void *.

- ilmari

Attachment Content-Type Size
0001-Convert-remaning-uses-of-Pointer-to-void.patch text/x-diff 20.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Geier 2025-11-24 20:20:14 Re: get rid of Pointer type, mostly
Previous Message Bruce Momjian 2025-11-24 20:00:01 Re: should we have a fast-path planning for OLTP starjoins?