aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2021-08-08 22:05:42 +0200
committerPeter Eisentraut <peter@eisentraut.org>2021-08-08 22:08:07 +0200
commitae03a7c7391dfc59f14226b7cfd8ef9f3390e56f (patch)
treedb2f552b8fa261422d71541acb7a257735697b1d /src/backend/access
parentcf5ce5aa70d33fc3048ab63c50585b8cc0f11dfd (diff)
downloadpostgresql-ae03a7c7391dfc59f14226b7cfd8ef9f3390e56f.tar.gz
postgresql-ae03a7c7391dfc59f14226b7cfd8ef9f3390e56f.zip
Remove some unnecessary casts in format arguments
We can use %zd or %zu directly, no need to cast to int. Conversely, some code was casting away from int when it could be using %d directly.
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/spgist/spgutils.c8
-rw-r--r--src/backend/access/transam/xlogutils.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/access/spgist/spgutils.c b/src/backend/access/spgist/spgutils.c
index 9ff280a2526..03a9cd36e63 100644
--- a/src/backend/access/spgist/spgutils.c
+++ b/src/backend/access/spgist/spgutils.c
@@ -1240,8 +1240,8 @@ SpGistPageAddNewItem(SpGistState *state, Page page, Item item, Size size,
*startOffset = offnum + 1;
}
else
- elog(PANIC, "failed to add item of size %u to SPGiST index page",
- (int) size);
+ elog(PANIC, "failed to add item of size %zu to SPGiST index page",
+ size);
return offnum;
}
@@ -1252,8 +1252,8 @@ SpGistPageAddNewItem(SpGistState *state, Page page, Item item, Size size,
InvalidOffsetNumber, false, false);
if (offnum == InvalidOffsetNumber && !errorOK)
- elog(ERROR, "failed to add item of size %u to SPGiST index page",
- (int) size);
+ elog(ERROR, "failed to add item of size %zu to SPGiST index page",
+ size);
return offnum;
}
diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c
index b1702bc6bef..88a1bfd9394 100644
--- a/src/backend/access/transam/xlogutils.c
+++ b/src/backend/access/transam/xlogutils.c
@@ -991,8 +991,8 @@ WALReadRaiseError(WALReadError *errinfo)
{
ereport(ERROR,
(errcode(ERRCODE_DATA_CORRUPTED),
- errmsg("could not read from log segment %s, offset %u: read %d of %zu",
+ errmsg("could not read from log segment %s, offset %u: read %d of %d",
fname, errinfo->wre_off, errinfo->wre_read,
- (Size) errinfo->wre_req)));
+ errinfo->wre_req)));
}
}