Commit 1cd96016 by Carlos Martín Nieto

Merge pull request #3301 from ethomson/warnings

Clean up some warnings
parents a1687f78 9c033102
...@@ -3,6 +3,10 @@ v0.23 + 1 ...@@ -3,6 +3,10 @@ v0.23 + 1
### Changes or improvements ### Changes or improvements
* Custom filters can now be registered with wildcard attributes, for
example `filter=*`. Consumers should examine the attributes parameter
of the `check` function for details.
### API additions ### API additions
### API removals ### API removals
...@@ -92,10 +96,6 @@ v0.23 ...@@ -92,10 +96,6 @@ v0.23
* If libcurl is installed, we will use it to connect to HTTP(S) * If libcurl is installed, we will use it to connect to HTTP(S)
servers. servers.
* Custom filters can now be registered with wildcard attributes, for
example `filter=*`. Consumers should examine the attributes parameter
of the `check` function for details.
### API additions ### API additions
* The `git_merge_options` gained a `file_flags` member. * The `git_merge_options` gained a `file_flags` member.
......
...@@ -619,4 +619,4 @@ typedef const char *kh_cstr_t; ...@@ -619,4 +619,4 @@ typedef const char *kh_cstr_t;
#define KHASH_MAP_INIT_STR(name, khval_t) \ #define KHASH_MAP_INIT_STR(name, khval_t) \
KHASH_INIT(name, kh_cstr_t, khval_t, 1, kh_str_hash_func, kh_str_hash_equal) KHASH_INIT(name, kh_cstr_t, khval_t, 1, kh_str_hash_func, kh_str_hash_equal)
#endif /* __AC_KHASH_H */ #endif /* __AC_KHASH_H */
\ No newline at end of file
...@@ -544,6 +544,8 @@ static int xdl_call_hunk_func(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, ...@@ -544,6 +544,8 @@ static int xdl_call_hunk_func(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb,
{ {
xdchange_t *xch, *xche; xdchange_t *xch, *xche;
(void)xe;
for (xch = xscr; xch; xch = xche->next) { for (xch = xscr; xch; xch = xche->next) {
xche = xdl_get_hunk(&xch, xecfg); xche = xdl_get_hunk(&xch, xecfg);
if (!xch) if (!xch)
......
...@@ -90,7 +90,7 @@ xdchange_t *xdl_get_hunk(xdchange_t **xscr, xdemitconf_t const *xecfg) ...@@ -90,7 +90,7 @@ xdchange_t *xdl_get_hunk(xdchange_t **xscr, xdemitconf_t const *xecfg)
} else if (distance < max_ignorable && xch->ignore) { } else if (distance < max_ignorable && xch->ignore) {
ignored += xch->chg2; ignored += xch->chg2;
} else if (lxch != xchp && } else if (lxch != xchp &&
xch->i1 + ignored - (lxch->i1 + lxch->chg1) > max_common) { xch->i1 + ignored - (lxch->i1 + lxch->chg1) > (unsigned long)max_common) {
break; break;
} else if (!xch->ignore) { } else if (!xch->ignore) {
lxch = xch; lxch = xch;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
static git_repository *g_repo = NULL; static git_repository *g_repo = NULL;
static git_filter *create_wildcard_filter(); static git_filter *create_wildcard_filter(void);
#define DATA_LEN 32 #define DATA_LEN 32
...@@ -63,6 +63,9 @@ static int wildcard_filter_check( ...@@ -63,6 +63,9 @@ static int wildcard_filter_check(
const git_filter_source *src, const git_filter_source *src,
const char **attr_values) const char **attr_values)
{ {
GIT_UNUSED(self);
GIT_UNUSED(src);
if (strcmp(attr_values[0], "wcflip") == 0 || if (strcmp(attr_values[0], "wcflip") == 0 ||
strcmp(attr_values[0], "wcreverse") == 0) { strcmp(attr_values[0], "wcreverse") == 0) {
*payload = git__strdup(attr_values[0]); *payload = git__strdup(attr_values[0]);
...@@ -91,10 +94,10 @@ static int wildcard_filter_apply( ...@@ -91,10 +94,10 @@ static int wildcard_filter_apply(
return GIT_PASSTHROUGH; return GIT_PASSTHROUGH;
} }
static int wildcard_filter_cleanup(git_filter *self, void *payload) static void wildcard_filter_cleanup(git_filter *self, void *payload)
{ {
GIT_UNUSED(self);
git__free(payload); git__free(payload);
return 0;
} }
static void wildcard_filter_free(git_filter *f) static void wildcard_filter_free(git_filter *f)
...@@ -102,7 +105,7 @@ static void wildcard_filter_free(git_filter *f) ...@@ -102,7 +105,7 @@ static void wildcard_filter_free(git_filter *f)
git__free(f); git__free(f);
} }
static git_filter *create_wildcard_filter() static git_filter *create_wildcard_filter(void)
{ {
git_filter *filter = git__calloc(1, sizeof(git_filter)); git_filter *filter = git__calloc(1, sizeof(git_filter));
cl_assert(filter); cl_assert(filter);
...@@ -125,7 +128,7 @@ void test_filter_wildcard__reverse(void) ...@@ -125,7 +128,7 @@ void test_filter_wildcard__reverse(void)
cl_git_pass(git_filter_list_load( cl_git_pass(git_filter_list_load(
&fl, g_repo, NULL, "hero-reverse-foo", GIT_FILTER_TO_ODB, 0)); &fl, g_repo, NULL, "hero-reverse-foo", GIT_FILTER_TO_ODB, 0));
cl_git_pass(git_buf_put(&in, input, DATA_LEN)); cl_git_pass(git_buf_put(&in, (char *)input, DATA_LEN));
cl_git_pass(git_filter_list_apply_to_data(&out, fl, &in)); cl_git_pass(git_filter_list_apply_to_data(&out, fl, &in));
cl_assert_equal_i(DATA_LEN, out.size); cl_assert_equal_i(DATA_LEN, out.size);
...@@ -146,7 +149,7 @@ void test_filter_wildcard__flip(void) ...@@ -146,7 +149,7 @@ void test_filter_wildcard__flip(void)
cl_git_pass(git_filter_list_load( cl_git_pass(git_filter_list_load(
&fl, g_repo, NULL, "hero-flip-foo", GIT_FILTER_TO_ODB, 0)); &fl, g_repo, NULL, "hero-flip-foo", GIT_FILTER_TO_ODB, 0));
cl_git_pass(git_buf_put(&in, input, DATA_LEN)); cl_git_pass(git_buf_put(&in, (char *)input, DATA_LEN));
cl_git_pass(git_filter_list_apply_to_data(&out, fl, &in)); cl_git_pass(git_filter_list_apply_to_data(&out, fl, &in));
cl_assert_equal_i(DATA_LEN, out.size); cl_assert_equal_i(DATA_LEN, out.size);
...@@ -167,7 +170,7 @@ void test_filter_wildcard__none(void) ...@@ -167,7 +170,7 @@ void test_filter_wildcard__none(void)
cl_git_pass(git_filter_list_load( cl_git_pass(git_filter_list_load(
&fl, g_repo, NULL, "none-foo", GIT_FILTER_TO_ODB, 0)); &fl, g_repo, NULL, "none-foo", GIT_FILTER_TO_ODB, 0));
cl_git_pass(git_buf_put(&in, input, DATA_LEN)); cl_git_pass(git_buf_put(&in, (char *)input, DATA_LEN));
cl_git_pass(git_filter_list_apply_to_data(&out, fl, &in)); cl_git_pass(git_filter_list_apply_to_data(&out, fl, &in));
cl_assert_equal_i(DATA_LEN, out.size); cl_assert_equal_i(DATA_LEN, out.size);
......
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