]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove INT64_HEX_FORMAT and UINT64_HEX_FORMAT
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 6 Aug 2025 08:54:48 +0000 (10:54 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 6 Aug 2025 09:08:10 +0000 (11:08 +0200)
These were introduced (commit efdc7d74753) at the same time as we were
moving to using the standard inttypes.h format macros (commit
a0ed19e0a9e).  It doesn't seem useful to keep a new already-deprecated
interface like this with only a few users, so remove the new symbols
again and have the callers use PRIx64.

(Also, INT64_HEX_FORMAT was kind of a misnomer, since hex formats all
use unsigned types.)

Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/0ac47b5d-e5ab-4cac-98a7-bdee0e2831e4%40eisentraut.org

contrib/postgres_fdw/option.c
src/backend/utils/error/csvlog.c
src/backend/utils/error/elog.c
src/backend/utils/error/jsonlog.c
src/include/c.h
src/test/modules/test_radixtree/test_radixtree.c

index d6fa89bad93994afda5b4e1a4b1cd78ff6b106f8..04788b7e8b35fc626015cfa6bcf2d74dcc98c87d 100644 (file)
@@ -522,7 +522,7 @@ process_pgfdw_appname(const char *appname)
                                appendStringInfoString(&buf, application_name);
                                break;
                        case 'c':
-                               appendStringInfo(&buf, INT64_HEX_FORMAT ".%x", MyStartTime, MyProcPid);
+                               appendStringInfo(&buf, "%" PRIx64 ".%x", MyStartTime, MyProcPid);
                                break;
                        case 'C':
                                appendStringInfoString(&buf, cluster_name);
index fdac3c048e36a99143d46558ffc5f8db7f1d2b20..c3159ed7d979bd66d10336e870802ade6d40dc48 100644 (file)
@@ -120,7 +120,7 @@ write_csvlog(ErrorData *edata)
        appendStringInfoChar(&buf, ',');
 
        /* session id */
-       appendStringInfo(&buf, INT64_HEX_FORMAT ".%x", MyStartTime, MyProcPid);
+       appendStringInfo(&buf, "%" PRIx64 ".%x", MyStartTime, MyProcPid);
        appendStringInfoChar(&buf, ',');
 
        /* Line number */
index afce1a8e1f003094425a08aeeb9182f2e29c64fb..b7b9692f8c88403bbb828481d6dea766592cf830 100644 (file)
@@ -2959,12 +2959,12 @@ log_status_format(StringInfo buf, const char *format, ErrorData *edata)
                                {
                                        char            strfbuf[128];
 
-                                       snprintf(strfbuf, sizeof(strfbuf) - 1, INT64_HEX_FORMAT ".%x",
+                                       snprintf(strfbuf, sizeof(strfbuf) - 1, "%" PRIx64 ".%x",
                                                         MyStartTime, MyProcPid);
                                        appendStringInfo(buf, "%*s", padding, strfbuf);
                                }
                                else
-                                       appendStringInfo(buf, INT64_HEX_FORMAT ".%x", MyStartTime, MyProcPid);
+                                       appendStringInfo(buf, "%" PRIx64 ".%x", MyStartTime, MyProcPid);
                                break;
                        case 'p':
                                if (padding != 0)
index 519eacf17f83cf9dafb0f311cbb9bdbcfd1b9974..2619f49904201d7eb2f72987557f44707547aa3f 100644 (file)
@@ -168,7 +168,7 @@ write_jsonlog(ErrorData *edata)
        }
 
        /* Session id */
-       appendJSONKeyValueFmt(&buf, "session_id", true, INT64_HEX_FORMAT ".%x",
+       appendJSONKeyValueFmt(&buf, "session_id", true, "%" PRIx64 ".%x",
                                                  MyStartTime, MyProcPid);
 
        /* Line number */
index 6d4495bdd9f68733d0fa262bc6937781a61a9e85..bbdaa88c63a6f6cb4382c379b68bc98f43e83778 100644 (file)
@@ -530,8 +530,6 @@ typedef uint32 bits32;                      /* >= 32 bits */
 /* snprintf format strings to use for 64-bit integers */
 #define INT64_FORMAT "%" PRId64
 #define UINT64_FORMAT "%" PRIu64
-#define INT64_HEX_FORMAT "%" PRIx64
-#define UINT64_HEX_FORMAT "%" PRIx64
 
 /*
  * 128-bit signed and unsigned integers
index 32de6a3123e4d5ec26c84fb33ae5db19701700c6..80ad029616473561719289c111124bfdadd052d5 100644 (file)
@@ -44,7 +44,7 @@
                uint64          _expected = (expected_expr); \
                if (_result != _expected) \
                        elog(ERROR, \
-                                "%s yielded " UINT64_HEX_FORMAT ", expected " UINT64_HEX_FORMAT " (%s) in file \"%s\" line %u", \
+                                "%s yielded %" PRIx64 ", expected %" PRIx64 " (%s) in file \"%s\" line %u", \
                                 #result_expr, _result, _expected, #expected_expr, __FILE__, __LINE__); \
        } while (0)