@@ -2186,8 +2186,8 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid,
21862186 XLogRegisterBufData (0 , (char * ) & xlhdr , SizeOfHeapHeader );
21872187 /* PG73FORMAT: write bitmap [+ padding] [+ oid] + data */
21882188 XLogRegisterBufData (0 ,
2189- (char * ) heaptup -> t_data + offsetof( HeapTupleHeaderData , t_bits ) ,
2190- heaptup -> t_len - offsetof( HeapTupleHeaderData , t_bits ) );
2189+ (char * ) heaptup -> t_data + SizeofHeapTupleHeader ,
2190+ heaptup -> t_len - SizeofHeapTupleHeader );
21912191
21922192 recptr = XLogInsert (RM_HEAP_ID , info );
21932193
@@ -2460,9 +2460,9 @@ heap_multi_insert(Relation relation, HeapTuple *tuples, int ntuples,
24602460 tuphdr -> t_hoff = heaptup -> t_data -> t_hoff ;
24612461
24622462 /* write bitmap [+ padding] [+ oid] + data */
2463- datalen = heaptup -> t_len - offsetof( HeapTupleHeaderData , t_bits ) ;
2463+ datalen = heaptup -> t_len - SizeofHeapTupleHeader ;
24642464 memcpy (scratchptr ,
2465- (char * ) heaptup -> t_data + offsetof( HeapTupleHeaderData , t_bits ) ,
2465+ (char * ) heaptup -> t_data + SizeofHeapTupleHeader ,
24662466 datalen );
24672467 tuphdr -> datalen = datalen ;
24682468 scratchptr += datalen ;
@@ -2904,9 +2904,9 @@ heap_delete(Relation relation, ItemPointer tid,
29042904
29052905 XLogRegisterData ((char * ) & xlhdr , SizeOfHeapHeader );
29062906 XLogRegisterData ((char * ) old_key_tuple -> t_data
2907- + offsetof( HeapTupleHeaderData , t_bits ) ,
2907+ + SizeofHeapTupleHeader ,
29082908 old_key_tuple -> t_len
2909- - offsetof( HeapTupleHeaderData , t_bits ) );
2909+ - SizeofHeapTupleHeader );
29102910 }
29112911
29122912 recptr = XLogInsert (RM_HEAP_ID , XLOG_HEAP_DELETE );
@@ -6732,7 +6732,7 @@ log_heap_update(Relation reln, Buffer oldbuf,
67326732 xlhdr .t_infomask2 = newtup -> t_data -> t_infomask2 ;
67336733 xlhdr .t_infomask = newtup -> t_data -> t_infomask ;
67346734 xlhdr .t_hoff = newtup -> t_data -> t_hoff ;
6735- Assert (offsetof( HeapTupleHeaderData , t_bits ) + prefixlen + suffixlen <= newtup -> t_len );
6735+ Assert (SizeofHeapTupleHeader + prefixlen + suffixlen <= newtup -> t_len );
67366736
67376737 /*
67386738 * PG73FORMAT: write bitmap [+ padding] [+ oid] + data
@@ -6743,8 +6743,8 @@ log_heap_update(Relation reln, Buffer oldbuf,
67436743 if (prefixlen == 0 )
67446744 {
67456745 XLogRegisterBufData (0 ,
6746- ((char * ) newtup -> t_data ) + offsetof( HeapTupleHeaderData , t_bits ) ,
6747- newtup -> t_len - offsetof( HeapTupleHeaderData , t_bits ) - suffixlen );
6746+ ((char * ) newtup -> t_data ) + SizeofHeapTupleHeader ,
6747+ newtup -> t_len - SizeofHeapTupleHeader - suffixlen );
67486748 }
67496749 else
67506750 {
@@ -6753,11 +6753,11 @@ log_heap_update(Relation reln, Buffer oldbuf,
67536753 * two separate rdata entries.
67546754 */
67556755 /* bitmap [+ padding] [+ oid] */
6756- if (newtup -> t_data -> t_hoff - offsetof( HeapTupleHeaderData , t_bits ) > 0 )
6756+ if (newtup -> t_data -> t_hoff - SizeofHeapTupleHeader > 0 )
67576757 {
67586758 XLogRegisterBufData (0 ,
6759- ((char * ) newtup -> t_data ) + offsetof( HeapTupleHeaderData , t_bits ) ,
6760- newtup -> t_data -> t_hoff - offsetof( HeapTupleHeaderData , t_bits ) );
6759+ ((char * ) newtup -> t_data ) + SizeofHeapTupleHeader ,
6760+ newtup -> t_data -> t_hoff - SizeofHeapTupleHeader );
67616761 }
67626762
67636763 /* data after common prefix */
@@ -6777,8 +6777,8 @@ log_heap_update(Relation reln, Buffer oldbuf,
67776777 XLogRegisterData ((char * ) & xlhdr_idx , SizeOfHeapHeader );
67786778
67796779 /* PG73FORMAT: write bitmap [+ padding] [+ oid] + data */
6780- XLogRegisterData ((char * ) old_key_tuple -> t_data + offsetof( HeapTupleHeaderData , t_bits ) ,
6781- old_key_tuple -> t_len - offsetof( HeapTupleHeaderData , t_bits ) );
6780+ XLogRegisterData ((char * ) old_key_tuple -> t_data + SizeofHeapTupleHeader ,
6781+ old_key_tuple -> t_len - SizeofHeapTupleHeader );
67826782 }
67836783
67846784 recptr = XLogInsert (RM_HEAP_ID , info );
@@ -7351,7 +7351,7 @@ heap_xlog_insert(XLogReaderState *record)
73517351 xl_heap_insert * xlrec = (xl_heap_insert * ) XLogRecGetData (record );
73527352 Buffer buffer ;
73537353 Page page ;
7354- struct
7354+ union
73557355 {
73567356 HeapTupleHeaderData hdr ;
73577357 char data [MaxHeapTupleSize ];
@@ -7415,12 +7415,12 @@ heap_xlog_insert(XLogReaderState *record)
74157415 data += SizeOfHeapHeader ;
74167416
74177417 htup = & tbuf .hdr ;
7418- MemSet ((char * ) htup , 0 , sizeof ( HeapTupleHeaderData ) );
7418+ MemSet ((char * ) htup , 0 , SizeofHeapTupleHeader );
74197419 /* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */
7420- memcpy ((char * ) htup + offsetof( HeapTupleHeaderData , t_bits ) ,
7420+ memcpy ((char * ) htup + SizeofHeapTupleHeader ,
74217421 data ,
74227422 newlen );
7423- newlen += offsetof( HeapTupleHeaderData , t_bits ) ;
7423+ newlen += SizeofHeapTupleHeader ;
74247424 htup -> t_infomask2 = xlhdr .t_infomask2 ;
74257425 htup -> t_infomask = xlhdr .t_infomask ;
74267426 htup -> t_hoff = xlhdr .t_hoff ;
@@ -7469,7 +7469,7 @@ heap_xlog_multi_insert(XLogReaderState *record)
74697469 BlockNumber blkno ;
74707470 Buffer buffer ;
74717471 Page page ;
7472- struct
7472+ union
74737473 {
74747474 HeapTupleHeaderData hdr ;
74757475 char data [MaxHeapTupleSize ];
@@ -7548,14 +7548,14 @@ heap_xlog_multi_insert(XLogReaderState *record)
75487548 newlen = xlhdr -> datalen ;
75497549 Assert (newlen <= MaxHeapTupleSize );
75507550 htup = & tbuf .hdr ;
7551- MemSet ((char * ) htup , 0 , sizeof ( HeapTupleHeaderData ) );
7551+ MemSet ((char * ) htup , 0 , SizeofHeapTupleHeader );
75527552 /* PG73FORMAT: get bitmap [+ padding] [+ oid] + data */
7553- memcpy ((char * ) htup + offsetof( HeapTupleHeaderData , t_bits ) ,
7553+ memcpy ((char * ) htup + SizeofHeapTupleHeader ,
75547554 (char * ) tupdata ,
75557555 newlen );
75567556 tupdata += newlen ;
75577557
7558- newlen += offsetof( HeapTupleHeaderData , t_bits ) ;
7558+ newlen += SizeofHeapTupleHeader ;
75597559 htup -> t_infomask2 = xlhdr -> t_infomask2 ;
75607560 htup -> t_infomask = xlhdr -> t_infomask ;
75617561 htup -> t_hoff = xlhdr -> t_hoff ;
@@ -7618,7 +7618,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
76187618 uint16 prefixlen = 0 ,
76197619 suffixlen = 0 ;
76207620 char * newp ;
7621- struct
7621+ union
76227622 {
76237623 HeapTupleHeaderData hdr ;
76247624 char data [MaxHeapTupleSize ];
@@ -7780,19 +7780,19 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
77807780 Assert (tuplen <= MaxHeapTupleSize );
77817781
77827782 htup = & tbuf .hdr ;
7783- MemSet ((char * ) htup , 0 , sizeof ( HeapTupleHeaderData ) );
7783+ MemSet ((char * ) htup , 0 , SizeofHeapTupleHeader );
77847784
77857785 /*
77867786 * Reconstruct the new tuple using the prefix and/or suffix from the
77877787 * old tuple, and the data stored in the WAL record.
77887788 */
7789- newp = (char * ) htup + offsetof( HeapTupleHeaderData , t_bits ) ;
7789+ newp = (char * ) htup + SizeofHeapTupleHeader ;
77907790 if (prefixlen > 0 )
77917791 {
77927792 int len ;
77937793
77947794 /* copy bitmap [+ padding] [+ oid] from WAL record */
7795- len = xlhdr .t_hoff - offsetof( HeapTupleHeaderData , t_bits ) ;
7795+ len = xlhdr .t_hoff - SizeofHeapTupleHeader ;
77967796 memcpy (newp , recdata , len );
77977797 recdata += len ;
77987798 newp += len ;
@@ -7802,7 +7802,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
78027802 newp += prefixlen ;
78037803
78047804 /* copy new tuple data from WAL record */
7805- len = tuplen - (xlhdr .t_hoff - offsetof( HeapTupleHeaderData , t_bits ) );
7805+ len = tuplen - (xlhdr .t_hoff - SizeofHeapTupleHeader );
78067806 memcpy (newp , recdata , len );
78077807 recdata += len ;
78087808 newp += len ;
@@ -7823,7 +7823,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
78237823 if (suffixlen > 0 )
78247824 memcpy (newp , (char * ) oldtup .t_data + oldtup .t_len - suffixlen , suffixlen );
78257825
7826- newlen = offsetof( HeapTupleHeaderData , t_bits ) + tuplen + prefixlen + suffixlen ;
7826+ newlen = SizeofHeapTupleHeader + tuplen + prefixlen + suffixlen ;
78277827 htup -> t_infomask2 = xlhdr .t_infomask2 ;
78287828 htup -> t_infomask = xlhdr .t_infomask ;
78297829 htup -> t_hoff = xlhdr .t_hoff ;
0 commit comments