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

3 messages from 2006-08-14 to 2006-08-14. Participants: dave rientjes, Junio C Hamano, David Rientjes.
Thread: https://gitlist.dev/t/5232

## dave rientjes, 2006-08-14 00:31

Subject: [PATCH] combine-diff.c remove unused return variable
Message-ID: <Pine.LNX.4.63.0608131730470.24283@chino.corp.google.com>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0608131730470.24283%40chino.corp.google.com

```
Removes unused return variable.

		David

Signed-off-by: David Rientjes <rientjes@google.com>

---
 combine-diff.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

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, 2006-08-14 01:01

Subject: Re: [PATCH] combine-diff.c remove unused return variable
Message-ID: <7voduogmfm.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7voduogmfm.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <Pine.LNX.4.63.0608131730470.24283@chino.corp.google.com>

```
dave rientjes <rientjes@google.com> writes:

> Removes unused return variable.

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


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, 2006-08-14 01:27

Subject: Re: [PATCH] combine-diff.c remove unused return variable
Message-ID: <9ec263480608131827j1a945016xaa9b7a1c8de41698@mail.google.com>
URL: https://gitlist.dev/e/9ec263480608131827j1a945016xaa9b7a1c8de41698%40mail.google.com
In-Reply-To: <7voduogmfm.fsf@assigned-by-dhcp.cox.net>

```
On 8/13/06, Junio C Hamano <junkio@cox.net> wrote:
> 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

```
