[PATCH 17/37] diff: rename 'new' variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rename C++ keyword in order to bring the codebase closer to being able
to be compiled with a C++ compiler.

Signed-off-by: Brandon Williams <bmwill@xxxxxxxxxx>
---
 diff.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/diff.c b/diff.c
index d682d0d1f..d49732b3b 100644
--- a/diff.c
+++ b/diff.c
@@ -1504,7 +1504,7 @@ struct diff_words_style_elem {
 
 struct diff_words_style {
 	enum diff_words_type type;
-	struct diff_words_style_elem new, old, ctx;
+	struct diff_words_style_elem new_word, old, ctx;
 	const char *newline;
 };
 
@@ -1660,7 +1660,7 @@ static void fn_out_diff_words_aux(void *priv, char *line, unsigned long len)
 	}
 	if (plus_begin != plus_end) {
 		fn_out_diff_words_write_helper(diff_words->opt,
-				&style->new, style->newline,
+				&style->new_word, style->newline,
 				plus_end - plus_begin, plus_begin);
 	}
 
@@ -1884,7 +1884,7 @@ static void init_diff_words_data(struct emit_callback *ecbdata,
 	if (want_color(o->use_color)) {
 		struct diff_words_style *st = ecbdata->diff_words->style;
 		st->old.color = diff_get_color_opt(o, DIFF_FILE_OLD);
-		st->new.color = diff_get_color_opt(o, DIFF_FILE_NEW);
+		st->new_word.color = diff_get_color_opt(o, DIFF_FILE_NEW);
 		st->ctx.color = diff_get_color_opt(o, DIFF_CONTEXT);
 	}
 }
@@ -2048,7 +2048,7 @@ static void fn_out_consume(void *priv, char *line, unsigned long len)
 static char *pprint_rename(const char *a, const char *b)
 {
 	const char *old = a;
-	const char *new = b;
+	const char *new_name = b;
 	struct strbuf name = STRBUF_INIT;
 	int pfx_length, sfx_length;
 	int pfx_adjust_for_slash;
@@ -2067,16 +2067,16 @@ static char *pprint_rename(const char *a, const char *b)
 
 	/* Find common prefix */
 	pfx_length = 0;
-	while (*old && *new && *old == *new) {
+	while (*old && *new_name && *old == *new_name) {
 		if (*old == '/')
 			pfx_length = old - a + 1;
 		old++;
-		new++;
+		new_name++;
 	}
 
 	/* Find common suffix */
 	old = a + len_a;
-	new = b + len_b;
+	new_name = b + len_b;
 	sfx_length = 0;
 	/*
 	 * If there is a common prefix, it must end in a slash.  In
@@ -2088,12 +2088,12 @@ static char *pprint_rename(const char *a, const char *b)
 	 */
 	pfx_adjust_for_slash = (pfx_length ? 1 : 0);
 	while (a + pfx_length - pfx_adjust_for_slash <= old &&
-	       b + pfx_length - pfx_adjust_for_slash <= new &&
-	       *old == *new) {
+	       b + pfx_length - pfx_adjust_for_slash <= new_name &&
+	       *old == *new_name) {
 		if (*old == '/')
 			sfx_length = len_a - (old - a);
 		old--;
-		new--;
+		new_name--;
 	}
 
 	/*
-- 
2.16.0.rc1.238.g530d649a79-goog




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux