Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 34694ec

Browse files
committed
Convert macros to static inline functions (htup_details.h, itup.h)
Discussion: https://www.postgresql.org/message-id/flat/5b558da8-99fb-0a99-83dd-f72f05388517@enterprisedb.com
1 parent b15b8c5 commit 34694ec

File tree

3 files changed

+352
-226
lines changed

3 files changed

+352
-226
lines changed

contrib/pageinspect/heapfuncs.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@
4242
* was used to upgrade from an older version, tuples might still have an
4343
* oid. Seems worthwhile to display that.
4444
*/
45-
#define HeapTupleHeaderGetOidOld(tup) \
46-
( \
47-
((tup)->t_infomask & HEAP_HASOID_OLD) ? \
48-
*((Oid *) ((char *)(tup) + (tup)->t_hoff - sizeof(Oid))) \
49-
: \
50-
InvalidOid \
51-
)
45+
static inline Oid
46+
HeapTupleHeaderGetOidOld(const HeapTupleHeaderData *tup)
47+
{
48+
if (tup->t_infomask & HEAP_HASOID_OLD)
49+
return *((Oid *) ((char *) (tup) + (tup)->t_hoff - sizeof(Oid)));
50+
else
51+
return InvalidOid;
52+
}
5253

5354

5455
/*

0 commit comments

Comments
 (0)