Use size_t instead of Size in pg_waldump

In commit b15c151398 I missed the memo about not using Size in new
code.

Per complaint from Thomas Munro

Discussion: https://postgr.es/m/CA+hUKGJkeTVuq5u5WKJm6xkwmW577UuQ7fA=PyBCSR3h9g2GtQ@mail.gmail.com
This commit is contained in:
Andrew Dunstan 2026-04-10 09:29:00 -04:00
parent 4a18907b41
commit 3f8913f683
2 changed files with 8 additions and 10 deletions

View file

@ -299,10 +299,10 @@ free_archive_reader(XLogDumpPrivate *privateInfo)
*/
int
read_archive_wal_page(XLogDumpPrivate *privateInfo, XLogRecPtr targetPagePtr,
Size count, char *readBuff)
size_t count, char *readBuff)
{
char *p = readBuff;
Size nbytes = count;
size_t nbytes = count;
XLogRecPtr recptr = targetPagePtr;
int segsize = privateInfo->segsize;
XLogSegNo segno;
@ -364,15 +364,13 @@ read_archive_wal_page(XLogDumpPrivate *privateInfo, XLogRecPtr targetPagePtr,
* archive reached EOF.
*/
if (privateInfo->cur_file != entry)
pg_fatal("WAL segment \"%s\" in archive \"%s\" is too short: read %lld of %lld bytes",
pg_fatal("WAL segment \"%s\" in archive \"%s\" is too short: read %zu of %zu bytes",
fname, privateInfo->archive_name,
(long long int) (count - nbytes),
(long long int) count);
(count - nbytes), count);
if (!read_archive_file(privateInfo))
pg_fatal("unexpected end of archive \"%s\" while reading \"%s\": read %lld of %lld bytes",
pg_fatal("unexpected end of archive \"%s\" while reading \"%s\": read %zu of %zu bytes",
privateInfo->archive_name, fname,
(long long int) (count - nbytes),
(long long int) count);
(count - nbytes), count);
/*
* Loading more data may have moved hash table entries, so we must

View file

@ -39,7 +39,7 @@ typedef struct XLogDumpPrivate
astreamer *archive_streamer;
char *archive_read_buf; /* Reusable read buffer for archive I/O */
Size archive_read_buf_size;
size_t archive_read_buf_size;
/*
* The buffer for the WAL file the archive streamer is currently reading,
@ -75,7 +75,7 @@ extern void init_archive_reader(XLogDumpPrivate *privateInfo,
extern void free_archive_reader(XLogDumpPrivate *privateInfo);
extern int read_archive_wal_page(XLogDumpPrivate *privateInfo,
XLogRecPtr targetPagePtr,
Size count, char *readBuff);
size_t count, char *readBuff);
extern void free_archive_wal_entry(const char *fname,
XLogDumpPrivate *privateInfo);