From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
---|---|
To: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Remove useless casts to (char *) |
Date: | 2025-02-05 21:25:35 |
Message-ID: | fd1fcedb-3492-4fc8-9e3e-74b97f2db6c7@eisentraut.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
In the spirit of the recent patch set "Remove useless casts to (void *)"
[0], here is patch set that removes a bunch of apparently useless casts
to (char *).
There are two larger themes:
1) Various casts around string/memory functions such as strcpy() or
memcpy() that pretty much don't make any sense at all (at least
post-1989 I guess).
2) Using void * instead of char * for function arguments that deal with
binary data. The largest of these is XLogRegisterData() and
XLogRegisterBufData(), which were also mentioned in [0]. (similar past
patches: 2d4f1ba6cfc 1f605b82ba6 3b12e68a5c4 b9f0e54bc95)
The remaining (char *) casts are mostly related to signed/unsigned
conversion, controlling pointer arithmetic, and related to
palloc/malloc, (and probably some I missed or didn't want to touch) so
those are all ok to keep.
[0]:
https://www.postgresql.org/message-id/flat/461ea37c-8b58-43b4-9736-52884e862820%40eisentraut.org
Attachment | Content-Type | Size |
---|---|---|
0001-Remove-unnecessary-char-casts-string.patch | text/plain | 6.1 KB |
0002-Remove-unnecessary-char-casts-mem.patch | text/plain | 17.0 KB |
0003-Remove-unnecessary-char-casts-checksum.patch | text/plain | 3.0 KB |
0004-Remove-various-unnecessary-char-casts.patch | text/plain | 14.3 KB |
0005-backend-launchers-void-arguments-for-binary-data.patch | text/plain | 21.3 KB |
0006-backend-libpq-void-argument-for-binary-data.patch | text/plain | 6.2 KB |
0007-jsonb-internal-API-void-argument-for-binary-data.patch | text/plain | 4.4 KB |
0008-SnapBuildRestoreContents-void-argument-for-binary-da.patch | text/plain | 3.2 KB |
0009-XLogRegisterData-XLogRegisterBufData-void-argument-f.patch | text/plain | 3.9 KB |
0010-Remove-unnecessary-char-casts-xlog.patch | text/plain | 69.4 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Jelte Fennema-Nio | 2025-02-05 21:39:25 | Re: Windows CFBot is broken because ecpg dec_test.c error |
Previous Message | Marcos Pegoraro | 2025-02-05 21:07:13 | Better visualization of default values |