Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Jun 2012 02:27:30 +0000
From:      jhagewood@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r238620 - in soc2012/jhagewood/diff: . diff
Message-ID:  <20120630022730.41C4C106566C@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhagewood
Date: Sat Jun 30 02:27:29 2012
New Revision: 238620
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=238620

Log:

Modified:
  soc2012/jhagewood/diff/diff/diffreg.c
  soc2012/jhagewood/diff/hagewood-diff.patch

Modified: soc2012/jhagewood/diff/diff/diffreg.c
==============================================================================
--- soc2012/jhagewood/diff/diff/diffreg.c	Sat Jun 30 01:40:29 2012	(r238619)
+++ soc2012/jhagewood/diff/diff/diffreg.c	Sat Jun 30 02:27:29 2012	(r238620)
@@ -94,7 +94,8 @@
 # define TIMESPEC_NS(timespec) 0
 #endif
 
-#define MAX_CHECK 8192
+#define MAX_CHECK 768
+
 /*
  * diff - compare two files.
  */

Modified: soc2012/jhagewood/diff/hagewood-diff.patch
==============================================================================
--- soc2012/jhagewood/diff/hagewood-diff.patch	Sat Jun 30 01:40:29 2012	(r238619)
+++ soc2012/jhagewood/diff/hagewood-diff.patch	Sat Jun 30 02:27:29 2012	(r238620)
@@ -674,7 +674,7 @@
  extern char	*start, *ifdefname, *diffargs, *label[2], *ignore_pats;
 diff -rupN jhagewood/diff/diff-orig/diffreg.c jhagewood/diff/diff/diffreg.c
 --- jhagewood/diff/diff-orig/diffreg.c	2012-06-28 18:13:23.286983517 -0400
