Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jun 2012 06:12:00 +0000
From:      jhagewood@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r237663 - in soc2012/jhagewood/diff3: . diff3
Message-ID:  <20120614061200.7B63C1065670@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhagewood
Date: Thu Jun 14 06:11:59 2012
New Revision: 237663
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237663

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 05:32:59 2012	(r237662)
+++ soc2012/jhagewood/diff3/diff3/diff3prog.c	Thu Jun 14 06:11:59 2012	(r237663)
@@ -64,6 +64,9 @@
  *	@(#)diff3.c	8.1 (Berkeley) 6/6/93
  */
 
+#ifdef __FreeBSD__
+#define __dead2
+#endif
 
 #if 0
 #ifndef lint
@@ -153,12 +156,12 @@
 static void prange(struct range *);
 static void repos(int);
 static void separate(const char *);
-static __dead2 edscript(int);
+static void edscript(int) __dead2;
 static void remove_cr(FILE *);
-static __dead2 trouble(void);
+static void trouble(void) __dead2;
 static void increase(void);
 static void help(void);
-static __dead2 usage(void);
+static void usage(void) __dead2;
 
 enum {  
         HELP_OPT = CHAR_MAX + 1,
@@ -166,10 +169,6 @@
         DIFFPROG_OPT,
 };
 
-#ifdef __FreeBSD__
-#define __dead2
-#endif
-
 #define OPTIONS "3aAeEiL:mTvxX"
 static struct option longopts[] = {
     { "ed",    		no_argument,		NULL,   'e' },
@@ -230,7 +229,7 @@
 			oflag = eflag = 1;
 			break;
 		case 'v':
-			printf("OpenBSD diff3  1.11-FreeBSD",);
+			printf("OpenBSD diff3  1.11-FreeBSD");
 			exit(0);
 		case 'x':
 			eflag = 1;
@@ -648,7 +647,7 @@
 	rewind(f);
 }
 
-__dead2
+void
 trouble(void)
 {
 	
@@ -676,7 +675,7 @@
 }
 
 /* regurgitate */
-__dead2
+void
 edscript(int n)
 {
 	int j, k;
@@ -745,23 +744,22 @@
 help(void)
 {
 	
-	printf ("%s", "\
-	-e  --ed  Output unmerged changes from OLDFILE to YOURFILE into MYFILE.\n\
-	-A  --show-all  Output all changes, bracketing conflicts.\n\
-	-x  --overlap-only  Output overlapping changes.\n\
-	-3  --easy-only  Output unmerged nonoverlapping changes.\n\n");
-	printf ("%s", "\
-	-m  --merge  Output merged file instead of ed script (default -A).\n\
-	-L LABEL  --label=LABEL  Use LABEL instead of file name.\n\
-	-a  --text  Treat all files as text.\n\
-	-T  --initial-tab  Make tabs line up by prepending a tab.\n\n");
-	printf ("%s", "\
-	-v  --version  Output version info.\n\
-	--help  Output this help.\n\n");
-	
+	printf("%s%s%s%s", 
+		"\t-e  --ed  Output unmerged changes from OLDFILE to YOURFILE into MYFILE.\n",
+		"\t-A  --show-all  Output all changes, bracketing conflicts.\n",
+		"\t-x  --overlap-only  Output overlapping changes.\n",
+		"\t-3  --easy-only  Output unmerged nonoverlapping changes.\n\n");
+	printf("%s%s%s%s", 
+		"\t-m  --merge  Output merged file instead of ed script (default -A).\n",
+		"\t-L LABEL  --label=LABEL  Use LABEL instead of file name.\n",
+		"\t-a  --text  Treat all files as text.\n",
+		"\t-T  --initial-tab  Make tabs line up by prepending a tab.\n\n");
+	printf("%s%s",
+		"\t-v  --version  Output version info.\n",
+		"\t--help  Output this help.\n\n");	
 }
 
-__dead2
+void
 usage(void)
 {
 	

Modified: soc2012/jhagewood/diff3/hagewood-diff3.patch
==============================================================================
--- soc2012/jhagewood/diff3/hagewood-diff3.patch	Thu Jun 14 05:32:59 2012	(r237662)
+++ soc2012/jhagewood/diff3/hagewood-diff3.patch	Thu Jun 14 06:11:59 2012	(r237663)
@@ -11,22 +11,23 @@
  .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 05:31:22.000000000 -0400
-@@ -64,19 +64,24 @@
-  *	@(#)diff3.c	8.1 (Berkeley) 6/6/93
++++ jhagewood/diff3/diff3/diff3prog.c	2012-06-14 06:08:56.000000000 -0400
+@@ -65,18 +65,26 @@
   */
  
--#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 237623 2012-06-13 19:37:41Z jhagewood $");
- 
++__FBSDID("$FreeBSD: soc2012/jhagewood/diff3/diff3/diff3prog.c 237662 2012-06-14 05:32:59Z jhagewood $");
++
 +#include <ctype.h>
 +#include <err.h>
 +#include <errno.h>
@@ -44,7 +45,7 @@
  #include <wchar.h>
  #include <wctype.h>
  
-@@ -134,48 +139,56 @@ int strip_cr;
+@@ -134,48 +142,52 @@ int strip_cr;
  int debug  = 0;
  char f1mark[40], f2mark[40], f3mark[40];	/* markers for -E and -X */
  
@@ -79,12 +80,12 @@
 +static void prange(struct range *);
 +static void repos(int);
 +static void separate(const char *);
-+static __dead2 edscript(int);
++static void edscript(int) __dead2;
 +static void remove_cr(FILE *);
-+static __dead2 trouble(void);
++static void trouble(void) __dead2;
 +static void increase(void);
 +static void help(void);
-+static __dead2 usage(void);
++static void usage(void) __dead2;
  
  enum {  
          HELP_OPT = CHAR_MAX + 1,
@@ -93,10 +94,6 @@
 +        DIFFPROG_OPT,
  };
  
-+#ifdef __FreeBSD__
-+#define __dead2
-+#endif
-+
  #define OPTIONS "3aAeEiL:mTvxX"
  static struct option longopts[] = {
 -        { "ed",    		no_argument,		NULL,   'e' },
@@ -124,12 +121,12 @@
  };
  
  
-@@ -216,12 +229,18 @@ main(int argc, char **argv)
+@@ -216,12 +228,18 @@ main(int argc, char **argv)
  		case 'X':
  			oflag = eflag = 1;
  			break;
 +		case 'v':
-+			printf("OpenBSD diff3  1.11-FreeBSD",);
++			printf("OpenBSD diff3  1.11-FreeBSD");
 +			exit(0);
  		case 'x':
  			eflag = 1;
@@ -143,7 +140,7 @@
  		case STRIPCR_OPT:
  			strip_cr = 1;
  			break;
-@@ -233,27 +252,25 @@ main(int argc, char **argv)
+@@ -233,27 +251,25 @@ main(int argc, char **argv)
  	argc -= optind;
  	argv += optind;
  	/* XXX - argc usage seems wrong here */
@@ -181,7 +178,7 @@
  	}
  	merge(m, n);
  	exit(EXIT_SUCCESS);
-@@ -311,6 +328,7 @@ int
+@@ -311,6 +327,7 @@ int
  number(char **lc)
  {
  	int nn;
@@ -189,7 +186,7 @@
  	nn = 0;
  	while (isdigit((unsigned char)(**lc)))
  		nn = nn*10 + *(*lc)++ - '0';
-@@ -367,8 +385,7 @@ merge(int m1, int m2)
+@@ -367,8 +384,7 @@ merge(int m1, int m2)
  	d2 = d23;
  	j = 0;
  
@@ -199,7 +196,7 @@
  		printf("Binary file detected; comparison failed\n");
  		exit(EXIT_FAILURE);
  	}
-@@ -466,29 +483,29 @@ merge(int m1, int m2)
+@@ -466,29 +482,29 @@ merge(int m1, int m2)
  static int
  asciifile(FILE *f)
  {
@@ -246,7 +243,7 @@
  	printf("====%s\n", s);
  }
  
-@@ -500,6 +517,7 @@ separate(const char *s)
+@@ -500,6 +516,7 @@ separate(const char *s)
  void
  change(int i, struct range *rold, int dup)
  {
@@ -254,7 +251,7 @@
  	printf("%d:", i);
  	last[i] = rold->to;
  	prange(rold);
-@@ -510,12 +528,14 @@ change(int i, struct range *rold, int du
+@@ -510,12 +527,14 @@ change(int i, struct range *rold, int du
  	(void)skip(i, rold->to, "  ");
  }
  
@@ -271,7 +268,7 @@
  	if (rold->to <= rold->from)
  		printf("%da\n", rold->from - 1);
  	else {
-@@ -558,7 +578,6 @@ skip(int i, int from, char *pr)
+@@ -558,7 +577,6 @@ skip(int i, int from, char *pr)
  			trouble();
  		if (pr != NULL)
  			printf("%s%s", Tflag == 1? "\t" : pr, line);
@@ -279,7 +276,7 @@
  		cline[i]++;
  	}
  	return ((int) n);
-@@ -571,7 +590,7 @@ skip(int i, int from, char *pr)
+@@ -571,7 +589,7 @@ skip(int i, int from, char *pr)
  int
  duplicate(struct range *r1, struct range *r2)
  {
@@ -288,7 +285,7 @@
  	int nchar;
  	int nline;
  
-@@ -606,9 +625,33 @@ repos(int nchar)
+@@ -606,9 +624,33 @@ repos(int nchar)
  		(void)fseek(fp[i], (long)-nchar, SEEK_CUR);
  }
  
@@ -316,14 +313,14 @@
 +	rewind(f);
 +}
 +
-+__dead2
++void
  trouble(void)
  {
 +	
  	errx(EXIT_FAILURE, "logic error");
  }
  
-@@ -618,6 +661,7 @@ trouble(void)
+@@ -618,6 +660,7 @@ trouble(void)
  int
  edit(struct diff *diff, int dup, int j)
  {
@@ -331,12 +328,12 @@
  	if (((dup + 1) & eflag) == 0)
  		return (j);
  	j++;
-@@ -632,10 +676,10 @@ edit(struct diff *diff, int dup, int j)
+@@ -632,10 +675,10 @@ edit(struct diff *diff, int dup, int j)
  }
  
  /* regurgitate */
 -__dead void
-+__dead2
++void
  edscript(int n)
  {
 -	int j,k;
@@ -344,7 +341,7 @@
  	char block[BUFSIZ];
  
  	for (n = n; n > 0; n--) {
-@@ -657,8 +701,7 @@ edscript(int n)
+@@ -657,8 +700,7 @@ edscript(int n)
  			printf("%da\n%s\n.\n", de[n].old.from - 1, f1mark);
  		}
  	}
@@ -354,7 +351,7 @@
  		printf("w\nq\n");
  
  	exit(overlapcnt);
-@@ -698,13 +741,30 @@ increase(void)
+@@ -698,13 +740,29 @@ increase(void)
  	szchanges = newsz;
  }
  
@@ -362,24 +359,23 @@
 +help(void)
 +{
 +	
-+	printf ("%s", "\
-+	-e  --ed  Output unmerged changes from OLDFILE to YOURFILE into MYFILE.\n\
-+	-A  --show-all  Output all changes, bracketing conflicts.\n\
-+	-x  --overlap-only  Output overlapping changes.\n\
-+	-3  --easy-only  Output unmerged nonoverlapping changes.\n\n");
-+	printf ("%s", "\
-+	-m  --merge  Output merged file instead of ed script (default -A).\n\
-+	-L LABEL  --label=LABEL  Use LABEL instead of file name.\n\
-+	-a  --text  Treat all files as text.\n\
-+	-T  --initial-tab  Make tabs line up by prepending a tab.\n\n");
-+	printf ("%s", "\
-+	-v  --version  Output version info.\n\
-+	--help  Output this help.\n\n");
-+	
++	printf("%s%s%s%s", 
++		"\t-e  --ed  Output unmerged changes from OLDFILE to YOURFILE into MYFILE.\n",
++		"\t-A  --show-all  Output all changes, bracketing conflicts.\n",
++		"\t-x  --overlap-only  Output overlapping changes.\n",
++		"\t-3  --easy-only  Output unmerged nonoverlapping changes.\n\n");
++	printf("%s%s%s%s", 
++		"\t-m  --merge  Output merged file instead of ed script (default -A).\n",
++		"\t-L LABEL  --label=LABEL  Use LABEL instead of file name.\n",
++		"\t-a  --text  Treat all files as text.\n",
++		"\t-T  --initial-tab  Make tabs line up by prepending a tab.\n\n");
++	printf("%s%s",
++		"\t-v  --version  Output version info.\n",
++		"\t--help  Output this help.\n\n");	
 +}
  
 -__dead void
-+__dead2
++void
  usage(void)
  {
 -	extern char *__progname;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120614061200.7B63C1065670>