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

[PATCH 3/7] cleanups: Remove unused vars from combine-diff.c

From
SHSerge E. Hallyn <serue@us.ibm.com>
Date
Apr 17, 2006, 15:14 UTC
Message-ID
<20060417151447.EC97F19B8FD@sergelap.hallyn.com>
In-Reply-To
<20060417145148.2F3CB19C90D@sergelap.hallyn.com>
Mod_type in particular sure looks like it wants to be used, but isn't.
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
---
 combine-diff.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)
5a7c4023402dd2420a4596cdd92a1a46fd3e5c14
diff --git a/combine-diff.c b/combine-diff.c
index 9bd27f8..9445e86 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -589,7 +589,7 @@ static int show_patch_diff(struct combin
 			   struct diff_options *opt)
 {
 	unsigned long result_size, cnt, lno;
-	char *result, *cp, *ep;
+	char *result, *cp;
 	struct sline *sline; /* survived lines */
 	int mode_differs = 0;
 	int i, show_hunks, shown_header = 0;
@@ -641,7 +641,6 @@ static int show_patch_diff(struct combin
 		cnt++; /* incomplete line */
 
 	sline = xcalloc(cnt+2, sizeof(*sline));
-	ep = result;
 	sline[0].bol = result;
 	for (lno = 0; lno <= cnt + 1; lno++) {
 		sline[lno].lost_tail = &sline[lno].lost_head;
@@ -752,7 +751,7 @@ static int show_patch_diff(struct combin
 
 static void show_raw_diff(struct combine_diff_path *p, int num_parent, const char *header, struct diff_options *opt)
 {
-	int i, offset, mod_type = 'A';
+	int i, offset;
 	const char *prefix;
 	int line_termination, inter_name_termination;
 
@@ -764,13 +763,6 @@ static void show_raw_diff(struct combine
 	if (header)
 		printf("%s%c", header, line_termination);
 
-	for (i = 0; i < num_parent; i++) {
-		if (p->parent[i].mode)
-			mod_type = 'M';
-	}
-	if (!p->mode)
-		mod_type = 'D';
-
 	if (opt->output_format == DIFF_FORMAT_RAW) {
 		offset = strlen(COLONS) - num_parent;
 		if (offset < 0)
-- 
1.2.5
Previous: Serge E. HallynNext: Serge E. Hallyn
Message 7 of 13 in “cleanups: intro”
  1. 0/7 cleanups: introSerge E. Hallyn, Apr 17, 2006
  2. 1/7 cleanups: Fix resource leak and buffer overrun in daemon.cSerge E. Hallyn, Apr 17, 2006
  3. Junio C HamanoApr 17, 2006
  4. Serge E. HallynApr 18, 2006
  5. Junio C HamanoApr 18, 2006
  6. 2/7 cleanups: Fix potential bugs in connect.cSerge E. Hallyn, Apr 17, 2006
  7. 3/7 cleanups: Remove unused vars from combine-diff.cSerge E. Hallyn, Apr 17, 2006
  8. 5/7 cleanups: Remove unused variable from sha1_file.cSerge E. Hallyn, Apr 17, 2006
  9. Junio C HamanoApr 17, 2006
  10. 6/7 cleanups: prevent leak of two strduped strings in config.cSerge E. Hallyn, Apr 17, 2006
  11. 4/7 cleanups: Remove impossible case in quote.cSerge E. Hallyn, Apr 17, 2006
  12. 7/7 cleanups: remove unused variable from exec_cmd.cSerge E. Hallyn, Apr 17, 2006
  13. Junio C HamanoApr 17, 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.