All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timo Hirvonen <tihirvon@gmail.com>
To: junkio@cox.net
Cc: git@vger.kernel.org
Subject: [PATCH 1/7] Clean up diff.c
Date: Sat, 24 Jun 2006 20:20:32 +0300	[thread overview]
Message-ID: <20060624202032.ec7203d8.tihirvon@gmail.com> (raw)
In-Reply-To: <20060624201843.a5b4f7b9.tihirvon@gmail.com>


Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
---
 diff.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/diff.c b/diff.c
index ad77543..f358546 100644
--- a/diff.c
+++ b/diff.c
@@ -203,7 +203,7 @@ static void emit_rewrite_diff(const char
 static int fill_mmfile(mmfile_t *mf, struct diff_filespec *one)
 {
 	if (!DIFF_FILE_VALID(one)) {
-		mf->ptr = ""; /* does not matter */
+		mf->ptr = (char *)""; /* does not matter */
 		mf->size = 0;
 		return 0;
 	}
@@ -395,7 +395,7 @@ static void show_stats(struct diffstat_t
 	}
 
 	for (i = 0; i < data->nr; i++) {
-		char *prefix = "";
+		const char *prefix = "";
 		char *name = data->files[i]->name;
 		int added = data->files[i]->added;
 		int deleted = data->files[i]->deleted;
@@ -918,7 +918,7 @@ int diff_populate_filespec(struct diff_f
 			err_empty:
 				err = -1;
 			empty:
-				s->data = "";
+				s->data = (char *)"";
 				s->size = 0;
 				return err;
 			}
@@ -1409,7 +1409,7 @@ int diff_setup_done(struct diff_options 
 	return 0;
 }
 
-int opt_arg(const char *arg, int arg_short, const char *arg_long, int *val)
+static int opt_arg(const char *arg, int arg_short, const char *arg_long, int *val)
 {
 	char c, *eq;
 	int len;
@@ -1725,16 +1725,12 @@ static void diff_flush_raw(struct diff_f
 		free((void*)path_two);
 }
 
-static void diff_flush_name(struct diff_filepair *p,
-			    int inter_name_termination,
-			    int line_termination)
+static void diff_flush_name(struct diff_filepair *p, int line_termination)
 {
 	char *path = p->two->path;
 
 	if (line_termination)
 		path = quote_one(p->two->path);
-	else
-		path = p->two->path;
 	printf("%s%c", path, line_termination);
 	if (p->two->path != path)
 		free(path);
@@ -1955,9 +1951,7 @@ static void flush_one_pair(struct diff_f
 				       options, diff_output_format);
 			break;
 		case DIFF_FORMAT_NAME:
-			diff_flush_name(p,
-					inter_name_termination,
-					line_termination);
+			diff_flush_name(p, line_termination);
 			break;
 		case DIFF_FORMAT_NO_OUTPUT:
 			break;
-- 
1.4.1.rc1.g8637

  reply	other threads:[~2006-06-24 17:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-24 17:18 [PATCH 0/7] Rework diff options Timo Hirvonen
2006-06-24 17:20 ` Timo Hirvonen [this message]
2006-06-24 17:21 ` [PATCH 2/7] Merge with_raw, with_stat and summary variables to output_format Timo Hirvonen
2006-06-24 20:52   ` Johannes Schindelin
2006-06-24 21:56     ` Timo Hirvonen
2006-06-24 23:20       ` Johannes Schindelin
2006-06-25 10:54   ` [PATCH] Add msg_sep to diff_options Timo Hirvonen
2006-06-25 11:40     ` Junio C Hamano
2006-06-25 11:11   ` [PATCH] whatchanged: Default to DIFF_FORMAT_RAW Timo Hirvonen
2006-06-25 11:55     ` Junio C Hamano
2006-06-25 12:39       ` Timo Hirvonen
2006-06-25 11:28   ` [PATCH] Don't xcalloc() struct diffstat_t Timo Hirvonen
2006-06-24 17:23 ` [PATCH 3/7] Make --raw option available for all diff commands Timo Hirvonen
2006-06-24 17:24 ` [PATCH 4/7] Set default diff output format after parsing command line Timo Hirvonen
2006-06-24 17:25 ` [PATCH 5/7] DIFF_FORMAT_RAW is not default anymore Timo Hirvonen
2006-06-24 17:26 ` [PATCH 6/7] --name-only, --name-status, --check and -s are mutually exclusive Timo Hirvonen
2006-06-24 17:28 ` [PATCH 7/7] Remove awkward compatibility warts Timo Hirvonen
2006-06-25  3:48 ` [PATCH 0/7] Rework diff options Junio C Hamano
2006-06-25 11:13   ` Timo Hirvonen
2006-06-26 18:24   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060624202032.ec7203d8.tihirvon@gmail.com \
    --to=tihirvon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.