mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	offsetof cleanup.
This commit is contained in:
		@@ -8,7 +8,7 @@
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * IDENTIFICATION
 | 
					 * IDENTIFICATION
 | 
				
			||||||
 *	  $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.42 1998/09/04 18:05:38 momjian Exp $
 | 
					 *	  $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.43 1998/09/04 18:21:10 momjian Exp $
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * NOTES
 | 
					 * NOTES
 | 
				
			||||||
 *	  The old interface functions have been converted to macros
 | 
					 *	  The old interface functions have been converted to macros
 | 
				
			||||||
@@ -809,7 +809,7 @@ heap_formtuple(TupleDesc tupleDescriptor,
 | 
				
			|||||||
	int			i;
 | 
						int			i;
 | 
				
			||||||
	int			numberOfAttributes = tupleDescriptor->natts;
 | 
						int			numberOfAttributes = tupleDescriptor->natts;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	len = offsetof(HeapTuple->t_bits);
 | 
						len = offsetof(HeapTupleData, t_bits);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (i = 0; i < numberOfAttributes && !hasnull; i++)
 | 
						for (i = 0; i < numberOfAttributes && !hasnull; i++)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
@@ -957,7 +957,7 @@ heap_addheader(uint32 natts,	/* max domain index */
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	AssertArg(natts > 0);
 | 
						AssertArg(natts > 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	len = offsetof(HeapTuple->t_bits);
 | 
						len = offsetof(HeapTupleData, t_bits);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hoff = len = DOUBLEALIGN(len);		/* be conservative */
 | 
						hoff = len = DOUBLEALIGN(len);		/* be conservative */
 | 
				
			||||||
	len += structlen;
 | 
						len += structlen;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,7 @@
 | 
				
			|||||||
 *
 | 
					 *
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * IDENTIFICATION
 | 
					 * IDENTIFICATION
 | 
				
			||||||
 *	  $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.39 1998/09/04 18:05:39 momjian Exp $
 | 
					 *	  $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.40 1998/09/04 18:21:11 momjian Exp $
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 *-------------------------------------------------------------------------
 | 
					 *-------------------------------------------------------------------------
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@@ -917,7 +917,7 @@ inv_wrold(LargeObjectDesc *obj_desc,
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
	ntup = inv_newtuple(obj_desc, newbuf, newpage, (char *) NULL, tupbytes);
 | 
						ntup = inv_newtuple(obj_desc, newbuf, newpage, (char *) NULL, tupbytes);
 | 
				
			||||||
	dptr = ((char *) ntup) + ntup->t_hoff -
 | 
						dptr = ((char *) ntup) + ntup->t_hoff -
 | 
				
			||||||
				(sizeof(HeapTupleData) - offsetof(HeapTupleData.t_bits)) +
 | 
									(sizeof(HeapTupleData) - offsetof(HeapTupleData, t_bits)) +
 | 
				
			||||||
				sizeof(int4)
 | 
									sizeof(int4)
 | 
				
			||||||
				+ sizeof(fsblock->vl_len);
 | 
									+ sizeof(fsblock->vl_len);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -998,7 +998,7 @@ inv_newtuple(LargeObjectDesc *obj_desc,
 | 
				
			|||||||
	char	   *attptr;
 | 
						char	   *attptr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* compute tuple size -- no nulls */
 | 
						/* compute tuple size -- no nulls */
 | 
				
			||||||
	hoff = offsetof(HeapTuple->t_bits);
 | 
						hoff = offsetof(HeapTupleData, t_bits);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* add in olastbyte, varlena.vl_len, varlena.vl_dat */
 | 
						/* add in olastbyte, varlena.vl_len, varlena.vl_dat */
 | 
				
			||||||
	tupsize = hoff + (2 * sizeof(int32)) + nwrite;
 | 
						tupsize = hoff + (2 * sizeof(int32)) + nwrite;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user