agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
[PATCH v4 7/8] Use anonymous files to back shared memory segments
888+ messages / 2 participants
[nested] [flat]

* [PATCH v4 7/8] Use anonymous files to back shared memory segments
@ 2025-03-15 15:39 Dmitrii Dolgov <9erthalion6@gmail.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Dmitrii Dolgov @ 2025-03-15 15:39 UTC (permalink / raw)

Allow to use anonymous files for shared memory, instead of plain
anonymous memory. Such an anonymous file is created via memfd_create, it
lives in memory, behaves like a regular file and semantically equivalent
to an anonymous memory allocated via mmap with MAP_ANONYMOUS.

Advantages of using anon files are following:

* We've got a file descriptor, which could be used for regular file
  operations (modification, truncation, you name it).

* The file could be given a name, which improves readability when it
  comes to process maps. Here is how it looks like

7f90cde00000-7f90d5126000 rw-s 00000000 00:01 5463 /memfd:main (deleted)
7f90d5126000-7f914de00000 ---p 00000000 00:00 0
7f914de00000-7f9175128000 rw-s 00000000 00:01 5466 /memfd:buffers (deleted)
7f9175128000-7f944de00000 ---p 00000000 00:00 0
7f944de00000-7f9455528000 rw-s 00000000 00:01 5469 /memfd:descriptors (deleted)
7f9455528000-7f94cde00000 ---p 00000000 00:00 0
7f94cde00000-7f94d5228000 rw-s 00000000 00:01 5472 /memfd:iocv (deleted)
7f94d5228000-7f954de00000 ---p 00000000 00:00 0
7f954de00000-7f9555266000 rw-s 00000000 00:01 5475 /memfd:checkpoint (deleted)
7f9555266000-7f958de00000 ---p 00000000 00:00 0
7f958de00000-7f95954aa000 rw-s 00000000 00:01 5478 /memfd:strategy (deleted)
7f95954aa000-7f95cde00000 ---p 00000000 00:00 0

* By default, Linux will not add file-backed shared mappings into a core dump,
  making it more convenient to work with them in PostgreSQL: no more huge dumps
  to process.

The downside is that memfd_create is Linux specific.
---
 src/backend/port/sysv_shmem.c  | 73 +++++++++++++++++++++++++++++-----
 src/backend/port/win32_shmem.c |  2 +-
 src/backend/storage/ipc/ipci.c |  2 +-
 src/include/portability/mem.h  |  2 +-
 src/include/storage/pg_shmem.h |  3 +-
 5 files changed, 68 insertions(+), 14 deletions(-)

diff --git a/src/backend/port/sysv_shmem.c b/src/backend/port/sysv_shmem.c
index a3437973784..87000a24eea 100644
--- a/src/backend/port/sysv_shmem.c
+++ b/src/backend/port/sysv_shmem.c
@@ -107,6 +107,7 @@ typedef struct AnonymousMapping
 	Pointer shmem; 				/* Pointer to the start of the mapped memory */
 	Pointer seg_addr; 			/* SysV shared memory for the header */
 	unsigned long seg_id; 		/* IPC key */
+	int segment_fd; 			/* fd for the backing anon file */
 } AnonymousMapping;
 
 static AnonymousMapping Mappings[ANON_MAPPINGS];
@@ -127,7 +128,7 @@ static int next_free_segment = 0;
  * 00400000-00490000         /path/bin/postgres
  * ...
  * 012d9000-0133e000         [heap]
- * 7f443a800000-7f470a800000 /dev/zero (deleted)
+ * 7f443a800000-7f470a800000 /memfd:main (deleted)
  * 7f470a800000-7f471831d000 /usr/lib/locale/locale-archive
  * 7f4718400000-7f4718401000 /usr/lib64/libicudata.so.74.2
  * ...
@@ -150,9 +151,9 @@ static int next_free_segment = 0;
  * The result would look like this:
  *
  * 012d9000-0133e000         [heap]
- * 7f4426f54000-7f442e010000 /dev/zero (deleted)
+ * 7f4426f54000-7f442e010000 /memfd:main (deleted)
  * 7f442e010000-7f443a800000                     # reserved empty space
- * 7f443a800000-7f444196c000 /dev/zero (deleted)
+ * 7f443a800000-7f444196c000 /memfd:buffers (deleted)
  * 7f444196c000-7f470a800000                     # reserved empty space
  * 7f470a800000-7f471831d000 /usr/lib/locale/locale-archive
  * 7f4718400000-7f4718401000 /usr/lib64/libicudata.so.74.2
