summaryrefslogtreecommitdiff
path: root/tests-clar/diff/diff_helpers.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-04-30 13:32:09 -0700
committerRussell Belfer <rb@github.com>2012-04-30 13:32:09 -0700
commit0dc8e95e1940017a9d6e8f5b13cf9a9ad644fc08 (patch)
tree49eed9a80b9e506953d18271bd03ae23558f29da /tests-clar/diff/diff_helpers.c
parent8b9ec201edf157f84735b8d220c10edafd9f4b5a (diff)
parent2de0652bb6d719eb937656153a920f20342bd5a4 (diff)
downloadlibgit2-0dc8e95e1940017a9d6e8f5b13cf9a9ad644fc08.tar.gz
Merge pull request #652 from nulltoken/topic/diff-callbacks
diff: provide more context to the consumer of the callbacks
Diffstat (limited to 'tests-clar/diff/diff_helpers.c')
-rw-r--r--tests-clar/diff/diff_helpers.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/tests-clar/diff/diff_helpers.c b/tests-clar/diff/diff_helpers.c
index c9a633cd0..74a44ab99 100644
--- a/tests-clar/diff/diff_helpers.c
+++ b/tests-clar/diff/diff_helpers.c
@@ -27,7 +27,9 @@ int diff_file_fn(
float progress)
{
diff_expects *e = cb_data;
- (void)progress;
+
+ GIT_UNUSED(progress);
+
e->files++;
switch (delta->status) {
case GIT_DELTA_ADDED: e->file_adds++; break;
@@ -48,9 +50,11 @@ int diff_hunk_fn(
size_t header_len)
{
diff_expects *e = cb_data;
- (void)delta;
- (void)header;
- (void)header_len;
+
+ GIT_UNUSED(delta);
+ GIT_UNUSED(header);
+ GIT_UNUSED(header_len);
+
e->hunks++;
e->hunk_old_lines += range->old_lines;
e->hunk_new_lines += range->new_lines;
@@ -60,14 +64,18 @@ int diff_hunk_fn(
int diff_line_fn(
void *cb_data,
git_diff_delta *delta,
+ git_diff_range *range,
char line_origin,
const char *content,
size_t content_len)
{
diff_expects *e = cb_data;
- (void)delta;
- (void)content;
- (void)content_len;
+
+ GIT_UNUSED(delta);
+ GIT_UNUSED(range);
+ GIT_UNUSED(content);
+ GIT_UNUSED(content_len);
+
e->lines++;
switch (line_origin) {
case GIT_DIFF_LINE_CONTEXT: