Skip to content

Commit 24c491e

Browse files
authored
Merge pull request libgit2#5146 from scottfurry/StaticFixesExamples
Adjust printf specifiers in examples code
2 parents d588de7 + 73a186f commit 24c491e

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

examples/clone.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ static void print_progress(const progress_data *pd)
2323

2424
if (pd->fetch_progress.total_objects &&
2525
pd->fetch_progress.received_objects == pd->fetch_progress.total_objects) {
26-
printf("Resolving deltas %d/%d\r",
26+
printf("Resolving deltas %u/%u\r",
2727
pd->fetch_progress.indexed_deltas,
2828
pd->fetch_progress.total_deltas);
2929
} else {
30-
printf("net %3d%% (%4"PRIuZ" kb, %5d/%5d) / idx %3d%% (%5d/%5d) / chk %3d%% (%4" PRIuZ "/%4" PRIuZ ") %s\n",
30+
printf("net %3d%% (%4" PRIuZ " kb, %5u/%5u) / idx %3d%% (%5u/%5u) / chk %3d%% (%4" PRIuZ "/%4" PRIuZ")%s\n",
3131
network_percent, kbytes,
3232
pd->fetch_progress.received_objects, pd->fetch_progress.total_objects,
3333
index_percent, pd->fetch_progress.indexed_objects, pd->fetch_progress.total_objects,

examples/fetch.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ static int transfer_progress_cb(const git_indexer_progress *stats, void *payload
4343
(void)payload;
4444

4545
if (stats->received_objects == stats->total_objects) {
46-
printf("Resolving deltas %d/%d\r",
46+
printf("Resolving deltas %u/%u\r",
4747
stats->indexed_deltas, stats->total_deltas);
4848
} else if (stats->total_objects > 0) {
49-
printf("Received %d/%d objects (%d) in %" PRIuZ " bytes\r",
49+
printf("Received %u/%u objects (%u) in %" PRIuZ " bytes\r",
5050
stats->received_objects, stats->total_objects,
5151
stats->indexed_objects, stats->received_bytes);
5252
}
@@ -92,10 +92,10 @@ int lg2_fetch(git_repository *repo, int argc, char **argv)
9292
*/
9393
stats = git_remote_stats(remote);
9494
if (stats->local_objects > 0) {
95-
printf("\rReceived %d/%d objects in %" PRIuZ " bytes (used %d local objects)\n",
95+
printf("\rReceived %u/%u objects in %" PRIuZ " bytes (used %u local objects)\n",
9696
stats->indexed_objects, stats->total_objects, stats->received_bytes, stats->local_objects);
9797
} else{
98-
printf("\rReceived %d/%d objects in %" PRIuZ "bytes\n",
98+
printf("\rReceived %u/%u objects in %" PRIuZ "bytes\n",
9999
stats->indexed_objects, stats->total_objects, stats->received_bytes);
100100
}
101101

examples/index-pack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
static int index_cb(const git_indexer_progress *stats, void *data)
88
{
99
(void)data;
10-
printf("\rProcessing %d of %d", stats->indexed_objects, stats->total_objects);
10+
printf("\rProcessing %u of %u", stats->indexed_objects, stats->total_objects);
1111

1212
return 0;
1313
}
@@ -59,7 +59,7 @@ int lg2_index_pack(git_repository *repo, int argc, char **argv)
5959
if ((error = git_indexer_commit(idx, &stats)) < 0)
6060
goto cleanup;
6161

62-
printf("\rIndexing %d of %d\n", stats.indexed_objects, stats.total_objects);
62+
printf("\rIndexing %u of %u\n", stats.indexed_objects, stats.total_objects);
6363

6464
git_oid_fmt(hash, git_indexer_hash(idx));
6565
puts(hash);

0 commit comments

Comments
 (0)