ports/118077: fix broken port: editors/nvi-devel broken since gcc-4.2

J.R. Oldroyd fbsd at opal.com
Thu Nov 15 19:50:01 UTC 2007


>Number:         118077
>Category:       ports
>Synopsis:       fix broken port: editors/nvi-devel broken since gcc-4.2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 15 19:50:00 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     J.R. Oldroyd
>Release:        FreeBSD 7.0-BETA1 i386
>Organization:
>Environment:
System: FreeBSD linwhf.opal.com 7.0-BETA1 FreeBSD 7.0-BETA1 #0: Thu Nov 1 14:21:03 EDT 2007 xx:/usr/src/sys/i386/compile/LINWHF i386
>Description:
Since FreeBSD OSversion 700042, this port has been marked BROKEN.
These extra patches fix this.
>How-To-Repeat:
>Fix:
diff -ruN /usr/ports/editors/nvi-devel/Makefile editors/nvi-devel/Makefile
--- /usr/ports/editors/nvi-devel/Makefile	2007-10-29 19:10:11.000000000 -0400
+++ editors/nvi-devel/Makefile	2007-11-15 14:33:48.000000000 -0500
@@ -7,7 +7,7 @@
 
 PORTNAME=	nvi
 PORTVERSION=	1.81.5
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	editors
 MASTER_SITES=	http://193.190.253.81/~skimo/nvi/devel/ \
 		${MASTER_SITE_LOCAL}
@@ -32,7 +32,14 @@
 .include <bsd.port.pre.mk>
 
 .if ${OSVERSION} >= 700042
-BROKEN=		Broken with gcc 4.2
+EXTRA_PATCHES+=	\
+		files/extra-patch-cl-cl.h \
+		files/extra-patch-cl-cl_funcs.c \
+		files/extra-patch-cl-cl_screen.c \
+		files/extra-patch-common-db.c \
+		files/extra-patch-common-key.c \
+		files/extra-patch-common-mem.h \
+		files/extra-patch-vi-v_txt.c
 .endif
 
 # XXX: nvi doesn't really need sys/select.h, but I don't think the
