Skip to content

Commit 73d33be

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 8c7445a commit 73d33be

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
@@ -522,7 +522,7 @@ process_pgfdw_appname(const char *appname)
522522
appendStringInfoString(&buf, application_name);
523523
break;
524524
case 'c':
525-
appendStringInfo(&buf, INT64_HEX_FORMAT ".%x", MyStartTime, MyProcPid);
525+
appendStringInfo(&buf, "%" PRIx64 ".%x", MyStartTime, MyProcPid);
526526
break;
527527
case 'C':
528528
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
@@ -2959,12 +2959,12 @@ log_status_format(StringInfo buf, const char *format, ErrorData *edata)
29592959
{
29602960
char strfbuf[128];
29612961

2962-
snprintf(strfbuf, sizeof(strfbuf) - 1, INT64_HEX_FORMAT ".%x",
2962+
snprintf(strfbuf, sizeof(strfbuf) - 1, "%" PRIx64 ".%x",
29632963
MyStartTime, MyProcPid);
29642964
appendStringInfo(buf, "%*s", padding, strfbuf);
29652965
}
29662966
else
2967-
appendStringInfo(buf, INT64_HEX_FORMAT ".%x", MyStartTime, MyProcPid);
2967+
appendStringInfo(buf, "%" PRIx64 ".%x", MyStartTime, MyProcPid);
29682968
break;
29692969
case 'p':
29702970
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
@@ -530,8 +530,6 @@ typedef uint32 bits32; /* >= 32 bits */
530530
/* snprintf format strings to use for 64-bit integers */
531531
#define INT64_FORMAT "%" PRId64
532532
#define UINT64_FORMAT "%" PRIu64
533-
#define INT64_HEX_FORMAT "%" PRIx64
534-
#define UINT64_HEX_FORMAT "%" PRIx64
535533

536534
/*
537535
* 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy