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

jhagewood at FreeBSD.org jhagewood at FreeBSD.org
Thu Jun 14 05:33:02 UTC 2012


Author: jhagewood
Date: Thu Jun 14 05:32:59 2012
New Revision: 237662
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237662

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 04:24:13 2012	(r237661)
+++ soc2012/jhagewood/diff3/diff3/diff3prog.c	Thu Jun 14 05:32:59 2012	(r237662)
@@ -85,10 +85,6 @@
 #include <wchar.h>
 #include <wctype.h>
 
-#ifdef __FreeBSD__
-#define __dead
-#endif
-
 /* diff3 - 3-way differential file comparison */
 
 /* diff3 [-ex3EX] d13 d23 f1 f2 f3 [m1 m3]
@@ -143,26 +139,26 @@
 int debug  = 0;
 char f1mark[40], f2mark[40], f3mark[40];	/* markers for -E and -X */
 
-int duplicate(struct range *, struct range *);
-int edit(struct diff *, int, int);
-char *getchange(FILE *);
-char *getline(FILE *, size_t *);
-int number(char **);
-int readin(char *, struct diff **);
-int skip(int, int, char *);
-void change(int, struct range *, int);
-void keep(int, struct range *);
-void merge(int, int);
+static int duplicate(struct range *, struct range *);
+static int edit(struct diff *, int, int);
+static char *getchange(FILE *);
+static char *getline(FILE *, size_t *);
+static int number(char **);
+static int readin(char *, struct diff **);
+static int skip(int, int, char *);
+static void change(int, struct range *, int);
+static void keep(int, struct range *);
+static void merge(int, int);
 static int asciifile(FILE *);
-void prange(struct range *);
-void repos(int);
-void separate(const char *);
-__dead void edscript(int);
-void remove_cr(FILE *);
-__dead void trouble(void);
-void increase(void);
-void help(void);
-__dead void usage(void);
+static void prange(struct range *);
+static void repos(int);
+static void separate(const char *);
+static __dead2 edscript(int);
+static void remove_cr(FILE *);
+static __dead2 trouble(void);
+static void increase(void);
+static void help(void);
+static __dead2 usage(void);
 
 enum {  
         HELP_OPT = CHAR_MAX + 1,
@@ -170,6 +166,10 @@
         DIFFPROG_OPT,
 };
 
+#ifdef __FreeBSD__
+#define __dead2
+#endif
+
 #define OPTIONS "3aAeEiL:mTvxX"
 static struct option longopts[] = {
     { "ed",    		no_argument,		NULL,   'e' },
@@ -648,7 +648,7 @@
 	rewind(f);
 }
 
-__dead void
+__dead2
 trouble(void)
 {
 	
@@ -676,7 +676,7 @@
 }
 
 /* regurgitate */
-__dead void
+__dead2
 edscript(int n)
 {
 	int j, k;
@@ -761,7 +761,7 @@
 	
 }
 
-__dead void
+__dead2
 usage(void)
 {
 	

Modified: soc2012/jhagewood/diff3/hagewood-diff3.patch
==============================================================================
--- soc2012/jhagewood/diff3/hagewood-diff3.patch	Thu Jun 14 04:24:13 2012	(r237661)
+++ soc2012/jhagewood/diff3/hagewood-diff3.patch	Thu Jun 14 05:32:59 2012	(r237662)
@@ -10,9 +10,9 @@
  
  .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-10 03:31:05.000000000 -0400
-+++ jhagewood/diff3/diff3/diff3prog.c	2012-06-13 19:37:44.000000000 -0400
-@@ -64,22 +64,31 @@
+--- 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
   */
  
@@ -44,22 +44,47 @@
  #include <wchar.h>
  #include <wctype.h>
  
-+#ifdef __FreeBSD__
-+#define __dead
-+#endif
-+
- /* diff3 - 3-way differential file comparison */
- 
- /* diff3 [-ex3EX] d13 d23 f1 f2 f3 [m1 m3]
-@@ -149,33 +158,37 @@ void prange(struct range *);
- void repos(int);
- void separate(const char *);
- __dead void edscript(int);
-+void remove_cr(FILE *);
- __dead void trouble(void);
- void increase(void);
-+void help(void);
- __dead void usage(void);
+@@ -134,48 +139,56 @@ int strip_cr;
+ int debug  = 0;
+ char f1mark[40], f2mark[40], f3mark[40];	/* markers for -E and -X */
+ 
+-int duplicate(struct range *, struct range *);
+-int edit(struct diff *, int, int);
+-char *getchange(FILE *);
+-char *getline(FILE *, size_t *);
+-int number(char **);
+-int readin(char *, struct diff **);
+-int skip(int, int, char *);
+-void change(int, struct range *, int);
+-void keep(int, struct range *);
+-void merge(int, int);
++static int duplicate(struct range *, struct range *);
++static int edit(struct diff *, int, int);
++static char *getchange(FILE *);
++static char *getline(FILE *, size_t *);
++static int number(char **);
++static int readin(char *, struct diff **);
++static int skip(int, int, char *);
++static void change(int, struct range *, int);
++static void keep(int, struct range *);
++static void merge(int, int);
+ static int asciifile(FILE *);
+-void prange(struct range *);
+-void repos(int);
+-void separate(const char *);
+-__dead void edscript(int);
+-__dead void trouble(void);
+-void increase(void);
+-__dead void usage(void);
++static void prange(struct range *);
++static void repos(int);
++static void separate(const char *);
++static __dead2 edscript(int);
++static void remove_cr(FILE *);
++static __dead2 trouble(void);
++static void increase(void);
++static void help(void);
++static __dead2 usage(void);
  
  enum {  
          HELP_OPT = CHAR_MAX + 1,
@@ -68,6 +93,10 @@
 +        DIFFPROG_OPT,
  };
  
++#ifdef __FreeBSD__
++#define __dead2
++#endif
++
  #define OPTIONS "3aAeEiL:mTvxX"
  static struct option longopts[] = {
 -        { "ed",    		no_argument,		NULL,   'e' },
@@ -176,12 +205,12 @@
  {
 -        wint_t   ch = L'\0';
 -        size_t   i;
+-
+-        if (aflag || f == NULL)
+-                return (1);
 +	wint_t ch = L'\0';
 +	size_t i;
  
--        if (aflag || f == NULL)
--                return (1);
--
 -        rewind(f);
 -        errno = 0;
 -        for (i = 0; i <= BUFSIZ; i++) {
@@ -263,6 +292,7 @@
  		(void)fseek(fp[i], (long)-nchar, SEEK_CUR);
  }
  
+-__dead void
 +/* If file has trailing carriage return, remove it. */
 +void
 +remove_cr(FILE *f) 
@@ -286,7 +316,7 @@
 +	rewind(f);
 +}
 +
- __dead void
++__dead2
  trouble(void)
  {
 +	
@@ -301,8 +331,12 @@
  	if (((dup + 1) & eflag) == 0)
  		return (j);
  	j++;
-@@ -635,7 +679,7 @@ edit(struct diff *diff, int dup, int j)
- __dead void
+@@ -632,10 +676,10 @@ edit(struct diff *diff, int dup, int j)
+ }
+ 
+ /* regurgitate */
+-__dead void
++__dead2
  edscript(int n)
  {
 -	int j,k;
@@ -344,7 +378,8 @@
 +	
 +}
  
- __dead void
+-__dead void
++__dead2
  usage(void)
  {
 -	extern char *__progname;


More information about the svn-soc-all mailing list