diff -ruN /usr/ports/editors/nvi-devel/files/extra-patch-cl-cl.h editors/nvi-devel/files/extra-patch-cl-cl.h
--- /usr/ports/editors/nvi-devel/files/extra-patch-cl-cl.h	1969-12-31 19:00:00.000000000 -0500
+++ editors/nvi-devel/files/extra-patch-cl-cl.h	2007-11-15 14:24:10.000000000 -0500
@@ -0,0 +1,10 @@
+--- ../cl/cl.h.orig	2001-07-08 09:06:11.000000000 -0400
++++ ../cl/cl.h	2007-11-15 14:19:16.000000000 -0500
+@@ -80,6 +80,7 @@
+ #define	CLP(sp)		((CL_PRIVATE *)((sp)->gp->cl_private))
+ #define	GCLP(gp)	((CL_PRIVATE *)gp->cl_private)
+ #define	CLSP(sp)	((WINDOW *)((sp)->cl_private))
++#define	LCLSP(sp)	((sp)->cl_private)
+ 
+ /* Return possibilities from the keyboard read routine. */
+ typedef enum { INP_OK=0, INP_EOF, INP_ERR, INP_INTR, INP_TIMEOUT } input_t;
diff -ruN /usr/ports/editors/nvi-devel/files/extra-patch-cl-cl_funcs.c editors/nvi-devel/files/extra-patch-cl-cl_funcs.c
--- /usr/ports/editors/nvi-devel/files/extra-patch-cl-cl_funcs.c	1969-12-31 19:00:00.000000000 -0500
+++ editors/nvi-devel/files/extra-patch-cl-cl_funcs.c	2007-11-15 14:24:10.000000000 -0500
@@ -0,0 +1,32 @@
+--- ../cl/cl_funcs.c.orig	2001-06-25 11:19:05.000000000 -0400
++++ ../cl/cl_funcs.c	2007-11-15 14:18:45.000000000 -0500
+@@ -381,7 +381,7 @@
+ 
+ 	    if (CLSP(discardp)) {
+ 		    delwin(CLSP(discardp));
+-		    CLSP(discardp) = NULL;
++		    LCLSP(discardp) = NULL;
+ 	    }
+ 	}
+ 
+@@ -395,7 +395,7 @@
+ 
+ 		if (CLSP(tsp))
+ 			delwin(CLSP(tsp));
+-		CLSP(tsp) = subwin(stdscr, tsp->rows, tsp->cols,
++		LCLSP(tsp) = subwin(stdscr, tsp->rows, tsp->cols,
+ 					   tsp->roff, tsp->coff);
+ 	}
+ 
+@@ -716,9 +716,9 @@
+ 	if (CLSP(origp))
+ 		delwin(CLSP(origp));
+ 
+-	CLSP(origp) = subwin(stdscr, origp->rows, origp->cols,
++	LCLSP(origp) = subwin(stdscr, origp->rows, origp->cols,
+ 				     origp->roff, origp->coff);
+-	CLSP(newp) = subwin(stdscr, newp->rows, newp->cols,
++	LCLSP(newp) = subwin(stdscr, newp->rows, newp->cols,
+ 				     newp->roff, newp->coff);
+ 
+ 	/* origp is the original screen, giving up space to newp. */
diff -ruN /usr/ports/editors/nvi-devel/files/extra-patch-cl-cl_screen.c editors/nvi-devel/files/extra-patch-cl-cl_screen.c
--- /usr/ports/editors/nvi-devel/files/extra-patch-cl-cl_screen.c	1969-12-31 19:00:00.000000000 -0500
+++ editors/nvi-devel/files/extra-patch-cl-cl_screen.c	2007-11-15 14:24:10.000000000 -0500
@@ -0,0 +1,11 @@
+--- ../cl/cl_screen.c.orig	2001-06-25 11:19:06.000000000 -0400
++++ ../cl/cl_screen.c	2007-11-15 14:19:50.000000000 -0500
+@@ -56,7 +56,7 @@
+ 	if (F_ISSET(gp, G_SRESTART)) {
+ 		if (CLSP(sp)) {
+ 		    delwin(CLSP(sp));
+-		    CLSP(sp) = NULL;
++		    LCLSP(sp) = NULL;
+ 		}
+ 		if (cl_quit(gp))
+ 			return (1);
diff -ruN /usr/ports/editors/nvi-devel/files/extra-patch-common-db.c editors/nvi-devel/files/extra-patch-common-db.c
--- /usr/ports/editors/nvi-devel/files/extra-patch-common-db.c	1969-12-31 19:00:00.000000000 -0500
+++ editors/nvi-devel/files/extra-patch-common-db.c	2007-11-15 14:24:10.000000000 -0500
@@ -0,0 +1,11 @@
+--- ../common/db.c.orig	2001-08-18 17:52:00.000000000 -0400
++++ ../common/db.c	2007-11-15 13:56:15.000000000 -0500
+@@ -164,7 +164,7 @@
+ 	nlen = 1024;
+ retry:
+ 	/* data.size contains length in bytes */
+-	BINC_GOTO(sp, (char *)ep->c_lp, ep->c_blen, nlen);
++	BINC_GOTO(sp, ep->c_lp, ep->c_blen, nlen);
+ 
+ 	/* Get the line from the underlying database. */
+ 	memset(&key, 0, sizeof(key));
diff -ruN /usr/ports/editors/nvi-devel/files/extra-patch-common-key.c editors/nvi-devel/files/extra-patch-common-key.c
--- /usr/ports/editors/nvi-devel/files/extra-patch-common-key.c	1969-12-31 19:00:00.000000000 -0500
+++ editors/nvi-devel/files/extra-patch-common-key.c	2007-11-15 14:24:10.000000000 -0500
@@ -0,0 +1,11 @@
+--- ../common/key.c.orig	2001-06-25 11:19:10.000000000 -0400
++++ ../common/key.c	2007-11-15 13:50:47.000000000 -0500
+@@ -833,7 +833,7 @@
+ 	wp = sp->wp;
+ 	new_nelem = wp->i_nelem + add;
+ 	olen = wp->i_nelem * sizeof(wp->i_event[0]);
+-	BINC_RET(sp, (char *)wp->i_event, olen, new_nelem * sizeof(wp->i_event[0]));
++	BINC_RET(sp, wp->i_event, olen, new_nelem * sizeof(wp->i_event[0]));
+ 	wp->i_nelem = olen / sizeof(wp->i_event[0]);
+ 	return (0);
+ }
diff -ruN /usr/ports/editors/nvi-devel/files/extra-patch-common-mem.h editors/nvi-devel/files/extra-patch-common-mem.h
--- /usr/ports/editors/nvi-devel/files/extra-patch-common-mem.h	1969-12-31 19:00:00.000000000 -0500
+++ editors/nvi-devel/files/extra-patch-common-mem.h	2007-11-15 14:24:10.000000000 -0500
@@ -0,0 +1,81 @@
+--- ../common/mem.h.orig	2000-08-20 05:12:59.000000000 -0400
++++ ../common/mem.h	2007-11-15 13:55:35.000000000 -0500
+@@ -13,7 +13,7 @@
+  * returns, one that jumps to an error label.
+  */
+ #define	BINC_GOTO(sp, lp, llen, nlen) {					\
+-	char *L__p = lp;						\
++	CHAR_T *L__p = lp;						\
+ 	void *L__bincp;							\
+ 	if ((nlen) > llen) {						\
+ 		if ((L__bincp = binc(sp, lp, &(llen), nlen)) == NULL)	\
+@@ -25,12 +25,12 @@
+ 		lp = L__bincp;						\
+ 	}								\
+ }
+-#define	BINC_GOTOW(sp, lp, llen, nlen) {					\
++#define	BINC_GOTOW(sp, lp, llen, nlen) {				\
+ 	CHAR_T *L__bp = lp;						\
+-	BINC_GOTO(sp, (char *)lp, llen, (nlen) * sizeof(CHAR_T))    	\
++	BINC_GOTO(sp, lp, llen, (nlen) * sizeof(CHAR_T))	    	\
+ }
+ #define	BINC_RET(sp, lp, llen, nlen) {					\
+-	char *L__p = lp;						\
++	CHAR_T *L__p = lp;						\
+ 	void *L__bincp;							\
+ 	if ((nlen) > llen) {						\
+ 		if ((L__bincp = binc(sp, lp, &(llen), nlen)) == NULL)	\
+@@ -44,7 +44,7 @@
+ }
+ #define	BINC_RETW(sp, lp, llen, nlen) {					\
+ 	CHAR_T *L__bp = lp;						\
+-	BINC_RET(sp, (char *)lp, llen, (nlen) * sizeof(CHAR_T))	    	\
++	BINC_RET(sp, lp, llen, (nlen) * sizeof(CHAR_T))	    		\
+ }
+ 
+ /*
+@@ -67,7 +67,7 @@
+ }
+ #define	GET_SPACE_GOTOW(sp, bp, blen, nlen) {				\
+ 	CHAR_T *L__bp = bp;						\
+-	GET_SPACE_GOTO(sp, (char *)bp, blen, (nlen) * sizeof(CHAR_T))	\
++	GET_SPACE_GOTO(sp, bp, blen, (nlen) * sizeof(CHAR_T))		\
+ }
+ #define	GET_SPACE_RET(sp, bp, blen, nlen) {				\
+ 	WIN *L__wp = (sp) == NULL ? NULL : (sp)->wp;			\
+@@ -84,7 +84,7 @@
+ }
+ #define	GET_SPACE_RETW(sp, bp, blen, nlen) {				\
+ 	CHAR_T *L__bp = bp;						\
+-	GET_SPACE_RET(sp, (char *)bp, blen, (nlen) * sizeof(CHAR_T))	\
++	GET_SPACE_RET(sp, bp, blen, (nlen) * sizeof(CHAR_T))		\
+ }
+ 
+ /*
+@@ -104,7 +104,7 @@
+ }
+ #define	ADD_SPACE_GOTOW(sp, bp, blen, nlen) {				\
+ 	CHAR_T *L__bp = bp;						\
+-	ADD_SPACE_GOTO(sp, (char *)bp, blen, (nlen) * sizeof(CHAR_T))	\
++	ADD_SPACE_GOTO(sp, bp, blen, (nlen) * sizeof(CHAR_T))		\
+ }
+ #define	ADD_SPACE_RET(sp, bp, blen, nlen) {				\
+ 	WIN *L__wp = (sp) == NULL ? NULL : (sp)->wp;			\
+@@ -119,7 +119,7 @@
+ }
+ #define	ADD_SPACE_RETW(sp, bp, blen, nlen) {				\
+ 	CHAR_T *L__bp = bp;						\
+-	ADD_SPACE_RET(sp, (char *)bp, blen, (nlen) * sizeof(CHAR_T))	\
++	ADD_SPACE_RET(sp, bp, blen, (nlen) * sizeof(CHAR_T))		\
+ }
+ 
+ /* Free a GET_SPACE returned buffer. */
+@@ -132,7 +132,7 @@
+ }
+ #define	FREE_SPACEW(sp, bp, blen) {					\
+ 	CHAR_T *L__bp = bp;						\
+-	FREE_SPACE(sp, (char *)bp, blen);				\
++	FREE_SPACE(sp, bp, blen);					\
+ }
+ 
+ /*
diff -ruN /usr/ports/editors/nvi-devel/files/extra-patch-vi-v_txt.c editors/nvi-devel/files/extra-patch-vi-v_txt.c
--- /usr/ports/editors/nvi-devel/files/extra-patch-vi-v_txt.c	1969-12-31 19:00:00.000000000 -0500
+++ editors/nvi-devel/files/extra-patch-vi-v_txt.c	2007-11-15 14:24:10.000000000 -0500
@@ -0,0 +1,11 @@
+--- ../vi/v_txt.c.orig	2001-07-26 13:15:53.000000000 -0400
++++ ../vi/v_txt.c	2007-11-15 13:57:33.000000000 -0500
+@@ -589,7 +589,7 @@
+ 
+ 	/* Check to see if the character fits into the replay buffers. */
+ 	if (LF_ISSET(TXT_RECORD)) {
+-		BINC_GOTO(sp, (char *)vip->rep,
++		BINC_GOTO(sp, vip->rep,
+ 		    vip->rep_len, (rcol + 1) * sizeof(EVENT));
+ 		vip->rep[rcol++] = *evp;
+ 	}
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list