git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <junkio@cox.net>
Date
Aug 14, 2006, 01:01 UTC
Message-ID
<7voduogmfm.fsf@assigned-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 "::::::::::::::::::::::::::::::::"
Previous: dave rientjesNext: David Rientjes
Message 2 of 3 in “combine-diff.c remove unused return variable”
  1. combine-diff.c remove unused return variabledave rientjes, Aug 14, 2006
  2. Junio C HamanoAug 14, 2006
  3. David RientjesAug 14, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.