agora inbox for pgsql-hackers@postgresql.orghelp / color / mirror / Atom feed
[PATCH v7 2/3] Assign backend type earlier 911+ messages / 2 participants [nested] [flat]
* [PATCH v7 2/3] Assign backend type earlier @ 2025-11-26 00:09 Euler Taveira <euler@eulerto.com> 0 siblings, 0 replies; 911+ messages in thread From: Euler Taveira @ 2025-11-26 00:09 UTC (permalink / raw) Instead of assigning the backend type into the Main function of each postmaster child, do it earlier (after fork()). The backend type is already known by postmaster_child_launch() before it calls fork(). This reduces the time frame that MyBackendType is correct. (This is important for log_min_messages per backend type that relies on a known MyBackendType to decide if it writes a log message or not.) --- src/backend/postmaster/autovacuum.c | 2 -- src/backend/postmaster/bgworker.c | 1 - src/backend/postmaster/bgwriter.c | 1 - src/backend/postmaster/checkpointer.c | 1 - src/backend/postmaster/launch_backend.c | 2 ++ src/backend/postmaster/pgarch.c | 1 - src/backend/postmaster/startup.c | 1 - src/backend/postmaster/syslogger.c | 1 - src/backend/postmaster/walsummarizer.c | 1 - src/backend/postmaster/walwriter.c | 1 - src/backend/replication/logical/slotsync.c | 2 -- src/backend/replication/walreceiver.c | 1 - src/backend/storage/aio/method_worker.c | 1 - 13 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 1c38488f2cb..36c1911a3a8 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -388,7 +388,6 @@ AutoVacLauncherMain(const void *startup_data, size_t startup_data_len) PostmasterContext = NULL; } - MyBackendType = B_AUTOVAC_LAUNCHER; init_ps_display(NULL); ereport(DEBUG1, @@ -1401,7 +1400,6 @@ AutoVacWorkerMain(const void *startup_data, size_t startup_data_len) PostmasterContext = NULL; } - MyBackendType = B_AUTOVAC_WORKER; init_ps_display(NULL); Assert(GetProcessingMode() == InitProcessing); diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c index 142a02eb5e9..260f051711e 100644 --- a/src/backend/postmaster/bgworker.c +++ b/src/backend/postmaster/bgworker.c @@ -741,7 +741,6 @@ BackgroundWorkerMain(const void *startup_data, size_t startup_data_len) } MyBgworkerEntry = worker; - MyBackendType = B_BG_WORKER; init_ps_display(worker->bgw_name); Assert(GetProcessingMode() == InitProcessing); diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c index 72f5acceec7..4119758a72c 100644 --- a/src/backend/postmaster/bgwriter.c +++ b/src/backend/postmaster/bgwriter.c @@ -94,7 +94,6 @@ BackgroundWriterMain(const void *startup_data, size_t startup_data_len) Assert(startup_data_len == 0); - MyBackendType = B_BG_WRITER; AuxiliaryProcessMainCommon(); /* diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c index afb3d6d8630..427f50752d4 100644 --- a/src/backend/postmaster/checkpointer.c +++ b/src/backend/postmaster/checkpointer.c @@ -199,7 +199,6 @@ CheckpointerMain(const void *startup_data, size_t startup_data_len) Assert(startup_data_len == 0); - MyBackendType = B_CHECKPOINTER; AuxiliaryProcessMainCommon(); CheckpointerShmem->checkpointer_pid = MyProcPid; diff --git a/src/backend/postmaster/launch_backend.c b/src/backend/postmaster/launch_backend.c index c2a044321d1..35420b8c9fb 100644 --- a/src/backend/postmaster/launch_backend.c +++ b/src/backend/postmaster/launch_backend.c @@ -224,6 +224,8 @@ postmaster_child_launch(BackendType child_type, int child_slot, pid = fork_process(); if (pid == 0) /* child */ { + MyBackendType = child_type; + /* Capture and transfer timings that may be needed for logging */ if (IsExternalConnectionBackend(child_type)) { diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c index ce6b5299324..b760d1aed40 100644 --- a/src/backend/postmaster/pgarch.c +++ b/src/backend/postmaster/pgarch.c @@ -222,7 +222,6 @@ PgArchiverMain(const void *startup_data, size_t startup_data_len) { Assert(startup_data_len == 0); - MyBackendType = B_ARCHIVER; AuxiliaryProcessMainCommon(); /* diff --git a/src/backend/postmaster/startup.c b/src/backend/postmaster/startup.c index 27e86cf393f..13e86a2921e 100644 --- a/src/backend/postmaster/startup.c +++ b/src/backend/postmaster/startup.c @@ -217,7 +217,6 @@ StartupProcessMain(const void *startup_data, size_t startup_data_len) { Assert(startup_data_len == 0); - MyBackendType = B_STARTUP; AuxiliaryProcessMainCommon(); /* Arrange to clean up at startup process exit */ diff --git a/src/backend/postmaster/syslogger.c b/src/backend/postmaster/syslogger.c index 50c2edec1f6..a378b15a6de 100644 --- a/src/backend/postmaster/syslogger.c +++ b/src/backend/postmaster/syslogger.c @@ -206,7 +206,6 @@ SysLoggerMain(const void *startup_data, size_t startup_data_len) now = MyStartTime; - MyBackendType = B_LOGGER; init_ps_display(NULL); /* diff --git a/src/backend/postmaster/walsummarizer.c b/src/backend/postmaster/walsummarizer.c index c4a888a081c..ce497d8ec42 100644 --- a/src/backend/postmaster/walsummarizer.c +++ b/src/backend/postmaster/walsummarizer.c @@ -234,7 +234,6 @@ WalSummarizerMain(const void *startup_data, size_t startup_data_len) Assert(startup_data_len == 0); - MyBackendType = B_WAL_SUMMARIZER; AuxiliaryProcessMainCommon(); ereport(DEBUG1, diff --git a/src/backend/postmaster/walwriter.c b/src/backend/postmaster/walwriter.c index fd92c8b7a33..c1b4ddda555 100644 --- a/src/backend/postmaster/walwriter.c +++ b/src/backend/postmaster/walwriter.c @@ -94,7 +94,6 @@ WalWriterMain(const void *startup_data, size_t startup_data_len) Assert(startup_data_len == 0); - MyBackendType = B_WAL_WRITER; AuxiliaryProcessMainCommon(); /* diff --git a/src/backend/replication/logical/slotsync.c b/src/backend/replication/logical/slotsync.c index 7e3b4c4413e..364df1ad519 100644 --- a/src/backend/replication/logical/slotsync.c +++ b/src/backend/replication/logical/slotsync.c @@ -1436,8 +1436,6 @@ ReplSlotSyncWorkerMain(const void *startup_data, size_t startup_data_len) Assert(startup_data_len == 0); - MyBackendType = B_SLOTSYNC_WORKER; - init_ps_display(NULL); Assert(GetProcessingMode() == InitProcessing); diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index 3a94c9683a7..154fe9e0cb5 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -168,7 +168,6 @@ WalReceiverMain(const void *startup_data, size_t startup_data_len) Assert(startup_data_len == 0); - MyBackendType = B_WAL_RECEIVER; AuxiliaryProcessMainCommon(); /* diff --git a/src/backend/storage/aio/method_worker.c b/src/backend/storage/aio/method_worker.c index 866a35abbd1..64caaa7b766 100644 --- a/src/backend/storage/aio/method_worker.c +++ b/src/backend/storage/aio/method_worker.c @@ -390,7 +390,6 @@ IoWorkerMain(const void *startup_data, size_t startup_data_len) volatile int error_errno = 0; char cmd[128]; - MyBackendType = B_IO_WORKER; AuxiliaryProcessMainCommon(); pqsignal(SIGHUP, SignalHandlerForConfigReload); -- 2.47.3 --grg2fqqi6tkdt5me Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="v7-0003-Fixup-assign-backend-type-earlier.patch" ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --Z10p9YYojB0/BzD2 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() @ 2026-06-02 17:22 Reviewer <review@example.com> 0 siblings, 0 replies; 911+ messages in thread From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw) --- src/interfaces/libpq/fe-lobj.c | 58 +++------------------------------- 1 file changed, 4 insertions(+), 54 deletions(-) diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c index 1660c969f58..42b2a36bda9 100644 --- a/src/interfaces/libpq/fe-lobj.c +++ b/src/interfaces/libpq/fe-lobj.c @@ -43,8 +43,6 @@ static int lo_initialize(PGconn *conn); static Oid lo_import_internal(PGconn *conn, const char *filename, Oid oid); -static int64_t lo_hton64(int64_t host64); -static int64_t lo_ntoh64(int64_t net64); /* * lo_open @@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len) argv[0].len = 4; argv[0].u.integer = fd; - len = lo_hton64(len); + len = pg_hton64(len); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &len; @@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) argv[0].len = 4; argv[0].u.integer = fd; - offset = lo_hton64(offset); + offset = pg_hton64(offset); argv[1].isint = 0; argv[1].len = 8; argv[1].u.ptr = (int *) &offset; @@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd) if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8) { PQclear(res); - return lo_ntoh64(retval); + return pg_ntoh64(retval); } else { @@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn) conn->lobjfuncs = lobjfuncs; return 0; } - -/* - * lo_hton64 - * converts a 64-bit integer from host byte order to network byte order - */ -static int64_t -lo_hton64(int64_t host64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - uint32 t; - - /* High order half first, since we're doing MSB-first */ - t = (uint32) (host64 >> 32); - swap.i32[0] = pg_hton32(t); - - /* Now the low order half */ - t = (uint32) host64; - swap.i32[1] = pg_hton32(t); - - return swap.i64; -} - -/* - * lo_ntoh64 - * converts a 64-bit integer from network byte order to host byte order - */ -static int64_t -lo_ntoh64(int64_t net64) -{ - union - { - int64 i64; - uint32 i32[2]; - } swap; - int64 result; - - swap.i64 = net64; - - result = (uint32) pg_ntoh32(swap.i32[0]); - result <<= 32; - result |= (uint32) pg_ntoh32(swap.i32[1]); - - return result; -} -- 2.50.1 (Apple Git-155) --6CoALBM/+cswbGQ8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch ^ permalink raw reply [nested|flat] 911+ messages in thread
end of thread, other threads:[~2026-06-02 17:22 UTC | newest] Thread overview: 911+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-11-26 00:09 [PATCH v7 2/3] Assign backend type earlier Euler Taveira <euler@eulerto.com> 2026-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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox