Commit aeb2b991 by Carlos Martín Nieto

Merge pull request #3221 from git-up/build_warnings

Fixed Xcode 6.1 build warnings
parents b93dcd4c 0f4d9c03
...@@ -285,7 +285,7 @@ done: ...@@ -285,7 +285,7 @@ done:
static int diff_binary(git_diff_output *output, git_patch *patch) static int diff_binary(git_diff_output *output, git_patch *patch)
{ {
git_diff_binary binary = { 0 }; git_diff_binary binary = {{0}};
const char *old_data = patch->ofile.map.data; const char *old_data = patch->ofile.map.data;
const char *new_data = patch->nfile.map.data; const char *new_data = patch->nfile.map.data;
size_t old_len = patch->ofile.map.len, size_t old_len = patch->ofile.map.len,
......
...@@ -335,7 +335,6 @@ static int format_binary( ...@@ -335,7 +335,6 @@ static int format_binary(
const char *typename = type == GIT_DIFF_BINARY_DELTA ? const char *typename = type == GIT_DIFF_BINARY_DELTA ?
"delta" : "literal"; "delta" : "literal";
const char *scan, *end; const char *scan, *end;
int error = 0;
git_buf_printf(pi->buf, "%s %lu\n", typename, inflatedlen); git_buf_printf(pi->buf, "%s %lu\n", typename, inflatedlen);
pi->line.num_lines++; pi->line.num_lines++;
......
...@@ -1045,7 +1045,7 @@ int git_path_direach( ...@@ -1045,7 +1045,7 @@ int git_path_direach(
#endif #endif
while ((de = readdir(dir)) != NULL) { while ((de = readdir(dir)) != NULL) {
char *de_path = de->d_name; const char *de_path = de->d_name;
size_t de_len = strlen(de_path); size_t de_len = strlen(de_path);
if (git_path_is_dot_or_dotdot(de_path)) if (git_path_is_dot_or_dotdot(de_path))
...@@ -1305,7 +1305,7 @@ int git_path_diriter_next(git_path_diriter *diriter) ...@@ -1305,7 +1305,7 @@ int git_path_diriter_next(git_path_diriter *diriter)
#ifdef GIT_USE_ICONV #ifdef GIT_USE_ICONV
if ((diriter->flags & GIT_PATH_DIR_PRECOMPOSE_UNICODE) != 0 && if ((diriter->flags & GIT_PATH_DIR_PRECOMPOSE_UNICODE) != 0 &&
(error = git_path_iconv(&diriter->ic, (char **)&filename, &filename_len)) < 0) (error = git_path_iconv(&diriter->ic, &filename, &filename_len)) < 0)
return error; return error;
#endif #endif
......
...@@ -863,7 +863,7 @@ int git_reference__normalize_name( ...@@ -863,7 +863,7 @@ int git_reference__normalize_name(
const char *name, const char *name,
unsigned int flags) unsigned int flags)
{ {
char *current; const char *current;
int segment_len, segments_count = 0, error = GIT_EINVALIDSPEC; int segment_len, segments_count = 0, error = GIT_EINVALIDSPEC;
unsigned int process_flags; unsigned int process_flags;
bool normalize = (buf != NULL); bool normalize = (buf != NULL);
......
...@@ -24,7 +24,7 @@ void test_core_iconv__cleanup(void) ...@@ -24,7 +24,7 @@ void test_core_iconv__cleanup(void)
void test_core_iconv__unchanged(void) void test_core_iconv__unchanged(void)
{ {
#ifdef GIT_USE_ICONV #ifdef GIT_USE_ICONV
char *data = "Ascii data", *original = data; const char *data = "Ascii data", *original = data;
size_t datalen = strlen(data); size_t datalen = strlen(data);
cl_git_pass(git_path_iconv(&ic, &data, &datalen)); cl_git_pass(git_path_iconv(&ic, &data, &datalen));
...@@ -38,7 +38,7 @@ void test_core_iconv__unchanged(void) ...@@ -38,7 +38,7 @@ void test_core_iconv__unchanged(void)
void test_core_iconv__decomposed_to_precomposed(void) void test_core_iconv__decomposed_to_precomposed(void)
{ {
#ifdef GIT_USE_ICONV #ifdef GIT_USE_ICONV
char *data = nfd; const char *data = nfd;
size_t datalen, nfdlen = strlen(nfd); size_t datalen, nfdlen = strlen(nfd);
datalen = nfdlen; datalen = nfdlen;
...@@ -64,7 +64,7 @@ void test_core_iconv__decomposed_to_precomposed(void) ...@@ -64,7 +64,7 @@ void test_core_iconv__decomposed_to_precomposed(void)
void test_core_iconv__precomposed_is_unmodified(void) void test_core_iconv__precomposed_is_unmodified(void)
{ {
#ifdef GIT_USE_ICONV #ifdef GIT_USE_ICONV
char *data = nfc; const char *data = nfc;
size_t datalen = strlen(nfc); size_t datalen = strlen(nfc);
cl_git_pass(git_path_iconv(&ic, &data, &datalen)); cl_git_pass(git_path_iconv(&ic, &data, &datalen));
......
...@@ -317,6 +317,8 @@ static int print_cb( ...@@ -317,6 +317,8 @@ static int print_cb(
{ {
git_buf *buf = (git_buf *)payload; git_buf *buf = (git_buf *)payload;
GIT_UNUSED(delta);
if (hunk) if (hunk)
git_buf_put(buf, hunk->header, hunk->header_len); git_buf_put(buf, hunk->header, hunk->header_len);
...@@ -382,6 +384,8 @@ static int file_cb( ...@@ -382,6 +384,8 @@ static int file_cb(
{ {
struct diff_data *diff_data = payload; struct diff_data *diff_data = payload;
GIT_UNUSED(progress);
if (delta->old_file.path) if (delta->old_file.path)
diff_data->old_path = git__strdup(delta->old_file.path); diff_data->old_path = git__strdup(delta->old_file.path);
...@@ -401,6 +405,8 @@ static int binary_cb( ...@@ -401,6 +405,8 @@ static int binary_cb(
{ {
struct diff_data *diff_data = payload; struct diff_data *diff_data = payload;
GIT_UNUSED(delta);
git_buf_encode_base85(&diff_data->old_binary_base85, git_buf_encode_base85(&diff_data->old_binary_base85,
binary->old_file.data, binary->old_file.datalen); binary->old_file.data, binary->old_file.datalen);
diff_data->old_binary_inflatedlen = binary->old_file.inflatedlen; diff_data->old_binary_inflatedlen = binary->old_file.inflatedlen;
...@@ -419,6 +425,10 @@ static int hunk_cb( ...@@ -419,6 +425,10 @@ static int hunk_cb(
const git_diff_hunk *hunk, const git_diff_hunk *hunk,
void *payload) void *payload)
{ {
GIT_UNUSED(delta);
GIT_UNUSED(hunk);
GIT_UNUSED(payload);
cl_fail("did not expect hunk callback"); cl_fail("did not expect hunk callback");
return 0; return 0;
} }
...@@ -429,6 +439,11 @@ static int line_cb( ...@@ -429,6 +439,11 @@ static int line_cb(
const git_diff_line *line, const git_diff_line *line,
void *payload) void *payload)
{ {
GIT_UNUSED(delta);
GIT_UNUSED(hunk);
GIT_UNUSED(line);
GIT_UNUSED(payload);
cl_fail("did not expect line callback"); cl_fail("did not expect line callback");
return 0; return 0;
} }
...@@ -440,15 +455,6 @@ void test_diff_binary__blob_to_blob(void) ...@@ -440,15 +455,6 @@ void test_diff_binary__blob_to_blob(void)
git_blob *old_blob, *new_blob; git_blob *old_blob, *new_blob;
git_oid old_id, new_id; git_oid old_id, new_id;
struct diff_data diff_data = {0}; struct diff_data diff_data = {0};
const char *expected =
"diff --git a/untimely.txt b/untimely.txt\n" \
"index 9a69d960ae94b060f56c2a8702545e2bb1abb935..1111d4f11f4b35bf6759e0fb714fe09731ef0840 100644\n" \
"GIT binary patch\n" \
"delta 32\n" \
"nc%1vf+QYWt3zLL@hC)e3Vu?a>QDRl4f_G*?PG(-ZA}<#J$+QbW\n" \
"\n" \
"delta 7\n" \
"Oc%18D`@*{63ljhg(E~C7\n";
opts.flags = GIT_DIFF_SHOW_BINARY | GIT_DIFF_FORCE_BINARY; opts.flags = GIT_DIFF_SHOW_BINARY | GIT_DIFF_FORCE_BINARY;
opts.id_abbrev = GIT_OID_HEXSZ; opts.id_abbrev = GIT_OID_HEXSZ;
......
...@@ -164,6 +164,8 @@ int diff_foreach_via_iterator( ...@@ -164,6 +164,8 @@ int diff_foreach_via_iterator(
{ {
size_t d, num_d = git_diff_num_deltas(diff); size_t d, num_d = git_diff_num_deltas(diff);
GIT_UNUSED(binary_cb);
for (d = 0; d < num_d; ++d) { for (d = 0; d < num_d; ++d) {
git_patch *patch; git_patch *patch;
const git_diff_delta *delta; const git_diff_delta *delta;
......
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