From: | Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org> |
---|---|
To: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Remove useless casts to (char *) |
Date: | 2025-02-06 11:49:00 |
Message-ID: | 87seor2t03.fsf@wibble.ilmari.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi Peter,
I have only skimmed the patches, but one hunk jumped out at me:
Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c
> index 1bf27d93cfa..937a2b02a4f 100644
> --- a/src/backend/libpq/pqcomm.c
> +++ b/src/backend/libpq/pqcomm.c
> @@ -1368,7 +1368,7 @@ internal_flush_buffer(const char *buf, size_t *start, size_t *end)
> {
> int r;
>
> - r = secure_write(MyProcPort, (char *) bufptr, bufend - bufptr);
> + r = secure_write(MyProcPort, unconstify(char *, bufptr), bufend - bufptr);
>
> if (r <= 0)
> {
Insted of unconstify here, could we not make secure_write() (and
be_tls_write()) take the buffer pointer as const void *, like the
attached?
- ilmari
Attachment | Content-Type | Size |
---|---|---|
0001-Make-TLS-write-functions-buffe-arguments-pointers-to.txt | text/x-patch | 3.0 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Sutou Kouhei | 2025-02-06 12:06:31 | Re: Make COPY format extendable: Extract COPY TO format implementations |
Previous Message | Marcos Pegoraro | 2025-02-06 11:45:47 | Re: Better visualization of default values |