threads / patch / 5232

patchcombine-diff.c remove unused return variable

Subject: [PATCH] combine-diff.c remove unused return variable

## tl;dr

3 messages between Aug 14, 2006 and Aug 14, 2006. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

dave rientjes· Aug 14, 2006, 00:31 UTC · lore
Removes unused return variable.
		David
Signed-off-by: David Rientjes <rientjes@google.com>
---
 combine-diff.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Show changes to combine-diff.c +2 −2
diff --git a/combine-diff.c b/combine-diff.c
index ba8baca..ed85b0e 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -617,7 +617,7 @@ static int show_patch_diff(struct combin
 	char *result, *cp;
 	struct sline *sline; /* survived lines */
 	int mode_differs = 0;
-	int i, show_hunks, shown_header = 0;
+	int i, show_hunks;
 	int working_tree_file = !memcmp(elem->sha1, null_sha1, 20);
 	int abbrev = opt->full_index ? 40 : DEFAULT_ABBREV;
 	mmfile_t result_file;
@@ -769,7 +769,7 @@ static int show_patch_diff(struct combin
 	}
 	free(sline[0].p_lno);
 	free(sline);
-	return shown_header;
+	return 0;
 }
 
 #define COLONS "::::::::::::::::::::::::::::::::"
-- 
1.4.2.g182a
Junio C Hamano· Aug 14, 2006, 01:01 UTC · re: dave rientjes · lore

Re: [PATCH] combine-diff.c remove unused return variable

dave rientjes <rientjes@google.com> writes:
> Removes unused return variable.

True. Then making the function void would make more sense, like this?

Show changes to combine-diff.c +3 −4
diff --git a/combine-diff.c b/combine-diff.c
index ba8baca..f2f3806 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -609,15 +609,15 @@ static void dump_quoted_path(const char 
 	printf("%s\n", c_reset);
 }
 
-static int show_patch_diff(struct combine_diff_path *elem, int num_parent,
-			   int dense, struct rev_info *rev)
+static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
+			    int dense, struct rev_info *rev)
 {
 	struct diff_options *opt = &rev->diffopt;
 	unsigned long result_size, cnt, lno;
 	char *result, *cp;
 	struct sline *sline; /* survived lines */
 	int mode_differs = 0;
-	int i, show_hunks, shown_header = 0;
+	int i, show_hunks;
 	int working_tree_file = !memcmp(elem->sha1, null_sha1, 20);
 	int abbrev = opt->full_index ? 40 : DEFAULT_ABBREV;
 	mmfile_t result_file;
@@ -769,7 +769,6 @@ static int show_patch_diff(struct combin
 	}
 	free(sline[0].p_lno);
 	free(sline);
-	return shown_header;
 }
 
 #define COLONS "::::::::::::::::::::::::::::::::"
David Rientjes· Aug 14, 2006, 01:27 UTC · re: Junio C Hamano · lore

Re: [PATCH] combine-diff.c remove unused return variable

On 8/13/06, Junio C Hamano <junkio@cox.net> wrote:
Show 7 quoted lines
> dave rientjes <rientjes@google.com> writes:
>
> > Removes unused return variable.
>
> True.  Then making the function void would make more sense, like
> this?
>
Sure, as long as the author was not planning something for it later.
David

← back to recent threads