Skip to content

Commit ce13bb9

Browse files
committed
Remove INT64_HEX_FORMAT and UINT64_HEX_FORMAT
These were introduced (commit efdc7d7) at the same time as we were moving to using the standard inttypes.h format macros (commit a0ed19e). 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
1 parent 3e65e77 commit ce13bb9

File tree

6 files changed

+6
-8
lines changed

6 files changed

+6
-8
lines changed

contrib/postgres_fdw/option.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ process_pgfdw_appname(const char *appname)
531531
appendStringInfoString(&buf, application_name);
532532
break;
533533
case 'c':
534-
appendStringInfo(&buf, INT64_HEX_FORMAT ".%x", MyStartTime, MyProcPid);
534+
appendStringInfo(&buf, "%" PRIx64 ".%x", MyStartTime, MyProcPid);
535535
break;
536536
case 'C':
537537
appendStringInfoString(&buf, cluster_name);

src/backend/utils/error/csvlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ write_csvlog(ErrorData *edata)
120120
appendStringInfoChar(&buf, ',');
121121

122122
/* session id */
123-
appendStringInfo(&buf, INT64_HEX_FORMAT ".%x", MyStartTime, MyProcPid);
123+
appendStringInfo(&buf, "%" PRIx64 ".%x", MyStartTime, MyProcPid);
124124
appendStringInfoChar(&buf, ',');
125125

126126
/* Line number */

src/backend/utils/error/elog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2956,12 +2956,12 @@ log_status_format(StringInfo buf, const char *format, ErrorData *edata)
29562956
{
29572957
char strfbuf[128];
29582958

2959-
snprintf(strfbuf, sizeof(strfbuf) - 1, INT64_HEX_FORMAT ".%x",
2959+
snprintf(strfbuf, sizeof(strfbuf) - 1, "%" PRIx64 ".%x",
29602960
MyStartTime, MyProcPid);
29612961
appendStringInfo(buf, "%*s", padding, strfbuf);
29622962
}
29632963
else
2964-
appendStringInfo(buf, INT64_HEX_FORMAT ".%x", MyStartTime, MyProcPid);
2964+
appendStringInfo(buf, "%" PRIx64 ".%x", MyStartTime, MyProcPid);
29652965
break;
29662966
case 'p':
29672967
if (padding != 0)

src/backend/utils/error/jsonlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ write_jsonlog(ErrorData *edata)
168168
}
169169

170170
/* Session id */
171-
appendJSONKeyValueFmt(&buf, "session_id", true, INT64_HEX_FORMAT ".%x",
171+
appendJSONKeyValueFmt(&buf, "session_id", true, "%" PRIx64 ".%x",
172172
MyStartTime, MyProcPid);
173173

174174
/* Line number */

src/include/c.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,6 @@ typedef uint32 bits32; /* >= 32 bits */
519519
/* snprintf format strings to use for 64-bit integers */
520520
#define INT64_FORMAT "%" PRId64
521521
#define UINT64_FORMAT "%" PRIu64
522-
#define INT64_HEX_FORMAT "%" PRIx64
523-
#define UINT64_HEX_FORMAT "%" PRIx64
524522

525523
/*
526524
* 128-bit signed and unsigned integers

src/test/modules/test_radixtree/test_radixtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
uint64 _expected = (expected_expr); \
4545
if (_result != _expected) \
4646
elog(ERROR, \
47-
"%s yielded " UINT64_HEX_FORMAT ", expected " UINT64_HEX_FORMAT " (%s) in file \"%s\" line %u", \
47+
"%s yielded %" PRIx64 ", expected %" PRIx64 " (%s) in file \"%s\" line %u", \
4848
#result_expr, _result, _expected, #expected_expr, __FILE__, __LINE__); \
4949
} while (0)
5050

0 commit comments

Comments
 (0)