summaryrefslogtreecommitdiff
path: root/src/backend/access/spgist
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-10-31 10:45:02 +0100
committerPeter Eisentraut <peter@eisentraut.org>2025-10-31 10:47:25 +0100
commit8a27d418f8fc08b62f371c1b167efbfbf0a2a24e (patch)
tree414b7c6d0f4813aadb4b80f41774131180fe867e /src/backend/access/spgist
parentaa4535307e3d432f44b4c76b8ffebc5a0789250c (diff)
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
Diffstat (limited to 'src/backend/access/spgist')
-rw-r--r--src/backend/access/spgist/spgdoinsert.c2
-rw-r--r--src/backend/access/spgist/spgtextproc.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/access/spgist/spgdoinsert.c b/src/backend/access/spgist/spgdoinsert.c
index 5d84141028d..4eadb518776 100644
--- a/src/backend/access/spgist/spgdoinsert.c
+++ b/src/backend/access/spgist/spgdoinsert.c
@@ -1908,7 +1908,7 @@ spgSplitNodeAction(Relation index, SpGistState *state,
*/
bool
spgdoinsert(Relation index, SpGistState *state,
- const ItemPointerData *heapPtr, Datum *datums, bool *isnulls)
+ const ItemPointerData *heapPtr, const Datum *datums, const bool *isnulls)
{
bool result = true;
TupleDesc leafDescriptor = state->leafTupDesc;
diff --git a/src/backend/access/spgist/spgtextproc.c b/src/backend/access/spgist/spgtextproc.c
index 73842655f08..91f4ab260c2 100644
--- a/src/backend/access/spgist/spgtextproc.c
+++ b/src/backend/access/spgist/spgtextproc.c
@@ -155,7 +155,7 @@ commonPrefix(const char *a, const char *b, int lena, int lenb)
* On success, *i gets the match location; on failure, it gets where to insert
*/
static bool
-searchChar(Datum *nodeLabels, int nNodes, int16 c, int *i)
+searchChar(const Datum *nodeLabels, int nNodes, int16 c, int *i)
{
int StopLow = 0,
StopHigh = nNodes;