@@ -643,13 +644,14 @@ PGSharedMemoryAttach(IpcMemoryId shmId,
  * *hugepagesize and *mmap_flags are set to 0.
  */
 void
-GetHugePageSize(Size *hugepagesize, int *mmap_flags)
+GetHugePageSize(Size *hugepagesize, int *mmap_flags, int *memfd_flags)
 {
 #ifdef MAP_HUGETLB
 
 	Size		default_hugepagesize = 0;
 	Size		hugepagesize_local = 0;
 	int			mmap_flags_local = 0;
+	int			memfd_flags_local = 0;
 
 	/*
 	 * System-dependent code to find out the default huge page size.
@@ -708,6 +710,7 @@ GetHugePageSize(Size *hugepagesize, int *mmap_flags)
 	}
 
 	mmap_flags_local = MAP_HUGETLB;
+	memfd_flags_local = MFD_HUGETLB;
 
 	/*
 	 * On recent enough Linux, also include the explicit page size, if
@@ -718,7 +721,16 @@ GetHugePageSize(Size *hugepagesize, int *mmap_flags)
 	{
 		int			shift = pg_ceil_log2_64(hugepagesize_local);
 
-		mmap_flags_local |= (shift & MAP_HUGE_MASK) << MAP_HUGE_SHIFT;
+		memfd_flags_local |= (shift & MAP_HUGE_MASK) << MAP_HUGE_SHIFT;
+	}
+#endif
+
+#if defined(MFD_HUGE_MASK) && defined(MFD_HUGE_SHIFT)
+	if (hugepagesize_local != default_hugepagesize)
+	{
+		int			shift = pg_ceil_log2_64(hugepagesize_local);
+
+		memfd_flags_local |= (shift & MAP_HUGE_MASK) << MAP_HUGE_SHIFT;
 	}
 #endif
 
@@ -727,6 +739,8 @@ GetHugePageSize(Size *hugepagesize, int *mmap_flags)
 		*mmap_flags = mmap_flags_local;
 	if (hugepagesize)
 		*hugepagesize = hugepagesize_local;
+	if (memfd_flags)
+		*memfd_flags = memfd_flags_local;
 
 #else
 
@@ -734,6 +748,8 @@ GetHugePageSize(Size *hugepagesize, int *mmap_flags)
 		*hugepagesize = 0;
 	if (mmap_flags)
 		*mmap_flags = 0;
+	if (memfd_flags)
+		*memfd_flags = 0;
 
 #endif							/* MAP_HUGETLB */
 }
@@ -771,7 +787,7 @@ CreateAnonymousSegment(AnonymousMapping *mapping, Pointer base)
 	Size		allocsize = mapping->shmem_size;
 	void	   *ptr = MAP_FAILED;
 	int			mmap_errno = 0;
-	int			mmap_flags = PG_MMAP_FLAGS;
+	int			mmap_flags = PG_MMAP_FLAGS, memfd_flags = 0;
 
 #ifndef MAP_HUGETLB
 	/* ReserveAnonymousMemory should have dealt with this case */
@@ -785,7 +801,7 @@ CreateAnonymousSegment(AnonymousMapping *mapping, Pointer base)
 		Assert(huge_pages == HUGE_PAGES_ON || huge_pages == HUGE_PAGES_TRY);
 
 		/* Round up the request size to a suitable large value */
-		GetHugePageSize(&hugepagesize, &mmap_flags);
+		GetHugePageSize(&hugepagesize, &mmap_flags, &memfd_flags);
 
 		if (allocsize % hugepagesize != 0)
 			allocsize += hugepagesize - (allocsize % hugepagesize);
@@ -794,6 +810,29 @@ CreateAnonymousSegment(AnonymousMapping *mapping, Pointer base)
 	}
 #endif
 
+	/*
+	 * Prepare an anonymous file backing the segment. Its size will be
+	 * specified later via ftruncate.
+	 *
+	 * The file behaves like a regular file, but lives in memory. Once all
+	 * references to the file are dropped,  it is automatically released.
+	 * Anonymous memory is used for all backing pages of the file, thus it has
+	 * the same semantics as anonymous memory allocations using mmap with the
+	 * MAP_ANONYMOUS flag.
+	 */
+	mapping->segment_fd = memfd_create(MappingName(mapping->shmem_segment),
+									   memfd_flags);
+
+	/*
+	 * Specify the segment file size using allocsize, which contains
+	 * potentially modified size.
+	 */
+	if(ftruncate(mapping->segment_fd, allocsize) == -1)
+		ereport(FATAL,
+				(errcode(ERRCODE_SYSTEM_ERROR),
+				 errmsg("could not truncase anonymous file for \"%s\": %m",
+						MappingName(mapping->shmem_segment))));
+
 	elog(DEBUG1, "segment[%s]: mmap(%zu) at address %p",
 		 MappingName(mapping->shmem_segment), allocsize, base + reserved_offset);
 
@@ -807,7 +846,7 @@ CreateAnonymousSegment(AnonymousMapping *mapping, Pointer base)
 	 * a restart.
 	 */
 	ptr = mmap(base + reserved_offset, allocsize, PROT_READ | PROT_WRITE,
-			   mmap_flags | MAP_FIXED, -1, 0);
+			   mmap_flags | MAP_FIXED, mapping->segment_fd, 0);
 	mmap_errno = errno;
 
 	if (ptr == MAP_FAILED)
