socsvn commit: r237727 - in soc2012/jhagewood/diff3: . diff3

jhagewood at FreeBSD.org jhagewood at FreeBSD.org
Thu Jun 14 21:04:44 UTC 2012


Author: jhagewood
Date: Thu Jun 14 21:04:41 2012
New Revision: 237727
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237727

Log:

Modified:
  soc2012/jhagewood/diff3/diff3/diff3prog.c
  soc2012/jhagewood/diff3/hagewood-diff3.patch

Modified: soc2012/jhagewood/diff3/diff3/diff3prog.c
==============================================================================
--- soc2012/jhagewood/diff3/diff3/diff3prog.c	Thu Jun 14 20:49:22 2012	(r237726)
+++ soc2012/jhagewood/diff3/diff3/diff3prog.c	Thu Jun 14 21:04:41 2012	(r237727)
@@ -64,10 +64,6 @@
  *	@(#)diff3.c	8.1 (Berkeley) 6/6/93
  */
 
-#ifdef __FreeBSD__
-#define __dead2
-#endif
-
 #if 0
 #ifndef lint
 static char sccsid[] = "@(#)diff3.c	8.1 (Berkeley) 6/6/93";
@@ -281,7 +277,7 @@
  * since the vector is processed in one sequential pass.
  * The vector could be optimized out of existence)
  */
-int
+static int
 readin(char *name, struct diff **dd)
 {
 	int a, b, c, d, i;
@@ -323,7 +319,7 @@
 	return (i);
 }
 
-int
+static int
 number(char **lc)
 {
 	int nn;
@@ -334,7 +330,7 @@
 	return (nn);
 }
 
-char *
+static char *
 getchange(FILE *b)
 {
 	char *line;
@@ -346,7 +342,7 @@
 	return (NULL);
 }
 
-char *
+static char *
 getline(FILE *b, size_t *n)
 {
 	char *cp;
@@ -374,7 +370,7 @@
 	return (buf);
 }
 
-void
+static void
 merge(int m1, int m2)
 {
 	struct diff *d1, *d2, *d3;
@@ -501,7 +497,7 @@
 	return (1);
 }
 
