Add some const decorations (htup.h)
authorPeter Eisentraut <[email protected]>
Thu, 23 Jan 2025 11:07:38 +0000 (12:07 +0100)
committerPeter Eisentraut <[email protected]>
Thu, 23 Jan 2025 11:12:08 +0000 (12:12 +0100)
Discussion: https://www.postgresql.org/message-id/flat/5b558da8-99fb-0a99-83dd-f72f05388517@enterprisedb.com

src/backend/access/heap/heapam.c
src/backend/utils/time/combocid.c
src/include/access/htup.h

index b6349950294b22b15104d6fb39472cdf1444af14..d0515a180d68ad8187cf3011438c7efcd56fda23 100644 (file)
@@ -7437,10 +7437,10 @@ MultiXactIdGetUpdateXid(TransactionId xmax, uint16 t_infomask)
  * checking the hint bits.
  */
 TransactionId
-HeapTupleGetUpdateXid(HeapTupleHeader tuple)
+HeapTupleGetUpdateXid(const HeapTupleHeaderData *tup)
 {
-   return MultiXactIdGetUpdateXid(HeapTupleHeaderGetRawXmax(tuple),
-                                  tuple->t_infomask);
+   return MultiXactIdGetUpdateXid(HeapTupleHeaderGetRawXmax(tup),
+                                  tup->t_infomask);
 }
 
 /*
index 13b3927191eace372cf7781b2f720606a5d6ab53..1e815571570901479dde6b7f9f99a8949772d754 100644 (file)
@@ -101,7 +101,7 @@ static CommandId GetRealCmax(CommandId combocid);
  */
 
 CommandId
-HeapTupleHeaderGetCmin(HeapTupleHeader tup)
+HeapTupleHeaderGetCmin(const HeapTupleHeaderData *tup)
 {
    CommandId   cid = HeapTupleHeaderGetRawCommandId(tup);
 
@@ -115,7 +115,7 @@ HeapTupleHeaderGetCmin(HeapTupleHeader tup)
 }
 
 CommandId
-HeapTupleHeaderGetCmax(HeapTupleHeader tup)
+HeapTupleHeaderGetCmax(const HeapTupleHeaderData *tup)
 {
    CommandId   cid = HeapTupleHeaderGetRawCommandId(tup);
 
@@ -150,7 +150,7 @@ HeapTupleHeaderGetCmax(HeapTupleHeader tup)
  * changes the tuple in shared buffers.
  */
 void
-HeapTupleHeaderAdjustCmax(HeapTupleHeader tup,
+HeapTupleHeaderAdjustCmax(const HeapTupleHeaderData *tup,
                          CommandId *cmax,
                          bool *iscombo)
 {
index aeb09713d547e94b6305032a8c6546960510d7b0..f0e3aa87dc306d472f34eaa6740cb7d10e8e67b6 100644 (file)
@@ -78,12 +78,12 @@ typedef HeapTupleData *HeapTuple;
 #define HeapTupleIsValid(tuple) PointerIsValid(tuple)
 
 /* HeapTupleHeader functions implemented in utils/time/combocid.c */
-extern CommandId HeapTupleHeaderGetCmin(HeapTupleHeader tup);
-extern CommandId HeapTupleHeaderGetCmax(HeapTupleHeader tup);
-extern void HeapTupleHeaderAdjustCmax(HeapTupleHeader tup,
+extern CommandId HeapTupleHeaderGetCmin(const HeapTupleHeaderData *tup);
+extern CommandId HeapTupleHeaderGetCmax(const HeapTupleHeaderData *tup);
+extern void HeapTupleHeaderAdjustCmax(const HeapTupleHeaderData *tup,
                                      CommandId *cmax, bool *iscombo);
 
 /*  for HeapTupleHeader accessors in heapam.c */
-extern TransactionId HeapTupleGetUpdateXid(HeapTupleHeader tuple);
+extern TransactionId HeapTupleGetUpdateXid(const HeapTupleHeaderData *tup);
 
 #endif                         /* HTUP_H */