Skip to content

Commit c1903db

Browse files
committed
Fix format warnings
1 parent b455420 commit c1903db

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/archive.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ do_archive_push(char *wal_file_path, char *wal_file_name, bool overwrite)
2727
char backup_wal_file_path[MAXPGPATH];
2828
char absolute_wal_file_path[MAXPGPATH];
2929
char current_dir[MAXPGPATH];
30-
int64 system_id;
30+
uint64 system_id;
3131
bool is_compress = false;
3232

3333
if (wal_file_name == NULL && wal_file_path == NULL)
@@ -50,7 +50,7 @@ do_archive_push(char *wal_file_path, char *wal_file_name, bool overwrite)
5050

5151
if(system_id != instance_config.system_identifier)
5252
elog(ERROR, "Refuse to push WAL segment %s into archive. Instance parameters mismatch."
53-
"Instance '%s' should have SYSTEM_ID = %ld instead of %ld",
53+
"Instance '%s' should have SYSTEM_ID = " UINT64_FORMAT " instead of " UINT64_FORMAT,
5454
wal_file_name, instance_name, instance_config.system_identifier,
5555
system_id);
5656

src/data.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ read_page_from_file(pgFile *file, BlockNumber blknum,
232232
return 0;
233233
}
234234
else
235-
elog(WARNING, "File: %s, block %u, expected block size %d,"
236-
"but read %lu, try again",
235+
elog(WARNING, "File: %s, block %u, expected block size %u,"
236+
"but read %zu, try again",
237237
file->path, blknum, BLCKSZ, read_len);
238238
}
239239

@@ -382,7 +382,7 @@ prepare_page(backup_files_arg *arguments,
382382
else if (page_size != BLCKSZ)
383383
{
384384
free(ptrack_page);
385-
elog(ERROR, "File: %s, block %u, expected block size %d, but read %lu",
385+
elog(ERROR, "File: %s, block %u, expected block size %d, but read %zu",
386386
file->path, absolute_blknum, BLCKSZ, page_size);
387387
}
388388
else
@@ -574,7 +574,7 @@ backup_data_file(backup_files_arg* arguments,
574574
if (file->size % BLCKSZ != 0)
575575
{
576576
fclose(in);
577-
elog(ERROR, "File: %s, invalid file size %lu", file->path, file->size);
577+
elog(ERROR, "File: %s, invalid file size %zu", file->path, file->size);
578578
}
579579

580580
/*
@@ -789,7 +789,7 @@ restore_data_file(const char *to_path, pgFile *file, bool allow_truncate,
789789
read_len = fread(compressed_page.data, 1,
790790
MAXALIGN(header.compressed_size), in);
791791
if (read_len != MAXALIGN(header.compressed_size))
792-
elog(ERROR, "cannot read block %u of \"%s\" read %lu of %d",
792+
elog(ERROR, "cannot read block %u of \"%s\" read %zu of %d",
793793
blknum, file->path, read_len, header.compressed_size);
794794

795795
/*
@@ -1620,7 +1620,7 @@ check_file_pages(pgFile *file, XLogRecPtr stop_lsn, uint32 checksum_version,
16201620
read_len = fread(compressed_page.data, 1,
16211621
MAXALIGN(header.compressed_size), in);
16221622
if (read_len != MAXALIGN(header.compressed_size))
1623-
elog(ERROR, "cannot read block %u of \"%s\" read %lu of %d",
1623+
elog(ERROR, "cannot read block %u of \"%s\" read %zu of %d",
16241624
blknum, file->path, read_len, header.compressed_size);
16251625

16261626
COMP_FILE_CRC32(use_crc32c, crc, compressed_page.data, read_len);

src/restore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ restore_backup(pgBackup *backup)
480480
/* By default there are some error */
481481
threads_args[i].ret = 1;
482482

483-
elog(LOG, "Start thread for num:%li", parray_num(files));
483+
elog(LOG, "Start thread for num:%zu", parray_num(files));
484484

485485
pthread_create(&threads[i], NULL, restore_files, arg);
486486
}

0 commit comments

Comments
 (0)