@@ -817,8 +856,15 @@ CreateAnonymousSegment(AnonymousMapping *mapping, Pointer base)
 					 "fallback to the non-resizable allocation",
 			 MappingName(mapping->shmem_segment), allocsize, base + reserved_offset);
 
+		/* Specify the segment file size using allocsize. */
+		if(ftruncate(mapping->segment_fd, allocsize) == -1)
+			ereport(FATAL,
+					(errcode(ERRCODE_SYSTEM_ERROR),
+					 errmsg("could not truncase anonymous file for \"%s\": %m",
+							MappingName(mapping->shmem_segment))));
+
 		ptr = mmap(NULL, allocsize, PROT_READ | PROT_WRITE,
-						   PG_MMAP_FLAGS, -1, 0);
+						   PG_MMAP_FLAGS, mapping->segment_fd, 0);
 		mmap_errno = errno;
 	}
 	else
@@ -889,7 +935,7 @@ ReserveAnonymousMemory(Size reserve_size)
 		Size		hugepagesize, total_size = 0;
 		int			mmap_flags;
 
-		GetHugePageSize(&hugepagesize, &mmap_flags);
+		GetHugePageSize(&hugepagesize, &mmap_flags, NULL);
 
 		/*
 		 * Figure out how much memory is needed for all segments, keeping in
@@ -1070,6 +1116,13 @@ AnonymousShmemResize(void)
 		if (m->shmem_size == new_size)
 			continue;
 
+		/* Resize the backing anon file. */
+		if(ftruncate(m->segment_fd, new_size) == -1)
+			ereport(FATAL,
+					(errcode(ERRCODE_SYSTEM_ERROR),
+					 errmsg("could not truncase anonymous file for \"%s\": %m",
+							MappingName(m->shmem_segment))));
+
 		/* Clean up some reserved space to resize into */
 		if (munmap(m->shmem + m->shmem_size, new_size - m->shmem_size) == -1)
 			ereport(FATAL,
diff --git a/src/backend/port/win32_shmem.c b/src/backend/port/win32_shmem.c
index ce719f1b412..ba972106de1 100644
--- a/src/backend/port/win32_shmem.c
+++ b/src/backend/port/win32_shmem.c
@@ -627,7 +627,7 @@ pgwin32_ReserveSharedMemoryRegion(HANDLE hChild)
  * use GetLargePageMinimum() instead.
  */
 void
-GetHugePageSize(Size *hugepagesize, int *mmap_flags)
+GetHugePageSize(Size *hugepagesize, int *mmap_flags, int *memfd_flags)
 {
 	if (hugepagesize)
 		*hugepagesize = 0;
diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c
index abeb91e24fd..dc2b4becf4a 100644
--- a/src/backend/storage/ipc/ipci.c
+++ b/src/backend/storage/ipc/ipci.c
@@ -396,7 +396,7 @@ InitializeShmemGUCs(void)
 	/*
 	 * Calculate the number of huge pages required.
 	 */
-	GetHugePageSize(&hp_size, NULL);
+	GetHugePageSize(&hp_size, NULL, NULL);
 	if (hp_size != 0)
 	{
 		Size		hp_required;
diff --git a/src/include/portability/mem.h b/src/include/portability/mem.h
index ef9800732d9..40588ff6968 100644
--- a/src/include/portability/mem.h
+++ b/src/include/portability/mem.h
@@ -38,7 +38,7 @@
 #define MAP_NOSYNC			0
 #endif
 
-#define PG_MMAP_FLAGS			(MAP_SHARED|MAP_ANONYMOUS|MAP_HASSEMAPHORE)
+#define PG_MMAP_FLAGS			(MAP_SHARED|MAP_HASSEMAPHORE)
 
 /* Some really old systems don't define MAP_FAILED. */
 #ifndef MAP_FAILED
diff --git a/src/include/storage/pg_shmem.h b/src/include/storage/pg_shmem.h
index 2e47b222cbb..b9573520d9a 100644
--- a/src/include/storage/pg_shmem.h
+++ b/src/include/storage/pg_shmem.h
@@ -124,7 +124,8 @@ extern PGShmemHeader *PGSharedMemoryCreate(Size size,
 										   PGShmemHeader **shim, Pointer base);
 extern bool PGSharedMemoryIsInUse(unsigned long id1, unsigned long id2);
 extern void PGSharedMemoryDetach(void);
-extern void GetHugePageSize(Size *hugepagesize, int *mmap_flags);
+extern void GetHugePageSize(Size *hugepagesize, int *mmap_flags,
+							int *memfd_flags);
 void *ReserveAnonymousMemory(Size reserve_size);
 
 bool ProcessBarrierShmemResize(Barrier *barrier);
-- 
2.45.1


--vninua6xybvzgrci
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename="v4-0008-Support-resize-for-hugetlb.patch"



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 888+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 888+ messages in thread


end of thread, other threads:[~2026-06-02 17:22 UTC | newest]

Thread overview: 888+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-03-15 15:39 [PATCH v4 7/8] Use anonymous files to back shared memory segments Dmitrii Dolgov <9erthalion6@gmail.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox