aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2023-09-19 09:46:01 +0200
committerPeter Eisentraut <peter@eisentraut.org>2023-09-19 09:46:01 +0200
commit9847ca2c79bef27b9bab44b2243fe951b7c62b36 (patch)
tree95ac7a76506693391c49236a6831f4f7e2e4bf0c /src
parent78a33bba4c634afc3c67dddeb359b5ce872a0b04 (diff)
downloadpostgresql-9847ca2c79bef27b9bab44b2243fe951b7c62b36.tar.gz
postgresql-9847ca2c79bef27b9bab44b2243fe951b7c62b36.zip
Standardize type of extend_by counter
The counter of extend_by loops is mixed int and uint32. Fix by standardizing from int to uint32, to match the extend_by variable. Fixup for 31966b151e. Author: Ranier Vilela <ranier.vf@gmail.com> Reviewed-by: Gurjeet Singh <gurjeet@singh.im> Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/CAEudQAqHG-JP-YnG54ftL_b7v6-57rMKwET_MSvEoen0UHuPig@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/backend/storage/buffer/bufmgr.c6
-rw-r--r--src/backend/storage/buffer/localbuf.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 8116f95595a..8b96759b84f 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -955,7 +955,7 @@ ExtendBufferedRelTo(BufferManagerRelation bmr,
current_size = first_block + extended_by;
Assert(num_pages != 0 || current_size >= extend_to);
- for (int i = 0; i < extended_by; i++)
+ for (uint32 i = 0; i < extended_by; i++)
{
if (first_block + i != extend_to - 1)
ReleaseBuffer(buffers[i]);
@@ -1938,7 +1938,7 @@ ExtendBufferedRelShared(BufferManagerRelation bmr,
* This needs to happen before we extend the relation, because as soon as
* we do, other backends can start to read in those pages.
*/
- for (int i = 0; i < extend_by; i++)
+ for (uint32 i = 0; i < extend_by; i++)
{
Buffer victim_buf = buffers[i];
BufferDesc *victim_buf_hdr = GetBufferDescriptor(victim_buf - 1);
@@ -2070,7 +2070,7 @@ ExtendBufferedRelShared(BufferManagerRelation bmr,
io_start, extend_by);
/* Set BM_VALID, terminate IO, and wake up any waiters */
- for (int i = 0; i < extend_by; i++)
+ for (uint32 i = 0; i < extend_by; i++)
{
Buffer buf = buffers[i];
BufferDesc *buf_hdr = GetBufferDescriptor(buf - 1);
diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c
index 567b8d15ef0..9f20dca1212 100644
--- a/src/backend/storage/buffer/localbuf.c
+++ b/src/backend/storage/buffer/localbuf.c
@@ -360,7 +360,7 @@ ExtendBufferedRelLocal(BufferManagerRelation bmr,
relpath(bmr.smgr->smgr_rlocator, fork),
MaxBlockNumber)));
- for (int i = 0; i < extend_by; i++)
+ for (uint32 i = 0; i < extend_by; i++)
{
int victim_buf_id;
BufferDesc *victim_buf_hdr;
@@ -416,7 +416,7 @@ ExtendBufferedRelLocal(BufferManagerRelation bmr,
pgstat_count_io_op_time(IOOBJECT_TEMP_RELATION, IOCONTEXT_NORMAL, IOOP_EXTEND,
io_start, extend_by);
- for (int i = 0; i < extend_by; i++)
+ for (uint32 i = 0; i < extend_by; i++)
{
Buffer buf = buffers[i];
BufferDesc *buf_hdr;