Commit 2dea47362e007b9cbfbc218ad125202a248ed470

Patrick Steinhardt 2019-06-27T15:27:29

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.

diff --git a/examples/general.c b/examples/general.c
index 2e9a321..4bd1dac 100644
--- a/examples/general.c
+++ b/examples/general.c
@@ -624,7 +624,7 @@ static void revwalking(git_repository *repo)
 static void index_walking(git_repository *repo)
 {
 	git_index *index;
-	unsigned int i, ecount;
+	size_t i, ecount;
 
 	printf("\n*Index Walking*\n");
 
diff --git a/examples/show-index.c b/examples/show-index.c
index 6acadbe..34eb41c 100644
--- a/examples/show-index.c
+++ b/examples/show-index.c
@@ -17,7 +17,7 @@
 int lg2_show_index(git_repository *repo, int argc, char** argv)
 {
 	git_index *index;
-	unsigned int i, ecount;
+	size_t i, ecount;
 	char *dir = ".";
 	size_t dirlen;
 	char out[GIT_OID_HEXSZ+1];