-void
+static void
 separate(const char *s)
 {
 	
@@ -513,7 +509,7 @@
  * It is to be printed only if it does not duplicate something to be
  * printed later.
  */
-void
+static void
 change(int i, struct range *rold, int dup)
 {
 	
@@ -531,7 +527,7 @@
  * print the range of line numbers, rold.from thru rold.to, as n1,n2 or 
  * n1.
  */
-void
+static void
 prange(struct range *rold)
 {
 	
@@ -550,7 +546,7 @@
  * and an artificial dummy difference (trange) must be ginned up to
  * correspond to the change reported in the other file.
  */
-void
+static void
 keep(int i, struct range *rnew)
 {
 	int delta;
@@ -566,7 +562,7 @@
  * skip to just before line number from in file "i".  If "pr" is non-NULL,
  * print all skipped stuff with string pr as a prefix.
  */
-int
+static int
 skip(int i, int from, char *pr)
 {
 	size_t j, n;
@@ -586,7 +582,7 @@
  * Return 1 or 0 according as the old range (in file 1) contains exactly
  * the same data as the new range (in file 2).
  */
-int
+static int
 duplicate(struct range *r1, struct range *r2)
 {
 	int c, d;
@@ -615,7 +611,7 @@
 	return (1);
 }
 
-void
+static void
 repos(int nchar)
 {
 	int i;
@@ -625,7 +621,7 @@
 }
 
 /* If file has trailing carriage return, remove it. */
-void
+static void
 remove_cr(FILE *f) 
 {
 	char ch; 
@@ -647,7 +643,7 @@
 	rewind(f);
 }
 
-void
+static void
 trouble(void)
 {
 	
@@ -657,7 +653,7 @@
 /*
  * collect an editing script for later regurgitation
  */
-int
+static int
 edit(struct diff *diff, int dup, int j)
 {
 	
@@ -675,7 +671,7 @@
 }
 
 /* regurgitate */
-void
+static void
 edscript(int n)
 {
 	int j, k;
@@ -706,7 +702,7 @@
 	exit(overlapcnt);
 }
 
-void
+static void
 increase(void)
 {
 	struct diff *p;
@@ -740,7 +736,7 @@
 	szchanges = newsz;
 }
 
-void 
+static void 
 help(void)
 {
 	
@@ -759,7 +755,7 @@
 		"\t--help  Output this help.\n\n");	
 }
 
-void
+static void
 usage(void)
 {
 	

Modified: soc2012/jhagewood/diff3/hagewood-diff3.patch
==============================================================================
--- soc2012/jhagewood/diff3/hagewood-diff3.patch	Thu Jun 14 20:49:22 2012	(r237726)
+++ soc2012/jhagewood/diff3/hagewood-diff3.patch	Thu Jun 14 21:04:41 2012	(r237727)
@@ -11,23 +11,21 @@
  .include <bsd.prog.mk>
 diff -rupN jhagewood/diff3/diff3-orig/diff3prog.c jhagewood/diff3/diff3/diff3prog.c
 --- jhagewood/diff3/diff3-orig/diff3prog.c	2012-06-14 05:32:21.000000000 -0400
-+++ jhagewood/diff3/diff3/diff3prog.c	2012-06-14 06:08:56.000000000 -0400
-@@ -65,18 +65,26 @@
++++ jhagewood/diff3/diff3/diff3prog.c	2012-06-14 21:04:21.000000000 -0400
+@@ -64,19 +64,23 @@
+  *	@(#)diff3.c	8.1 (Berkeley) 6/6/93
   */
  
- #ifdef __FreeBSD__
+-#ifdef __FreeBSD__
 -#define __dead
-+#define __dead2
- #endif
- 
 +#if 0
 +#ifndef lint
 +static char sccsid[] = "@(#)diff3.c	8.1 (Berkeley) 6/6/93";
-+#endif
+ #endif
 +#endif /* not lint */
 +#include <sys/cdefs.h>
-+__FBSDID("$FreeBSD: soc2012/jhagewood/diff3/diff3/diff3prog.c 237662 2012-06-14 05:32:59Z jhagewood $");
-+
++__FBSDID("$FreeBSD: soc2012/jhagewood/diff3/diff3/diff3prog.c 237663 2012-06-14 06:11:59Z jhagewood $");
+ 
 +#include <ctype.h>
 +#include <err.h>
 +#include <errno.h>
@@ -45,7 +43,7 @@
  #include <wchar.h>
  #include <wctype.h>
  
-@@ -134,48 +142,52 @@ int strip_cr;
+@@ -134,48 +138,52 @@ int strip_cr;
  int debug  = 0;
  char f1mark[40], f2mark[40], f3mark[40];	/* markers for -E and -X */
  
@@ -121,7 +119,7 @@
  };
  
  
-@@ -216,12 +228,18 @@ main(int argc, char **argv)
+@@ -216,12 +224,18 @@ main(int argc, char **argv)
  		case 'X':
  			oflag = eflag = 1;
  			break;
@@ -140,7 +138,7 @@
  		case STRIPCR_OPT:
  			strip_cr = 1;
  			break;
-@@ -233,27 +251,25 @@ main(int argc, char **argv)
+@@ -233,27 +247,25 @@ main(int argc, char **argv)
  	argc -= optind;
  	argv += optind;
  	/* XXX - argc usage seems wrong here */
@@ -178,7 +176,21 @@
  	}
  	merge(m, n);
  	exit(EXIT_SUCCESS);
-@@ -311,6 +327,7 @@ int
+@@ -265,7 +277,7 @@ main(int argc, char **argv)
+  * since the vector is processed in one sequential pass.
+  * The vector could be optimized out of existence)
+  */
+-int
++static int
+ readin(char *name, struct diff **dd)
+ {
+ 	int a, b, c, d, i;
+@@ -307,17 +319,18 @@ readin(char *name, struct diff **dd)
+ 	return (i);
+ }
+ 
+-int
++static int
  number(char **lc)
  {
  	int nn;
@@ -186,7 +198,33 @@
  	nn = 0;
  	while (isdigit((unsigned char)(**lc)))
  		nn = nn*10 + *(*lc)++ - '0';
-@@ -367,8 +384,7 @@ merge(int m1, int m2)
+ 	return (nn);
+ }
+ 
+-char *
++static char *
+ getchange(FILE *b)
+ {
+ 	char *line;
+@@ -329,7 +342,7 @@ getchange(FILE *b)
+ 	return (NULL);
+ }
+ 
+-char *
++static char *
+ getline(FILE *b, size_t *n)
+ {
+ 	char *cp;
+@@ -357,7 +370,7 @@ getline(FILE *b, size_t *n)
+ 	return (buf);
+ }
+ 
+-void
++static void
+ merge(int m1, int m2)
+ {
+ 	struct diff *d1, *d2, *d3;
+@@ -367,8 +380,7 @@ merge(int m1, int m2)
  	d2 = d23;
  	j = 0;
  
@@ -196,7 +234,7 @@
  		printf("Binary file detected; comparison failed\n");
  		exit(EXIT_FAILURE);
  	}
-@@ -466,29 +482,29 @@ merge(int m1, int m2)
+@@ -466,29 +478,29 @@ merge(int m1, int m2)
  static int
  asciifile(FILE *f)
  {
@@ -236,22 +274,27 @@
 +	return (1);
  }
  
- void
+-void
++static void
  separate(const char *s)
  {
 +	
  	printf("====%s\n", s);
  }
  
-@@ -500,6 +516,7 @@ separate(const char *s)
- void
+@@ -497,9 +509,10 @@ separate(const char *s)
+  * It is to be printed only if it does not duplicate something to be
+  * printed later.
+  */
+-void
++static void
  change(int i, struct range *rold, int dup)
  {
 +	
  	printf("%d:", i);
  	last[i] = rold->to;
  	prange(rold);
-@@ -510,12 +527,14 @@ change(int i, struct range *rold, int du
+@@ -510,12 +523,14 @@ change(int i, struct range *rold, int du
  	(void)skip(i, rold->to, "  ");
  }
  
@@ -261,14 +304,33 @@
 + * print the range of line numbers, rold.from thru rold.to, as n1,n2 or 
 + * n1.
   */
- void
+-void
++static void
  prange(struct range *rold)
  {
 +	
  	if (rold->to <= rold->from)
  		printf("%da\n", rold->from - 1);
  	else {
-@@ -558,7 +577,6 @@ skip(int i, int from, char *pr)
+@@ -531,7 +546,7 @@ prange(struct range *rold)
+  * and an artificial dummy difference (trange) must be ginned up to
+  * correspond to the change reported in the other file.
+  */
+-void
++static void
+ keep(int i, struct range *rnew)
+ {
+ 	int delta;
+@@ -547,7 +562,7 @@ keep(int i, struct range *rnew)
+  * skip to just before line number from in file "i".  If "pr" is non-NULL,
+  * print all skipped stuff with string pr as a prefix.
+  */
+-int
++static int
+ skip(int i, int from, char *pr)
+ {
+ 	size_t j, n;
+@@ -558,7 +573,6 @@ skip(int i, int from, char *pr)
  			trouble();
  		if (pr != NULL)
  			printf("%s%s", Tflag == 1? "\t" : pr, line);
@@ -276,8 +338,12 @@
  		cline[i]++;
  	}
  	return ((int) n);
-@@ -571,7 +589,7 @@ skip(int i, int from, char *pr)
- int
+@@ -568,10 +582,10 @@ skip(int i, int from, char *pr)
+  * Return 1 or 0 according as the old range (in file 1) contains exactly
+  * the same data as the new range (in file 2).
+  */
+-int
++static int
  duplicate(struct range *r1, struct range *r2)
  {
 -	int c,d;
@@ -285,13 +351,22 @@
  	int nchar;
  	int nline;
  
-@@ -606,9 +624,33 @@ repos(int nchar)
+@@ -597,7 +611,7 @@ duplicate(struct range *r1, struct range
+ 	return (1);
+ }
+ 
+-void
++static void
+ repos(int nchar)
+ {
+ 	int i;
+@@ -606,18 +620,43 @@ repos(int nchar)
  		(void)fseek(fp[i], (long)-nchar, SEEK_CUR);
  }
  
 -__dead void
 +/* If file has trailing carriage return, remove it. */
-+void
++static void
 +remove_cr(FILE *f) 
 +{
 +	char ch; 
@@ -313,27 +388,30 @@
 +	rewind(f);
 +}
 +
-+void
++static void
  trouble(void)
  {
 +	
  	errx(EXIT_FAILURE, "logic error");
  }
  
-@@ -618,6 +660,7 @@ trouble(void)
- int
+ /*
+  * collect an editing script for later regurgitation
+  */
+-int
++static int
  edit(struct diff *diff, int dup, int j)
  {
 +	
  	if (((dup + 1) & eflag) == 0)
  		return (j);
  	j++;
-@@ -632,10 +675,10 @@ edit(struct diff *diff, int dup, int j)
+@@ -632,10 +671,10 @@ edit(struct diff *diff, int dup, int j)
  }
  
  /* regurgitate */
 -__dead void
-+void
++static void
  edscript(int n)
  {
 -	int j,k;
@@ -341,7 +419,7 @@
  	char block[BUFSIZ];
  
  	for (n = n; n > 0; n--) {
-@@ -657,8 +700,7 @@ edscript(int n)
+@@ -657,14 +696,13 @@ edscript(int n)
  			printf("%da\n%s\n.\n", de[n].old.from - 1, f1mark);
  		}
  	}
@@ -351,11 +429,18 @@
  		printf("w\nq\n");
  
  	exit(overlapcnt);
-@@ -698,13 +740,29 @@ increase(void)
+ }
+ 
+-void
++static void
+ increase(void)
+ {
+ 	struct diff *p;
+@@ -698,13 +736,29 @@ increase(void)
  	szchanges = newsz;
  }
  
-+void 
++static void 
 +help(void)
 +{
 +	
@@ -375,7 +460,7 @@
 +}
  
 -__dead void
-+void
++static void
  usage(void)
  {
 -	extern char *__progname;


More information about the svn-soc-all mailing list