Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite03b807

Browse files
committed
Fix incorrect format placeholders
Also remove obsolete comments about why the 64-bit integers need to beprinted in a separate buffer. The reason used to be portability, butnow the remaining reason is that we need the string lengths for theprogress displays. That is evident by looking at the code rightbelow, so a new comment doesn't seem necessary.
1 parentf7e56f1 commite03b807

File tree

3 files changed

+8
-23
lines changed

3 files changed

+8
-23
lines changed

‎src/bin/pg_amcheck/pg_amcheck.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,15 +1226,10 @@ progress_report(uint64 relations_total, uint64 relations_checked,
12261226
if (relpages_total)
12271227
percent_pages= (int) (relpages_checked*100 /relpages_total);
12281228

1229-
/*
1230-
* Separate step to keep platform-dependent format code out of fprintf
1231-
* calls. We only test for INT64_FORMAT availability in snprintf, not
1232-
* fprintf.
1233-
*/
1234-
snprintf(checked_rel,sizeof(checked_rel),INT64_FORMAT,relations_checked);
1235-
snprintf(total_rel,sizeof(total_rel),INT64_FORMAT,relations_total);
1236-
snprintf(checked_pages,sizeof(checked_pages),INT64_FORMAT,relpages_checked);
1237-
snprintf(total_pages,sizeof(total_pages),INT64_FORMAT,relpages_total);
1229+
snprintf(checked_rel,sizeof(checked_rel),UINT64_FORMAT,relations_checked);
1230+
snprintf(total_rel,sizeof(total_rel),UINT64_FORMAT,relations_total);
1231+
snprintf(checked_pages,sizeof(checked_pages),UINT64_FORMAT,relpages_checked);
1232+
snprintf(total_pages,sizeof(total_pages),UINT64_FORMAT,relpages_total);
12381233

12391234
#defineVERBOSE_DATNAME_LENGTH 35
12401235
if (opts.verbose)

‎src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -804,14 +804,9 @@ progress_report(int tablespacenum, const char *filename,
804804
if (totaldone /1024>totalsize_kb)
805805
totalsize_kb=totaldone /1024;
806806

807-
/*
808-
* Separate step to keep platform-dependent format code out of
809-
* translatable strings. And we only test for INT64_FORMAT availability
810-
* in snprintf, not fprintf.
811-
*/
812-
snprintf(totaldone_str,sizeof(totaldone_str),INT64_FORMAT,
807+
snprintf(totaldone_str,sizeof(totaldone_str),UINT64_FORMAT,
813808
totaldone /1024);
814-
snprintf(totalsize_str,sizeof(totalsize_str),INT64_FORMAT,totalsize_kb);
809+
snprintf(totalsize_str,sizeof(totalsize_str),UINT64_FORMAT,totalsize_kb);
815810

816811
#defineVERBOSE_FILENAME_LENGTH 35
817812
if (verbose)

‎src/bin/pg_rewind/pg_rewind.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -759,14 +759,9 @@ progress_report(bool finished)
759759
if (fetch_done>fetch_size)
760760
fetch_size=fetch_done;
761761

762-
/*
763-
* Separate step to keep platform-dependent format code out of
764-
* translatable strings. And we only test for INT64_FORMAT availability
765-
* in snprintf, not fprintf.
766-
*/
767-
snprintf(fetch_done_str,sizeof(fetch_done_str),INT64_FORMAT,
762+
snprintf(fetch_done_str,sizeof(fetch_done_str),UINT64_FORMAT,
768763
fetch_done /1024);
769-
snprintf(fetch_size_str,sizeof(fetch_size_str),INT64_FORMAT,
764+
snprintf(fetch_size_str,sizeof(fetch_size_str),UINT64_FORMAT,
770765
fetch_size /1024);
771766

772767
fprintf(stderr,_("%*s/%s kB (%d%%) copied"),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp