mirror of
https://github.com/postgres/postgres.git
synced 2025-12-19 17:02:53 +03:00
Mark function arguments of type "Datum *" as "const Datum *" where possible
Several functions in the codebase accept "Datum *" parameters but do not modify the pointed-to data. These have been updated to take "const Datum *" instead, improving type safety and making the interfaces clearer about their intent. This change helps the compiler catch accidental modifications and better documents immutability of arguments. Most of "Datum *" parameters have a pairing "bool *isnull" parameter, they are constified as well. No functional behavior is changed by this patch. Author: Chao Li <lic@highgo.com> Discussion: https://www.postgresql.org/message-id/flat/CAEoWx2msfT0knvzUa72ZBwu9LR_RLY4on85w2a9YpE-o2By5HQ@mail.gmail.com
This commit is contained in:
@@ -3555,8 +3555,8 @@ partition_rbound_cmp(int partnatts, FmgrInfo *partsupfunc,
|
||||
*/
|
||||
int32
|
||||
partition_rbound_datum_cmp(FmgrInfo *partsupfunc, Oid *partcollation,
|
||||
Datum *rb_datums, PartitionRangeDatumKind *rb_kind,
|
||||
Datum *tuple_datums, int n_tuple_datums)
|
||||
const Datum *rb_datums, PartitionRangeDatumKind *rb_kind,
|
||||
const Datum *tuple_datums, int n_tuple_datums)
|
||||
{
|
||||
int i;
|
||||
int32 cmpval = -1;
|
||||
@@ -3695,7 +3695,7 @@ partition_range_bsearch(int partnatts, FmgrInfo *partsupfunc,
|
||||
int
|
||||
partition_range_datum_bsearch(FmgrInfo *partsupfunc, Oid *partcollation,
|
||||
PartitionBoundInfo boundinfo,
|
||||
int nvalues, Datum *values, bool *is_equal)
|
||||
int nvalues, const Datum *values, bool *is_equal)
|
||||
{
|
||||
int lo,
|
||||
hi,
|
||||
|
||||
Reference in New Issue
Block a user