Commit 27061b151a7e0225186365ee0b5ca802d68782a9

Russell Belfer 2013-09-05T10:25:16

Fix some newer GCC compiler warnings

diff --git a/tests-clar/checkout/index.c b/tests-clar/checkout/index.c
index a185aec..c9352d8 100644
--- a/tests-clar/checkout/index.c
+++ b/tests-clar/checkout/index.c
@@ -245,7 +245,7 @@ void test_checkout_index__options_dir_modes(void)
 	(void)p_umask(um = p_umask(022));
 
 	cl_git_pass(p_stat("./testrepo/a", &st));
-	cl_assert_equal_i_fmt(st.st_mode, GIT_FILEMODE_TREE | 0701 & ~um, "%07o");
+	cl_assert_equal_i_fmt(st.st_mode, (GIT_FILEMODE_TREE | 0701) & ~um, "%07o");
 
 	/* File-mode test, since we're on the 'dir' branch */
 	cl_git_pass(p_stat("./testrepo/a/b.txt", &st));
diff --git a/tests-clar/diff/rename.c b/tests-clar/diff/rename.c
index ac3814d..b5a9935 100644
--- a/tests-clar/diff/rename.c
+++ b/tests-clar/diff/rename.c
@@ -1100,7 +1100,6 @@ void test_diff_rename__can_rename_from_rewrite(void)
 {
 	git_index *index;
 	git_tree *tree;
-	git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
 	git_diff_list *diff;
 	git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT;
 	git_diff_find_options findopts = GIT_DIFF_FIND_OPTIONS_INIT;
@@ -1110,8 +1109,6 @@ void test_diff_rename__can_rename_from_rewrite(void)
 	const char *targets[] = { "songof7cities.txt", "this-is-a-rename.txt" };
 	struct rename_expected expect = { 2, status, sources, targets };
 
-	opts.checkout_strategy = GIT_CHECKOUT_FORCE;
-
 	cl_git_pass(git_repository_index(&index, g_repo));
 
 	cl_git_pass(p_rename("renames/songof7cities.txt", "renames/this-is-a-rename.txt"));
diff --git a/tests-clar/odb/backend/nonrefreshing.c b/tests-clar/odb/backend/nonrefreshing.c
index abb824d..9abca2b 100644
--- a/tests-clar/odb/backend/nonrefreshing.c
+++ b/tests-clar/odb/backend/nonrefreshing.c
@@ -132,8 +132,8 @@ static int build_fake_backend(
 
 static void setup_repository_and_backend(git_error_code error_code)
 {
-	git_odb *odb;
-	git_odb_backend *backend;
+	git_odb *odb = NULL;
+	git_odb_backend *backend = NULL;
 
 	_repo = cl_git_sandbox_init("testrepo.git");