Skip to content

Commit 2dea473

Browse files
committed
examples: avoid warning when iterating over index entries
When iterating over index entries, we store the indices in an unsigned int. As the index entrycount is a `size_t` though, this may be a loss of precision which a compiler might rightfully complain about. Use `size_t` instead to fix any warnings.
1 parent abf24a3 commit 2dea473

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/general.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ static void revwalking(git_repository *repo)
624624
static void index_walking(git_repository *repo)
625625
{
626626
git_index *index;
627-
unsigned int i, ecount;
627+
size_t i, ecount;
628628

629629
printf("\n*Index Walking*\n");
630630

examples/show-index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
int lg2_show_index(git_repository *repo, int argc, char** argv)
1818
{
1919
git_index *index;
20-
unsigned int i, ecount;
20+
size_t i, ecount;
2121
char *dir = ".";
2222
size_t dirlen;
2323
char out[GIT_OID_HEXSZ+1];

0 commit comments

Comments
 (0)