Commit 9f3c18e2 by Pierre-Olivier Latour

Fixed build warnings on Xcode 6.1

parent be5fda75
...@@ -53,7 +53,7 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_ ...@@ -53,7 +53,7 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
int git_odb__format_object_header(char *hdr, size_t n, git_off_t obj_len, git_otype obj_type) int git_odb__format_object_header(char *hdr, size_t n, git_off_t obj_len, git_otype obj_type)
{ {
const char *type_str = git_object_type2string(obj_type); const char *type_str = git_object_type2string(obj_type);
int len = p_snprintf(hdr, n, "%s %"PRIuZ, type_str, obj_len); int len = p_snprintf(hdr, n, "%s %lld", type_str, obj_len);
assert(len > 0 && len <= (int)n); assert(len > 0 && len <= (int)n);
return len+1; return len+1;
} }
......
...@@ -209,6 +209,12 @@ int git_cred_ssh_key_memory_new( ...@@ -209,6 +209,12 @@ int git_cred_ssh_key_memory_new(
passphrase, passphrase,
GIT_CREDTYPE_SSH_MEMORY); GIT_CREDTYPE_SSH_MEMORY);
#else #else
GIT_UNUSED(cred);
GIT_UNUSED(username);
GIT_UNUSED(publickey);
GIT_UNUSED(privatekey);
GIT_UNUSED(passphrase);
giterr_set(GITERR_INVALID, giterr_set(GITERR_INVALID,
"This version of libgit2 was not built with ssh memory credentials."); "This version of libgit2 was not built with ssh memory credentials.");
return -1; return -1;
......
...@@ -492,7 +492,7 @@ void test_core_path__13_cannot_prettify_a_non_existing_file(void) ...@@ -492,7 +492,7 @@ void test_core_path__13_cannot_prettify_a_non_existing_file(void)
{ {
git_buf p = GIT_BUF_INIT; git_buf p = GIT_BUF_INIT;
cl_must_pass(git_path_exists(NON_EXISTING_FILEPATH) == false); cl_assert_equal_b(git_path_exists(NON_EXISTING_FILEPATH), false);
cl_assert_equal_i(GIT_ENOTFOUND, git_path_prettify(&p, NON_EXISTING_FILEPATH, NULL)); cl_assert_equal_i(GIT_ENOTFOUND, git_path_prettify(&p, NON_EXISTING_FILEPATH, NULL));
cl_assert_equal_i(GIT_ENOTFOUND, git_path_prettify(&p, NON_EXISTING_FILEPATH "/so-do-i", NULL)); cl_assert_equal_i(GIT_ENOTFOUND, git_path_prettify(&p, NON_EXISTING_FILEPATH "/so-do-i", NULL));
......
...@@ -168,7 +168,7 @@ static void do_conflicted_diff(diff_expects *exp, unsigned long flags) ...@@ -168,7 +168,7 @@ static void do_conflicted_diff(diff_expects *exp, unsigned long flags)
const char *a_commit = "26a125ee1bf"; /* the current HEAD */ const char *a_commit = "26a125ee1bf"; /* the current HEAD */
git_tree *a = resolve_commit_oid_to_tree(g_repo, a_commit); git_tree *a = resolve_commit_oid_to_tree(g_repo, a_commit);
git_diff_options opts = GIT_DIFF_OPTIONS_INIT; git_diff_options opts = GIT_DIFF_OPTIONS_INIT;
git_index_entry ancestor = {0}, ours = {0}, theirs = {0}; git_index_entry ancestor = {{0}}, ours = {{0}}, theirs = {{0}};
git_diff *diff = NULL; git_diff *diff = NULL;
git_index *index; git_index *index;
......
...@@ -73,7 +73,7 @@ void test_diff_workdir__to_index_with_conflicts(void) ...@@ -73,7 +73,7 @@ void test_diff_workdir__to_index_with_conflicts(void)
git_diff_options opts = GIT_DIFF_OPTIONS_INIT; git_diff_options opts = GIT_DIFF_OPTIONS_INIT;
git_diff *diff = NULL; git_diff *diff = NULL;
git_index *index; git_index *index;
git_index_entry our_entry = {0}, their_entry = {0}; git_index_entry our_entry = {{0}}, their_entry = {{0}};
diff_expects exp = {0}; diff_expects exp = {0};
g_repo = cl_git_sandbox_init("status"); g_repo = cl_git_sandbox_init("status");
......
...@@ -288,7 +288,6 @@ void test_index_addall__repo_lifecycle(void) ...@@ -288,7 +288,6 @@ void test_index_addall__repo_lifecycle(void)
void test_index_addall__files_in_folders(void) void test_index_addall__files_in_folders(void)
{ {
git_index *index; git_index *index;
git_strarray paths = { NULL, 0 };
addall_create_test_repo(true); addall_create_test_repo(true);
...@@ -408,7 +407,7 @@ void test_index_addall__adds_conflicts(void) ...@@ -408,7 +407,7 @@ void test_index_addall__adds_conflicts(void)
cl_git_pass(git_reference_lookup(&ref, g_repo, "refs/heads/branch")); cl_git_pass(git_reference_lookup(&ref, g_repo, "refs/heads/branch"));
cl_git_pass(git_annotated_commit_from_ref(&annotated, g_repo, ref)); cl_git_pass(git_annotated_commit_from_ref(&annotated, g_repo, ref));
cl_git_pass(git_merge(g_repo, &annotated, 1, NULL, NULL)); cl_git_pass(git_merge(g_repo, (const git_annotated_commit**)&annotated, 1, NULL, NULL));
check_status(g_repo, 0, 1, 2, 0, 0, 0, 0, 1); check_status(g_repo, 0, 1, 2, 0, 0, 0, 0, 1);
cl_git_pass(git_index_add_all(index, NULL, 0, NULL, NULL)); cl_git_pass(git_index_add_all(index, NULL, 0, NULL, NULL));
...@@ -433,7 +432,7 @@ void test_index_addall__removes_deleted_conflicted_files(void) ...@@ -433,7 +432,7 @@ void test_index_addall__removes_deleted_conflicted_files(void)
cl_git_pass(git_reference_lookup(&ref, g_repo, "refs/heads/branch")); cl_git_pass(git_reference_lookup(&ref, g_repo, "refs/heads/branch"));
cl_git_pass(git_annotated_commit_from_ref(&annotated, g_repo, ref)); cl_git_pass(git_annotated_commit_from_ref(&annotated, g_repo, ref));
cl_git_pass(git_merge(g_repo, &annotated, 1, NULL, NULL)); cl_git_pass(git_merge(g_repo, (const git_annotated_commit**)&annotated, 1, NULL, NULL));
check_status(g_repo, 0, 1, 2, 0, 0, 0, 0, 1); check_status(g_repo, 0, 1, 2, 0, 0, 0, 0, 1);
cl_git_rmfile("merge-resolve/conflicting.txt"); cl_git_rmfile("merge-resolve/conflicting.txt");
......
...@@ -254,6 +254,11 @@ int checkout_notify( ...@@ -254,6 +254,11 @@ int checkout_notify(
{ {
struct seen_paths *seen_paths = (struct seen_paths *)payload; struct seen_paths *seen_paths = (struct seen_paths *)payload;
GIT_UNUSED(why);
GIT_UNUSED(baseline);
GIT_UNUSED(target);
GIT_UNUSED(workdir);
if (strcmp(path, "what") == 0) if (strcmp(path, "what") == 0)
seen_paths->what = 1; seen_paths->what = 1;
else if (strcmp(path, "how") == 0) else if (strcmp(path, "how") == 0)
...@@ -318,6 +323,8 @@ int aborting_progress_cb( ...@@ -318,6 +323,8 @@ int aborting_progress_cb(
git_stash_apply_progress_t progress, git_stash_apply_progress_t progress,
void *payload) void *payload)
{ {
GIT_UNUSED(payload);
if (progress == GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED) if (progress == GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED)
return -44; return -44;
...@@ -327,7 +334,6 @@ int aborting_progress_cb( ...@@ -327,7 +334,6 @@ int aborting_progress_cb(
void test_stash_apply__progress_cb_can_abort(void) void test_stash_apply__progress_cb_can_abort(void)
{ {
git_stash_apply_options opts = GIT_STASH_APPLY_OPTIONS_INIT; git_stash_apply_options opts = GIT_STASH_APPLY_OPTIONS_INIT;
git_stash_apply_progress_t progress = GIT_STASH_APPLY_PROGRESS_NONE;
opts.progress_cb = aborting_progress_cb; opts.progress_cb = aborting_progress_cb;
......
...@@ -649,10 +649,10 @@ void test_status_worktree__conflict_has_no_oid(void) ...@@ -649,10 +649,10 @@ void test_status_worktree__conflict_has_no_oid(void)
{ {
git_repository *repo = cl_git_sandbox_init("status"); git_repository *repo = cl_git_sandbox_init("status");
git_index *index; git_index *index;
git_index_entry entry = {0}; git_index_entry entry = {{0}};
git_status_list *statuslist; git_status_list *statuslist;
const git_status_entry *status; const git_status_entry *status;
git_oid zero_id = {0}; git_oid zero_id = {{0}};
entry.mode = 0100644; entry.mode = 0100644;
entry.path = "modified_file"; entry.path = "modified_file";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment