Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Nov 2007 01:04:09 +0100
From:      "\"Pietro Cerutti\" <Pietro Cerutti" <gahr@gahr.ch>
To:        "FreeBSD gnats submit" <FreeBSD-gnats-submit@FreeBSD.org>
Subject:   ports/117801: [patch] editors/dedit unbreak fix build with GCC 4.2 + general cleanup
Message-ID:  <1194134649.99726@gahrtop.localhost>
Resent-Message-ID: <200711040050.lA40o2Fa018837@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         117801
>Category:       ports
>Synopsis:       [patch] editors/dedit unbreak fix build with GCC 4.2 + general cleanup
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 04 00:50:02 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Pietro Cerutti
>Release:        FreeBSD 6.2-STABLE i386
>Organization:
Bern University of Applied Sciences 
>Environment:


System: FreeBSD 6.2-STABLE #3: Wed Oct 24 08:30:39 CEST 2007
    root@gahrtop.localhost:/usr/obj/usr/src/sys/MSI1034



>Description:


A "static declaration following non-static declaration" problem existed in editors/dedit's source.
I took the chance to do some cleanup. Now the code compiles without warnings ;-)


>How-To-Repeat:


cd /usr/ports/editors/dedit && make


>Fix:


--- Makefile.orig	2007-11-04 00:58:39.000000000 +0100
+++ Makefile	2007-11-04 00:59:04.000000000 +0100
@@ -7,7 +7,7 @@
 
 PORTNAME=	dedit
 PORTVERSION=	0.6.2.3
-PORTREVISION=	5
+PORTREVISION=	6
 CATEGORIES=	editors gnome
 MASTER_SITES=	${MASTER_SITE_DEBIAN_POOL}
 DISTNAME=	${PORTNAME}_${PORTVERSION}
@@ -27,12 +27,6 @@
 MAN1=		dedit.1
 MANLANG=	"" ja
 
-.include <bsd.port.pre.mk>
-
-.if ${OSVERSION} >= 700042
-BROKEN=		Broken with gcc 4.2
-.endif
-
 pre-patch:
 	@${FIND} ${WRKSRC} -name "Makefile.in" | ${XARGS} ${REINPLACE_CMD} -e \
 		's|dedit.ja.1||'
@@ -40,4 +34,4 @@
 post-install:
 	${INSTALL_MAN} ${WRKSRC}/doc/dedit.ja.1 ${MANPREFIX}/man/ja/man1/dedit.1
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
--- /dev/null	2007-11-04 00:57:48.000000000 +0100
+++ files/patch-src-dedit.h	2007-11-04 00:36:23.000000000 +0100
@@ -0,0 +1,10 @@
+--- src/dedit.h.orig	2007-11-04 00:35:59.000000000 +0100
++++ src/dedit.h	2007-11-04 00:36:08.000000000 +0100
+@@ -30,7 +30,6 @@
+ extern GnomeMDI *DEmdi;
+ 
+ extern gchar *print_cmd;
+-extern gboolean restarted;
+ extern const struct poptOption options[];
+ extern gint fs_code;
+ extern GtkWidget *file_sel;
--- /dev/null	2007-11-04 00:57:48.000000000 +0100
+++ files/patch-src-file.c	2007-11-04 00:57:10.000000000 +0100
@@ -0,0 +1,46 @@
+--- src/file.c.orig	2000-10-13 08:45:02.000000000 +0200
++++ src/file.c	2007-11-04 00:56:29.000000000 +0100
+@@ -46,7 +46,7 @@
+ static void cancel_cb(GtkWidget *widget, gpointer *data);
+ 
+ gint fs_code;
+-static GtkWidget *file_sel;
++GtkWidget *file_sel;
+ 
+ /*
+  *
+@@ -80,7 +80,7 @@
+ 	gtk_widget_destroy(GTK_WIDGET(file_sel));
+ 	file_sel = NULL;
+ 
+-    if(file_name) {
++    if(file_name[0]) {
+         dedit_new_document(NULL, file_name);
+     }
+ 
+@@ -318,7 +318,7 @@
+ 	gtk_widget_destroy(GTK_WIDGET(file_sel));
+ 	file_sel = NULL;
+ 
+-    if(tmp){
++    if(tmp[0]){
+         save_file(doc, tmp);
+     }
+ 
+@@ -330,7 +330,6 @@
+ {
+     gchar *tmp;
+     gint i;
+-    struct stat status;
+     gzFile *gzfp = NULL;
+     gboolean gzMode = FALSE; 
+     FILE *fp = NULL;
+@@ -340,7 +339,7 @@
+     gchar backup[PATH_MAX];
+     gboolean bkFlag = FALSE;
+     
+-    struct stat st0, st1;
++    struct stat st0;
+ 
+ #ifdef TRACE_FUNC
+     printf("save_file()\n");
--- /dev/null	2007-11-04 00:57:48.000000000 +0100
+++ files/patch-src-jcode.c	2007-11-04 00:49:33.000000000 +0100
@@ -0,0 +1,46 @@
+--- src/jcode.c.orig	2000-10-13 08:45:02.000000000 +0200
++++ src/jcode.c	2007-11-04 00:49:09.000000000 +0100
+@@ -251,7 +251,7 @@
+ char *
+ kanji_conv_auto(char *str, const char *dstset)
+ {
+-    unsigned char *buf, *ret;
++    char *buf, *ret;
+     iconv_t cd;
+     size_t insize = 0;
+     size_t outsize = 0;
+@@ -278,7 +278,7 @@
+         break;
+     }
+     
+-    buf = (unsigned char *)malloc(strlen(str)* 4 + 1);
++    buf = malloc(strlen(str)* 4 + 1);
+     if(!buf)
+         return NULL;
+     
+@@ -315,7 +315,6 @@
+ {
+    static char *jpcode = NULL;
+    static char *locale_euc[]  = { JCODE_LOCALE_EUC, NULL };
+-   static char *locale_jis[]  = { JCODE_LOCALE_JIS, NULL };
+    static char *locale_sjis[] = { JCODE_LOCALE_SJIS, NULL };
+ 
+    static struct LOCALE_TABLE {
+@@ -352,7 +351,7 @@
+ char *
+ kanji_conv(char *str, const char *dstset, const char *srcset)
+ {
+-    unsigned char *buf, *ret;
++    char *buf, *ret;
+     iconv_t cd;
+     size_t insize = 0;
+     size_t outsize = 0;
+@@ -363,7 +362,7 @@
+     if(!str)
+         return NULL;
+     
+-    buf = (unsigned char *)malloc(strlen(str) * 4 + 1);
++    buf = malloc(strlen(str) * 4 + 1);
+     if(!buf)
+         return NULL;
+     
--- /dev/null	2007-11-04 01:00:01.000000000 +0100
+++ files/patch-src-print.c	2007-11-04 00:39:06.000000000 +0100
@@ -0,0 +1,11 @@
+--- src/print.c.orig	2007-11-04 00:37:11.000000000 +0100
++++ src/print.c	2007-11-04 00:38:50.000000000 +0100
+@@ -46,7 +46,7 @@
+ static GtkWidget *print_dialog = NULL;
+ static GtkWidget *print_cmd_entry = NULL;
+ 
+-static GtkWidget *file_sel;
++GtkWidget *file_sel;
+ gchar *print_cmd;
+ 
+ /* °õºþ


>Release-Note:
>Audit-Trail:
>Unformatted:



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