Fix Linux warnings This change fixes -Wmaybe-uninitialized and -Wdeprecated-declarations warnings on Linux builds
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
diff --git a/src/apply.c b/src/apply.c
index 28d6cd8..b21d838 100644
--- a/src/apply.c
+++ b/src/apply.c
@@ -575,7 +575,7 @@ static int apply_deltas(
{
git_strmap *removed_paths;
size_t i;
- int error;
+ int error = 0;
if (git_strmap_alloc(&removed_paths) < 0)
return -1;
diff --git a/tests/index/crlf.c b/tests/index/crlf.c
index ddf01fe..d90ea58 100644
--- a/tests/index/crlf.c
+++ b/tests/index/crlf.c
@@ -29,7 +29,7 @@ void test_index_crlf__cleanup(void)
if (expected_fixture.size) {
cl_fixture_cleanup(expected_fixture.ptr);
- git_buf_free(&expected_fixture);
+ git_buf_dispose(&expected_fixture);
}
}
@@ -164,13 +164,13 @@ static void test_add_index(const char *safecrlf, const char *autocrlf, const cha
cl_git_pass(git_path_direach(&reponame, 0, add_and_check_file, &compare_data));
cl_fixture_cleanup(expected_fixture.ptr);
- git_buf_free(&expected_fixture);
+ git_buf_dispose(&expected_fixture);
- git_buf_free(&attrbuf);
- git_buf_free(&expected_fixture);
- git_buf_free(&expected_dirname);
- git_buf_free(&sandboxname);
- git_buf_free(&reponame);
+ git_buf_dispose(&attrbuf);
+ git_buf_dispose(&expected_fixture);
+ git_buf_dispose(&expected_dirname);
+ git_buf_dispose(&sandboxname);
+ git_buf_dispose(&reponame);
}
static void set_up_workingdir(const char *name)
@@ -205,7 +205,7 @@ static void set_up_workingdir(const char *name)
}
git__free(basename);
- git_buf_free(&dest_filename);
+ git_buf_dispose(&dest_filename);
}
git_vector_free_deep(&contents);
}