1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

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.
This commit is contained in:
Peter Eisentraut
2021-08-08 22:05:42 +02:00
parent cf5ce5aa70
commit ae03a7c739
5 changed files with 15 additions and 15 deletions

View File

@@ -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;
}

View File

@@ -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)));
}
}