Fix warnings on Win64
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
diff --git a/src/commit.c b/src/commit.c
index cc912a7..15a195f 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -163,7 +163,8 @@ int git_commit__parse(void *_commit, git_odb_object *odb_obj)
const char *buffer_start = git_odb_object_data(odb_obj), *buffer;
const char *buffer_end = buffer_start + git_odb_object_size(odb_obj);
git_oid parent_id;
- size_t parent_count = 0, header_len;
+ uint32_t parent_count = 0;
+ size_t header_len;
/* find end-of-header (counting parents as we go) */
for (buffer = buffer_start; buffer < buffer_end; ++buffer) {
diff --git a/src/diff_driver.c b/src/diff_driver.c
index 77b0e9f..e82dfa5 100644
--- a/src/diff_driver.c
+++ b/src/diff_driver.c
@@ -374,7 +374,7 @@ static long diff_context_find(
return -1;
if (out_size > (long)ctxt->line.size)
- out_size = ctxt->line.size;
+ out_size = (long)ctxt->line.size;
memcpy(out, ctxt->line.ptr, (size_t)out_size);
return out_size;
diff --git a/tests-clar/diff/pathspec.c b/tests-clar/diff/pathspec.c
index 332b513..4334a89 100644
--- a/tests-clar/diff/pathspec.c
+++ b/tests-clar/diff/pathspec.c
@@ -34,7 +34,7 @@ void test_diff_pathspec__0(void)
cl_git_pass(git_pathspec_new(&ps, &paths));
cl_git_pass(git_pathspec_match_tree(&matches, a, GIT_PATHSPEC_DEFAULT, ps));
- cl_assert_equal_i(7, git_pathspec_match_list_entrycount(matches));
+ cl_assert_equal_i(7, (int)git_pathspec_match_list_entrycount(matches));
cl_assert_equal_s("current_file", git_pathspec_match_list_entry(matches,0));
cl_assert(git_pathspec_match_list_diff_entry(matches,0) == NULL);
git_pathspec_match_list_free(matches);
@@ -43,13 +43,13 @@ void test_diff_pathspec__0(void)
cl_git_pass(git_pathspec_match_diff(
&matches, diff, GIT_PATHSPEC_DEFAULT, ps));
- cl_assert_equal_i(7, git_pathspec_match_list_entrycount(matches));
+ cl_assert_equal_i(7, (int)git_pathspec_match_list_entrycount(matches));
cl_assert(git_pathspec_match_list_diff_entry(matches, 0) != NULL);
cl_assert(git_pathspec_match_list_entry(matches, 0) == NULL);
cl_assert_equal_s("current_file",
git_pathspec_match_list_diff_entry(matches,0)->new_file.path);
cl_assert_equal_i(GIT_DELTA_ADDED,
- git_pathspec_match_list_diff_entry(matches,0)->status);
+ (int)git_pathspec_match_list_diff_entry(matches,0)->status);
git_pathspec_match_list_free(matches);
git_diff_list_free(diff);
@@ -59,13 +59,13 @@ void test_diff_pathspec__0(void)
cl_git_pass(git_pathspec_match_diff(
&matches, diff, GIT_PATHSPEC_DEFAULT, ps));
- cl_assert_equal_i(3, git_pathspec_match_list_entrycount(matches));
+ cl_assert_equal_i(3, (int)git_pathspec_match_list_entrycount(matches));
cl_assert(git_pathspec_match_list_diff_entry(matches, 0) != NULL);
cl_assert(git_pathspec_match_list_entry(matches, 0) == NULL);
cl_assert_equal_s("subdir/current_file",
git_pathspec_match_list_diff_entry(matches,0)->new_file.path);
cl_assert_equal_i(GIT_DELTA_DELETED,
- git_pathspec_match_list_diff_entry(matches,0)->status);
+ (int)git_pathspec_match_list_diff_entry(matches,0)->status);
git_pathspec_match_list_free(matches);
git_diff_list_free(diff);
@@ -75,13 +75,13 @@ void test_diff_pathspec__0(void)
cl_git_pass(git_pathspec_match_diff(
&matches, diff, GIT_PATHSPEC_DEFAULT, ps));
- cl_assert_equal_i(4, git_pathspec_match_list_entrycount(matches));
+ cl_assert_equal_i(4, (int)git_pathspec_match_list_entrycount(matches));
cl_assert(git_pathspec_match_list_diff_entry(matches, 0) != NULL);
cl_assert(git_pathspec_match_list_entry(matches, 0) == NULL);
cl_assert_equal_s("modified_file",
git_pathspec_match_list_diff_entry(matches,0)->new_file.path);
cl_assert_equal_i(GIT_DELTA_MODIFIED,
- git_pathspec_match_list_diff_entry(matches,0)->status);
+ (int)git_pathspec_match_list_diff_entry(matches,0)->status);
git_pathspec_match_list_free(matches);
git_diff_list_free(diff);