pgsql: Remove useless casts in format arguments

2025-12-08 Thread Peter Eisentraut
Remove useless casts in format arguments There were a number of useless casts in format arguments, either where the input to the cast was already in the right type, or seemingly uselessly casting between types instead of just using the right format placeholder to begin with. Reviewed-by: Bertrand

pgsql: Remove useless casts to Pointer

2025-12-02 Thread Peter Eisentraut
Remove useless casts to Pointer in arguments of memcpy() and memmove() calls Reviewed-by: Chao Li Reviewed-by: Bertrand Drouvot Discussion: https://www.postgresql.org/message-id/4154950a-47ae-4223-bd01-1235cc50e933%40eisentraut.org Branch -- master Details --- https://git.postgresql.

pgsql: Remove useless casts to (void *)

2025-11-21 Thread Peter Eisentraut
Remove useless casts to (void *) Their presence causes (small) risks of hiding actual type mismatches or silently discarding qualifiers. Some have been missed in 7f798aca1d5 and some are new ones along the same lines. Author: Bertrand Drouvot Discussion: https://www.postgresql.org/message-id/f

pgsql: Remove useless casts to (const void *)

2024-12-06 Thread Peter Eisentraut
Remove useless casts to (const void *) Similar to commit 7f798aca1d5, but I didn't think to look for "const" as well. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8743ea1b2eb3dfbb024f40e8d9952cd85596f552 Modified Files -- src/backend/storage/buffer/b

pgsql: Remove useless casts to (void *)

2024-11-28 Thread Peter Eisentraut
Remove useless casts to (void *) Many of them just seem to have been copied around for no real reason. Their presence causes (small) risks of hiding actual type mismatches or silently discarding qualifiers Discussion: https://www.postgresql.org/message-id/flat/461ea37c-8b58-43b4-9736-52884e862..

pgsql: Remove useless casts to (void *) in arguments of some system fun

2023-02-06 Thread Peter Eisentraut
Remove useless casts to (void *) in arguments of some system functions The affected functions are: bsearch, memcmp, memcpy, memset, memmove, qsort, repalloc Reviewed-by: Corey Huinker Discussion: https://www.postgresql.org/message-id/flat/fd9adf5d-b1aa-e82f-e4c7-263c30145807%40enterprisedb.com

pgsql: Remove useless casts to (void *) in hash_search() calls

2023-02-06 Thread Peter Eisentraut
Remove useless casts to (void *) in hash_search() calls Some of these appear to be leftovers from when hash_search() took a char * argument (changed in 5999e78fc45dcb91784b64b6e9ae43f4e4f68ca2). Since after this there is some more horizontal space available, do some light reformatting where suita

pgsql: Remove useless casts

2022-11-16 Thread Peter Eisentraut
Remove useless casts Maybe these are left from when PageGetItem() was a macro, but now they are clearly useless. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/d1cb4e9f92c3db5c8fb52ccd1d502c73ffcc47e0 Modified Files -- src/backend/access/heap/heapam.c

pgsql: Remove useless casts

2021-09-08 Thread Peter Eisentraut
Remove useless casts Casting the argument of strVal() to (Value *) is useless, since strVal() already does that. Most code didn't do that anyway; this was apparently just a style that snuck into certain files. Reviewed-by: Dagfinn Ilmari Mannsåker Reviewed-by: Kyotaro Horiguchi Discussion: ht

pgsql: Remove useless casts

2019-02-13 Thread Peter Eisentraut
Remove useless casts Some of these were uselessly casting away "const", some were just nearby, but they where all unnecessary anyway. Discussion: https://www.postgresql.org/message-id/flat/53a28052-f9f3-1808-fed9-460fd43035ab%402ndquadrant.com Branch -- master Details --- https://git.p