Skip to content

Commit

Permalink
Fixed build warnings on Xcode 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
swisspol committed Jun 2, 2015
1 parent be5fda7 commit 9f3c18e
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/odb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
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);
return len+1;
}
Expand Down
6 changes: 6 additions & 0 deletions src/transports/cred.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ int git_cred_ssh_key_memory_new(
passphrase,
GIT_CREDTYPE_SSH_MEMORY);
#else
GIT_UNUSED(cred);
GIT_UNUSED(username);
GIT_UNUSED(publickey);
GIT_UNUSED(privatekey);
GIT_UNUSED(passphrase);

giterr_set(GITERR_INVALID,
"This version of libgit2 was not built with ssh memory credentials.");
return -1;
Expand Down
2 changes: 1 addition & 1 deletion tests/core/path.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ void test_core_path__13_cannot_prettify_a_non_existing_file(void)
{
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 "/so-do-i", NULL));

Expand Down
2 changes: 1 addition & 1 deletion tests/diff/index.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static void do_conflicted_diff(diff_expects *exp, unsigned long flags)
const char *a_commit = "26a125ee1bf"; /* the current HEAD */
git_tree *a = resolve_commit_oid_to_tree(g_repo, a_commit);
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_index *index;

Expand Down
2 changes: 1 addition & 1 deletion tests/diff/workdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void test_diff_workdir__to_index_with_conflicts(void)
git_diff_options opts = GIT_DIFF_OPTIONS_INIT;
git_diff *diff = NULL;
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};

g_repo = cl_git_sandbox_init("status");
Expand Down
5 changes: 2 additions & 3 deletions tests/index/addall.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ void test_index_addall__repo_lifecycle(void)
void test_index_addall__files_in_folders(void)
{
git_index *index;
git_strarray paths = { NULL, 0 };

addall_create_test_repo(true);

Expand Down Expand Up @@ -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_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);

cl_git_pass(git_index_add_all(index, NULL, 0, NULL, NULL));
Expand All @@ -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_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);

cl_git_rmfile("merge-resolve/conflicting.txt");
Expand Down
8 changes: 7 additions & 1 deletion tests/stash/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ int checkout_notify(
{
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)
seen_paths->what = 1;
else if (strcmp(path, "how") == 0)
Expand Down Expand Up @@ -318,6 +323,8 @@ int aborting_progress_cb(
git_stash_apply_progress_t progress,
void *payload)
{
GIT_UNUSED(payload);

if (progress == GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED)
return -44;

Expand All @@ -327,7 +334,6 @@ int aborting_progress_cb(
void test_stash_apply__progress_cb_can_abort(void)
{
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;

Expand Down
4 changes: 2 additions & 2 deletions tests/status/worktree.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,10 +649,10 @@ void test_status_worktree__conflict_has_no_oid(void)
{
git_repository *repo = cl_git_sandbox_init("status");
git_index *index;
git_index_entry entry = {0};
git_index_entry entry = {{0}};
git_status_list *statuslist;
const git_status_entry *status;
git_oid zero_id = {0};
git_oid zero_id = {{0}};

entry.mode = 0100644;
entry.path = "modified_file";
Expand Down

0 comments on commit 9f3c18e

Please sign in to comment.