summaryrefslogtreecommitdiff
path: root/combine-diff.c
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-04-12 17:15:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-11 03:47:31 (GMT)
commita8d5eb6dc0d61625667b0d8155c425d3629baa12 (patch)
treecc6c90e47a90860c813c289b1bdba90826f80dd9 /combine-diff.c
parent5b0672a26e51387bc18adad89eaa3ebb131b2e33 (diff)
downloadgit-a8d5eb6dc0d61625667b0d8155c425d3629baa12.zip
git-a8d5eb6dc0d61625667b0d8155c425d3629baa12.tar.gz
git-a8d5eb6dc0d61625667b0d8155c425d3629baa12.tar.bz2
xdiff-interface: prepare for allowing early return
Change the function prototype of xdiff_emit_line_fn to return an "int" instead of "void". Change all of those functions to "return 0", nothing checks those return values yet, and no behavior is being changed. In subsequent commits the interface will be changed to allow early return via this new return value. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'combine-diff.c')
-rw-r--r--combine-diff.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/combine-diff.c b/combine-diff.c
index 06635f9..a12d3bc 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -403,11 +403,11 @@ static void consume_hunk(void *state_,
state->sline[state->nb-1].p_lno[state->n] = state->ob;
}
-static void consume_line(void *state_, char *line, unsigned long len)
+static int consume_line(void *state_, char *line, unsigned long len)
{
struct combine_diff_state *state = state_;
if (!state->lost_bucket)
- return; /* not in any hunk yet */
+ return 0; /* not in any hunk yet */
switch (line[0]) {
case '-':
append_lost(state->lost_bucket, state->n, line+1, len-1);
@@ -417,6 +417,7 @@ static void consume_line(void *state_, char *line, unsigned long len)
state->lno++;
break;
}
+ return 0;
}
static void combine_diff(struct repository *r,