From 854eccbb2d86c2910f9d98dc52f9ebd0e37c262a Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Wed, 29 Feb 2012 12:04:59 -0800 Subject: Clean up GIT_UNUSED macros on all platforms It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5 did not fix the GIT_USUSED behavior on all platforms. This commit walks through and really cleans things up more thoroughly, getting rid of the unnecessary stuff. To remove the use of some GIT_UNUSED, I ended up adding a couple of new iterators for hashtables that allow you to iterator just over keys or just over values. In making this change, I found a bug in the clar tests (where we were doing *count++ but meant to do (*count)++ to increment the value). I fixed that but then found the test failing because it was not really using an empty repo. So, I took some of the code that I wrote for iterator testing and moved it to clar_helpers.c, then made use of that to make it easier to open fixtures on a per test basis even within a single test file. --- src/diff_output.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/diff_output.c') diff --git a/src/diff_output.c b/src/diff_output.c index ac60e9822..b800be933 100644 --- a/src/diff_output.c +++ b/src/diff_output.c @@ -161,7 +161,7 @@ static int file_is_binary_by_content( git_map *old_data, git_map *new_data) { - GIT_UNUSED_ARG(diff); + GIT_UNUSED(diff); if ((delta->old.flags & BINARY_DIFF_FLAGS) == 0) { size_t search_len = min(old_data->len, 4000); @@ -448,7 +448,7 @@ static int print_compact(void *data, git_diff_delta *delta, float progress) diff_print_info *pi = data; char code, old_suffix, new_suffix; - GIT_UNUSED_ARG(progress); + GIT_UNUSED(progress); switch (delta->status) { case GIT_STATUS_ADDED: code = 'A'; break; @@ -546,7 +546,7 @@ static int print_patch_file(void *data, git_diff_delta *delta, float progress) const char *newpfx = pi->diff->opts.dst_prefix; const char *newpath = delta->new.path; - GIT_UNUSED_ARG(progress); + GIT_UNUSED(progress); git_buf_clear(pi->buf); git_buf_printf(pi->buf, "diff --git %s%s %s%s\n", oldpfx, delta->old.path, newpfx, delta->new.path); @@ -593,8 +593,8 @@ static int print_patch_hunk( { diff_print_info *pi = data; - GIT_UNUSED_ARG(d); - GIT_UNUSED_ARG(r); + GIT_UNUSED(d); + GIT_UNUSED(r); git_buf_clear(pi->buf); @@ -613,7 +613,7 @@ static int print_patch_line( { diff_print_info *pi = data; - GIT_UNUSED_ARG(delta); + GIT_UNUSED(delta); git_buf_clear(pi->buf); -- cgit v1.2.1