From 9d160ba85539bbc593369f597a07d42c2770dff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicent=20Mart=C3=AD?= Date: Tue, 6 Mar 2012 01:37:56 +0100 Subject: diff: Fix rebase breackage --- tests-clar/diff/diff_helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests-clar/diff/diff_helpers.c') diff --git a/tests-clar/diff/diff_helpers.c b/tests-clar/diff/diff_helpers.c index d8eca7d9b..055bd4bc3 100644 --- a/tests-clar/diff/diff_helpers.c +++ b/tests-clar/diff/diff_helpers.c @@ -7,8 +7,8 @@ git_tree *resolve_commit_oid_to_tree( { size_t len = strlen(partial_oid); git_oid oid; - git_object *obj; - git_tree *tree; + git_object *obj = NULL; + git_tree *tree = NULL; if (git_oid_fromstrn(&oid, partial_oid, len) == 0) git_object_lookup_prefix(&obj, repo, &oid, len, GIT_OBJ_ANY); -- cgit v1.2.1 From 44ef8b1b300f0cd3d8572fa1b40d257462f28240 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Fri, 13 Apr 2012 13:00:10 -0700 Subject: Fix warnings on 64-bit windows builds This fixes all the warnings on win64 except those in deps, which come from the regex code. --- tests-clar/diff/diff_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests-clar/diff/diff_helpers.c') diff --git a/tests-clar/diff/diff_helpers.c b/tests-clar/diff/diff_helpers.c index 055bd4bc3..c9a633cd0 100644 --- a/tests-clar/diff/diff_helpers.c +++ b/tests-clar/diff/diff_helpers.c @@ -5,7 +5,7 @@ git_tree *resolve_commit_oid_to_tree( git_repository *repo, const char *partial_oid) { - size_t len = strlen(partial_oid); + unsigned int len = (unsigned int)strlen(partial_oid); git_oid oid; git_object *obj = NULL; git_tree *tree = NULL; -- cgit v1.2.1 From 1d2dd864add4835c49744a566c226a1c7da04e99 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Sun, 29 Apr 2012 19:42:51 +0200 Subject: diff: provide more context to the consumer of the callbacks Update the callback to provide some information related to the file change being processed and the range of the hunk, when applicable. --- tests-clar/diff/diff_helpers.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests-clar/diff/diff_helpers.c') diff --git a/tests-clar/diff/diff_helpers.c b/tests-clar/diff/diff_helpers.c index c9a633cd0..85dd52601 100644 --- a/tests-clar/diff/diff_helpers.c +++ b/tests-clar/diff/diff_helpers.c @@ -60,12 +60,14 @@ 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)range; (void)content; (void)content_len; e->lines++; -- cgit v1.2.1 From 2de0652bb6d719eb937656153a920f20342bd5a4 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Mon, 30 Apr 2012 07:41:33 +0200 Subject: Leverage GIT_UNUSED macro to explicitly mark a function parameter as purposely unused --- tests-clar/diff/diff_helpers.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'tests-clar/diff/diff_helpers.c') diff --git a/tests-clar/diff/diff_helpers.c b/tests-clar/diff/diff_helpers.c index 85dd52601..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; @@ -66,10 +70,12 @@ int diff_line_fn( size_t content_len) { diff_expects *e = cb_data; - (void)delta; - (void)range; - (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: -- cgit v1.2.1