mirror of
https://github.com/postgres/postgres.git
synced 2025-12-04 12:02:48 +03:00
Use PRI?64 instead of "ll?" in format strings (continued).
Continuation of work started in commit 15a79c73, after initial trial.
Author: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/b936d2fb-590d-49c3-a615-92c3a88c6c19%40eisentraut.org
This commit is contained in:
@@ -4630,7 +4630,7 @@ AddISO8601IntPart(char *cp, int64 value, char units)
|
||||
{
|
||||
if (value == 0)
|
||||
return cp;
|
||||
sprintf(cp, "%lld%c", (long long) value, units);
|
||||
sprintf(cp, "%" PRId64 "%c", value, units);
|
||||
return cp + strlen(cp);
|
||||
}
|
||||
|
||||
@@ -4641,10 +4641,10 @@ AddPostgresIntPart(char *cp, int64 value, const char *units,
|
||||
{
|
||||
if (value == 0)
|
||||
return cp;
|
||||
sprintf(cp, "%s%s%lld %s%s",
|
||||
sprintf(cp, "%s%s%" PRId64 " %s%s",
|
||||
(!*is_zero) ? " " : "",
|
||||
(*is_before && value > 0) ? "+" : "",
|
||||
(long long) value,
|
||||
value,
|
||||
units,
|
||||
(value != 1) ? "s" : "");
|
||||
|
||||
@@ -4672,7 +4672,7 @@ AddVerboseIntPart(char *cp, int64 value, const char *units,
|
||||
}
|
||||
else if (*is_before)
|
||||
value = -value;
|
||||
sprintf(cp, " %lld %s%s", (long long) value, units, (value == 1) ? "" : "s");
|
||||
sprintf(cp, " %" PRId64 " %s%s", value, units, (value == 1) ? "" : "s");
|
||||
*is_zero = false;
|
||||
return cp + strlen(cp);
|
||||
}
|
||||
@@ -4767,10 +4767,10 @@ EncodeInterval(struct pg_itm *itm, int style, char *str)
|
||||
char sec_sign = (hour < 0 || min < 0 ||
|
||||
sec < 0 || fsec < 0) ? '-' : '+';
|
||||
|
||||
sprintf(cp, "%c%d-%d %c%lld %c%lld:%02d:",
|
||||
sprintf(cp, "%c%d-%d %c%" PRId64 " %c%" PRId64 ":%02d:",
|
||||
year_sign, abs(year), abs(mon),
|
||||
day_sign, (long long) i64abs(mday),
|
||||
sec_sign, (long long) i64abs(hour), abs(min));
|
||||
day_sign, i64abs(mday),
|
||||
sec_sign, i64abs(hour), abs(min));
|
||||
cp += strlen(cp);
|
||||
cp = AppendSeconds(cp, sec, fsec, MAX_INTERVAL_PRECISION, true);
|
||||
*cp = '\0';
|
||||
@@ -4781,15 +4781,15 @@ EncodeInterval(struct pg_itm *itm, int style, char *str)
|
||||
}
|
||||
else if (has_day)
|
||||
{
|
||||
sprintf(cp, "%lld %lld:%02d:",
|
||||
(long long) mday, (long long) hour, min);
|
||||
sprintf(cp, "%" PRId64 " %" PRId64 ":%02d:",
|
||||
mday, hour, min);
|
||||
cp += strlen(cp);
|
||||
cp = AppendSeconds(cp, sec, fsec, MAX_INTERVAL_PRECISION, true);
|
||||
*cp = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(cp, "%lld:%02d:", (long long) hour, min);
|
||||
sprintf(cp, "%" PRId64 ":%02d:", hour, min);
|
||||
cp += strlen(cp);
|
||||
cp = AppendSeconds(cp, sec, fsec, MAX_INTERVAL_PRECISION, true);
|
||||
*cp = '\0';
|
||||
@@ -4839,10 +4839,10 @@ EncodeInterval(struct pg_itm *itm, int style, char *str)
|
||||
{
|
||||
bool minus = (hour < 0 || min < 0 || sec < 0 || fsec < 0);
|
||||
|
||||
sprintf(cp, "%s%s%02lld:%02d:",
|
||||
sprintf(cp, "%s%s%02" PRId64 ":%02d:",
|
||||
is_zero ? "" : " ",
|
||||
(minus ? "-" : (is_before ? "+" : "")),
|
||||
(long long) i64abs(hour), abs(min));
|
||||
i64abs(hour), abs(min));
|
||||
cp += strlen(cp);
|
||||
cp = AppendSeconds(cp, sec, fsec, MAX_INTERVAL_PRECISION, true);
|
||||
*cp = '\0';
|
||||
|
||||
@@ -3296,8 +3296,8 @@ byteaGetBit(PG_FUNCTION_ARGS)
|
||||
if (n < 0 || n >= (int64) len * 8)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
|
||||
errmsg("index %lld out of valid range, 0..%lld",
|
||||
(long long) n, (long long) len * 8 - 1)));
|
||||
errmsg("index %" PRId64 " out of valid range, 0..%" PRId64,
|
||||
n, (int64) len * 8 - 1)));
|
||||
|
||||
/* n/8 is now known < len, so safe to cast to int */
|
||||
byteNo = (int) (n / 8);
|
||||
@@ -3368,8 +3368,8 @@ byteaSetBit(PG_FUNCTION_ARGS)
|
||||
if (n < 0 || n >= (int64) len * 8)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
|
||||
errmsg("index %lld out of valid range, 0..%lld",
|
||||
(long long) n, (long long) len * 8 - 1)));
|
||||
errmsg("index %" PRId64 " out of valid range, 0..%" PRId64,
|
||||
n, (int64) len * 8 - 1)));
|
||||
|
||||
/* n/8 is now known < len, so safe to cast to int */
|
||||
byteNo = (int) (n / 8);
|
||||
|
||||
@@ -117,8 +117,8 @@ TransactionIdInRecentPast(FullTransactionId fxid, TransactionId *extracted_xid)
|
||||
if (!FullTransactionIdPrecedes(fxid, now_fullxid))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("transaction ID %llu is in the future",
|
||||
(unsigned long long) U64FromFullTransactionId(fxid))));
|
||||
errmsg("transaction ID %" PRIu64 " is in the future",
|
||||
U64FromFullTransactionId(fxid))));
|
||||
|
||||
/*
|
||||
* TransamVariables->oldestClogXid is protected by XactTruncationLock, but
|
||||
|
||||
Reference in New Issue
Block a user