-+++ jhagewood/diff/diff/diffreg.c	2012-06-29 18:43:59.638892095 -0400
++++ jhagewood/diff/diff/diffreg.c	2012-06-29 22:27:15.024984607 -0400
 @@ -62,15 +62,13 @@
   *	@(#)diffreg.c   8.1 (Berkeley) 6/6/93
   */
@@ -695,7 +695,7 @@
  
  #include <sys/param.h>
  #include <sys/stat.h>
-@@ -90,6 +88,13 @@ __FBSDID("$FreeBSD");
+@@ -90,6 +88,14 @@ __FBSDID("$FreeBSD");
  #include "diff.h"
  #include "pathnames.h"
  
@@ -705,11 +705,12 @@
 +# define TIMESPEC_NS(timespec) 0
 +#endif
 +
-+#define MAX_CHECK 8192
++#define MAX_CHECK 768
++
  /*
   * diff - compare two files.
   */
-@@ -196,7 +201,7 @@ static void	 change(char *, FILE *, char
+@@ -196,7 +202,7 @@ static void	 change(char *, FILE *, char
  static void	 sort(struct line *, int);
  static void	 print_header(const char *, const char *);
  static int	 ignoreline(char *);
@@ -718,7 +719,7 @@
  static int	 fetch(long *, int, int, FILE *, int, int);
  static int	 newcand(int, int, int);
  static int	 search(int *, int, int);
-@@ -294,13 +299,13 @@ u_char cup2low[256] = {
+@@ -294,13 +300,13 @@ u_char cup2low[256] = {
  int
  diffreg(char *ofile1, char *ofile2, int flags)
  {
@@ -739,7 +740,7 @@
  
  	anychange = 0;
  	lastline = 0;
-@@ -353,7 +358,6 @@ diffreg(char *ofile1, char *ofile2, int
+@@ -353,7 +359,6 @@ diffreg(char *ofile1, char *ofile2, int
  		status |= 2;
  		goto closem;
  	}
@@ -747,7 +748,7 @@
  	switch (files_differ(f1, f2, flags)) {
  	case 0:
  		goto closem;
-@@ -365,7 +369,7 @@ diffreg(char *ofile1, char *ofile2, int
+@@ -365,7 +370,7 @@ diffreg(char *ofile1, char *ofile2, int
  		goto closem;
  	}
  
@@ -756,7 +757,7 @@
  		rval = D_BINARY;
  		status |= 1;
  		goto closem;
-@@ -477,8 +481,8 @@ closem:
+@@ -477,8 +482,8 @@ closem:
  static int
  files_differ(FILE *f1, FILE *f2, int flags)
  {
@@ -767,7 +768,7 @@
  
  	if ((flags & (D_EMPTY1|D_EMPTY2)) || stb1.st_size != stb2.st_size ||
  	    (stb1.st_mode & S_IFMT) != (stb2.st_mode & S_IFMT))
-@@ -503,9 +507,9 @@ files_differ(FILE *f1, FILE *f2, int fla
+@@ -503,9 +508,9 @@ files_differ(FILE *f1, FILE *f2, int fla
  static FILE *
  opentemp(const char *file)
  {
@@ -780,7 +781,7 @@
  
  	if (strcmp(file, "-") == 0)
  		ifd = STDIN_FILENO;
-@@ -541,7 +545,7 @@ opentemp(const char *file)
+@@ -541,7 +546,7 @@ opentemp(const char *file)
  char *
  splice(char *dir, char *file)
  {
@@ -789,7 +790,7 @@
  
  	if ((tail = strrchr(file, '/')) == NULL)
  		tail = file;
-@@ -555,8 +559,8 @@ static void
+@@ -555,8 +560,8 @@ static void
  prepare(int i, FILE *fd, off_t filesize)
  {
  	struct line	*p;
@@ -800,7 +801,7 @@
  
  	rewind(fd);
  
-@@ -579,7 +583,7 @@ prepare(int i, FILE *fd, off_t filesize)
+@@ -579,7 +584,7 @@ prepare(int i, FILE *fd, off_t filesize)
  static void
  prune(void)
  {
@@ -809,7 +810,7 @@
  
  	for (pref = 0; pref < len[0] && pref < len[1] &&
  	    file[0][pref + 1].value == file[1][pref + 1].value;
-@@ -600,7 +604,7 @@ prune(void)
+@@ -600,7 +605,7 @@ prune(void)
  static void
  equiv(struct line *a, int n, struct line *b, int m, int *c)
  {
@@ -818,7 +819,7 @@
  
  	i = j = 1;
  	while (i <= n && j <= m) {
-@@ -629,7 +633,7 @@ equiv(struct line *a, int n, struct line
+@@ -629,7 +634,7 @@ equiv(struct line *a, int n, struct line
  static int
  isqrt(int n)
  {
@@ -827,7 +828,7 @@
  
  	if (n == 0)
  		return (0);
-@@ -647,9 +651,9 @@ isqrt(int n)
+@@ -647,9 +652,9 @@ isqrt(int n)
  static int
  stone(int *a, int n, int *b, int *c)
  {
@@ -840,7 +841,7 @@
  	const u_int bound = dflag ? UINT_MAX : MAX(256, isqrt(n));
  
  	k = 0;
-@@ -705,7 +709,7 @@ newcand(int x, int y, int pred)
+@@ -705,7 +710,7 @@ newcand(int x, int y, int pred)
  static int
  search(int *c, int k, int y)
  {
@@ -849,7 +850,7 @@
  
  	if (clist[c[k]].y < y)	/* quick look for typical case */
  		return (k + 1);
-@@ -730,7 +734,7 @@ static void
+@@ -730,7 +735,7 @@ static void
  unravel(int p)
  {
  	struct cand	*q;
@@ -858,7 +859,7 @@
  
  	for (i = 0; i <= len[0]; i++)
  		J[i] = i <= pref ? i :
-@@ -748,9 +752,10 @@ unravel(int p)
+@@ -748,9 +753,10 @@ unravel(int p)
  static void
  check(char *file1, FILE *f1, char *file2, FILE *f2)
  {
@@ -872,7 +873,7 @@
  	rewind(f1);
  	rewind(f2);
  	j = 1;
-@@ -766,7 +771,7 @@ check(char *file1, FILE *f1, char *file2
+@@ -766,7 +772,7 @@ check(char *file1, FILE *f1, char *file2
  			ixnew[j] = ctnew += skipline(f2);
  			j++;
  		}
@@ -881,7 +882,7 @@
  			for (;;) {
  				c = getc(f1);
  				d = getc(f2);
-@@ -781,6 +786,7 @@ check(char *file1, FILE *f1, char *file2
+@@ -781,6 +787,7 @@ check(char *file1, FILE *f1, char *file2
  				}
  				ctold++;
  				ctnew++;
@@ -889,7 +890,7 @@
  				if (bflag && isspace(c) && isspace(d)) {
  					do {
  						if (c == '\n')
-@@ -792,6 +798,7 @@ check(char *file1, FILE *f1, char *file2
+@@ -792,6 +799,7 @@ check(char *file1, FILE *f1, char *file2
  							break;
  						ctnew++;
  					} while (isspace(d = getc(f2)));
@@ -897,7 +898,7 @@
  				} else if (wflag) {
  					while (isspace(c) && c != '\n') {
  						c = getc(f1);
-@@ -801,31 +808,62 @@ check(char *file1, FILE *f1, char *file2
+@@ -801,31 +809,62 @@ check(char *file1, FILE *f1, char *file2
  						d = getc(f2);
  						ctnew++;
  					}
@@ -975,7 +976,7 @@
  				if (chrtran[c] != chrtran[d]) {
  					jackpot++;
  					J[i] = 0;
-@@ -872,7 +910,7 @@ static void
+@@ -872,7 +911,7 @@ static void
  sort(struct line *a, int n)
  {
  	struct line	*ai, *aim, w;
@@ -984,7 +985,7 @@
  
  	if (n == 0)
  		return;
-@@ -916,7 +954,7 @@ unsort(struct line *f, int l, int *b)
+@@ -916,7 +955,7 @@ unsort(struct line *f, int l, int *b)
  static int
  skipline(FILE *f)
  {
@@ -993,7 +994,7 @@
  
  	for (i = 1; (c = getc(f)) != '\n' && c != EOF; i++)
  		continue;
-@@ -926,7 +964,7 @@ skipline(FILE *f)
+@@ -926,7 +965,7 @@ skipline(FILE *f)
  static void
  output(char *file1, FILE *f1, char *file2, FILE *f2, int flags)
  {
@@ -1002,7 +1003,7 @@
  
  	rewind(f1);
  	rewind(f2);
-@@ -965,7 +1003,7 @@ output(char *file1, FILE *f1, char *file
+@@ -965,7 +1004,7 @@ output(char *file1, FILE *f1, char *file
  #define	c i0
  			if ((c = getc(f1)) == EOF)
  				return;
@@ -1011,7 +1012,7 @@
  		}
  #undef c
  	}
-@@ -980,6 +1018,7 @@ output(char *file1, FILE *f1, char *file
+@@ -980,6 +1019,7 @@ output(char *file1, FILE *f1, char *file
  static void
  range(int a, int b, char *separator)
  {
@@ -1019,7 +1020,7 @@
  	printf("%d", a > b ? b : a);
  	if (a < b)
  		printf("%s%d", separator, b);
-@@ -988,6 +1027,7 @@ range(int a, int b, char *separator)
+@@ -988,6 +1028,7 @@ range(int a, int b, char *separator)
  static void
  uni_range(int a, int b)
  {
@@ -1027,7 +1028,7 @@
  	if (a < b)
  		printf("%d,%d", a, b - a + 1);
  	else if (a == b)
-@@ -999,22 +1039,22 @@ uni_range(int a, int b)
+@@ -999,22 +1040,22 @@ uni_range(int a, int b)
  static char *
  preadline(int fd, size_t len, off_t off)
  {
@@ -1054,7 +1055,7 @@
  
  	ret = regexec(&ignore_re, line, 0, NULL, 0);
  	free(line);
-@@ -1032,8 +1072,8 @@ static void
+@@ -1032,8 +1073,8 @@ static void
  change(char *file1, FILE *f1, char *file2, FILE *f2, int a, int b, int c, int d,
      int *pflags)
  {
@@ -1065,7 +1066,7 @@
  
  restart:
  	if (format != D_IFDEF && a > b && c > d)
-@@ -1113,15 +1153,15 @@ proceed:
+@@ -1113,15 +1154,15 @@ proceed:
  	case D_NORMAL:
  	case D_EDIT:
  		range(a, b, ",");
@@ -1085,7 +1086,7 @@
  		break;
  	case D_NREVERSE:
  		if (a > b)
-@@ -1137,7 +1177,7 @@ proceed:
+@@ -1137,7 +1178,7 @@ proceed:
  	if (format == D_NORMAL || format == D_IFDEF) {
  		fetch(ixold, a, b, f1, '<', 1);
  		if (a <= b && c <= d && format == D_NORMAL)
@@ -1094,7 +1095,7 @@
  	}
  	i = fetch(ixnew, c, d, f2, format == D_NORMAL ? '>' : '\0', 0);
  	if (i != 0 && format == D_EDIT) {
-@@ -1148,14 +1188,14 @@ proceed:
+@@ -1148,14 +1189,14 @@ proceed:
  		 * it.  We have to add a substitute command to change this
  		 * back and restart where we left off.
  		 */
@@ -1111,7 +1112,7 @@
  	if (inifdef) {
  		printf("#endif /* %s */\n", ifdefname);
  		inifdef = 0;
-@@ -1165,8 +1205,8 @@ proceed:
+@@ -1165,8 +1206,8 @@ proceed:
  static int
  fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile)
  {
@@ -1122,7 +1123,7 @@
  
  	/*
  	 * When doing #ifdef's, copy down to current line
-@@ -1177,7 +1217,7 @@ fetch(long *f, int a, int b, FILE *lb, i
+@@ -1177,7 +1218,7 @@ fetch(long *f, int a, int b, FILE *lb, i
  		/* print through if append (a>b), else to (nb: 0 vs 1 orig) */
  		nc = f[a > b ? b : a - 1] - curpos;
  		for (i = 0; i < nc; i++)
@@ -1131,7 +1132,7 @@
  	}
  	if (a > b)
  		return (0);
-@@ -1197,12 +1237,12 @@ fetch(long *f, int a, int b, FILE *lb, i
+@@ -1197,12 +1238,12 @@ fetch(long *f, int a, int b, FILE *lb, i
  		fseek(lb, f[i - 1], SEEK_SET);
  		nc = f[i] - f[i - 1];
  		if (format != D_IFDEF && ch != '\0') {
@@ -1147,7 +1148,7 @@
  		}
  		col = 0;
  		for (j = 0, lastc = '\0'; j < nc; j++, lastc = c) {
-@@ -1211,13 +1251,13 @@ fetch(long *f, int a, int b, FILE *lb, i
+@@ -1211,13 +1252,13 @@ fetch(long *f, int a, int b, FILE *lb, i
  				    format == D_NREVERSE)
  					warnx("No newline at end of file");
  				else
@@ -1163,7 +1164,7 @@
  				} while (++col < newcol);
  			} else {
  				if (format == D_EDIT && j == 1 && c == '\n'
-@@ -1229,10 +1269,10 @@ fetch(long *f, int a, int b, FILE *lb, i
+@@ -1229,10 +1270,10 @@ fetch(long *f, int a, int b, FILE *lb, i
  					 * giving the caller an offset
  					 * from which to restart.
  					 */
@@ -1176,7 +1177,7 @@
  				col++;
  			}
  		}
-@@ -1246,8 +1286,8 @@ fetch(long *f, int a, int b, FILE *lb, i
+@@ -1246,8 +1287,8 @@ fetch(long *f, int a, int b, FILE *lb, i
  static int
  readhash(FILE *f)
  {
@@ -1187,7 +1188,7 @@
  
  	sum = 1;
  	space = 0;
-@@ -1305,20 +1345,28 @@ readhash(FILE *f)
+@@ -1305,20 +1346,28 @@ readhash(FILE *f)
  	return (sum == 0 ? 1 : sum);
  }
  
@@ -1224,7 +1225,7 @@
  	return (1);
  }
  
-@@ -1327,10 +1375,10 @@ asciifile(FILE *f)
+@@ -1327,10 +1376,10 @@ asciifile(FILE *f)
  static char *
  match_function(const long *f, int pos, FILE *file)
  {
@@ -1239,7 +1240,7 @@
  
  	lastline = pos;
  	while (pos > last) {
-@@ -1342,7 +1390,6 @@ match_function(const long *f, int pos, F
+@@ -1342,7 +1391,6 @@ match_function(const long *f, int pos, F
  		if (nc > 0) {
  			buf[nc] = '\0';
  			buf[strcspn(buf, "\n")] = '\0';
@@ -1247,7 +1248,7 @@
  			if (isalpha(buf[0]) || buf[0] == '_' || buf[0] == '$') {
  				if (begins_with(buf, "private:")) {
  					if (!state)
-@@ -1373,9 +1420,9 @@ static void
+@@ -1373,9 +1421,9 @@ static void
  dump_context_vec(FILE *f1, FILE *f2)
  {
  	struct context_vec *cvp = context_vec_start;
@@ -1260,7 +1261,7 @@
  
  	if (context_vec_start > context_vec_ptr)
  		return;
-@@ -1390,8 +1437,8 @@ dump_context_vec(FILE *f1, FILE *f2)
+@@ -1390,8 +1438,8 @@ dump_context_vec(FILE *f1, FILE *f2)
  	if (pflag) {
  		f = match_function(ixold, lowa-1, f1);
  		if (f != NULL) {
@@ -1271,7 +1272,7 @@
  		}
  	}
  	printf("\n*** ");
-@@ -1478,9 +1525,9 @@ static void
+@@ -1478,9 +1526,9 @@ static void
  dump_unified_vec(FILE *f1, FILE *f2)
  {
  	struct context_vec *cvp = context_vec_start;
@@ -1284,7 +1285,7 @@
  
  	if (context_vec_start > context_vec_ptr)
  		return;
-@@ -1491,19 +1538,19 @@ dump_unified_vec(FILE *f1, FILE *f2)
+@@ -1491,19 +1539,19 @@ dump_unified_vec(FILE *f1, FILE *f2)
  	lowc = MAX(1, cvp->c - context);
  	upd = MIN(len[1], context_vec_ptr->d + context);
  
@@ -1310,7 +1311,7 @@
  
  	/*
  	 * Output changes in "unified" diff format--the old and new lines
-@@ -1551,16 +1598,43 @@ dump_unified_vec(FILE *f1, FILE *f2)
+@@ -1551,16 +1599,43 @@ dump_unified_vec(FILE *f1, FILE *f2)
  static void
  print_header(const char *file1, const char *file2)
  {



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