Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Mar 2008 18:33:06 +0900 (JST)
From:      TANAKA Hiroyuki <kattyo@abk.nu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/121637: [patch] japanese/xtr for gcc 4.2
Message-ID:  <200803120933.m2C9X6Qw069140@filia.abk.nu>
Resent-Message-ID: <200803121000.m2CA02Qf034115@freefall.freebsd.org>

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

>Number:         121637
>Category:       ports
>Synopsis:       [patch] japanese/xtr for gcc 4.2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 12 10:00:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     TANAKA Hiroyuki
>Release:        FreeBSD 7.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD konpeito.d.abk.nu 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 10:35:36 UTC 2008 root@driscoll.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64


>Description:
	I modified this ports to compile with gcc 4.2 on FreeBSD 7.0.
>How-To-Repeat:

>Fix:

--- Makefile	2008-03-12 17:49:21.000000000 +0900
+++ orig/Makefile	2007-10-02 10:17:37.000000000 +0900
@@ -7,7 +7,6 @@
 
 PORTNAME=	xtr
 PORTVERSION=	1.50e.0.2
-PORTREVISION=	1
 CATEGORIES=	japanese textproc
 MASTER_SITES=	ftp://ftp.abk.nu/pub/redist/xtr/
 DISTNAME=	${PORTNAME}1.50e-0.2
@@ -26,6 +25,10 @@
 
 .include <bsd.port.pre.mk>
 
+.if ${OSVERSION} >= 700042
+BROKEN=		Does not compile with GCC 4.2
+.endif
+
 post-extract:
 	@${ECHO_MSG} "===>  Converting Kanji code for ${DISTNAME}"
 	@(cd ${WRKSRC} && $(SH) EUCsetup )
--- src/main.c.orig	2008-03-12 17:10:51.000000000 +0900
+++ src/main.c	2008-03-12 17:21:25.000000000 +0900
@@ -401,10 +401,10 @@
 int stdinmode;				/* 標準入力から入力 */
 uchar *ifilename;			/* 現在の入力ファイル名 */
 uchar *ifilename1;			/* 入力ファイル名の代表 */
-FILE *ifp = stdin;
+FILE *ifp;
 int stdoutmode;				/* 標準出力へ出力 */
 uchar *ofilename;
-FILE *ofp = stdout;
+FILE *ofp;
 uchar *bakfilename;			/* .BAK にリネームされた入力ファイル名 */
 
 
@@ -653,6 +653,8 @@
 #define ISTWONCASE(f) ((f) & (1 << 30))
 #endif
 #if UNIX
+	ifp = stdin;
+	ofp = stdout;
 	set_mbtype();
 #endif
 #ifdef HELPMSG_AS_WORKAREA
--- src/xstring.c.orig	2008-03-12 17:29:03.000000000 +0900
+++ src/xstring.c	2008-03-12 17:45:20.000000000 +0900
@@ -351,10 +351,16 @@
 	uchar *dstp = dst;
 
 	while (*src) {
-		if (IsKanjiStr(src))
-			*((ushort*)dstp)++ = *((ushort*)src)++;
-		else
-			*dstp++ = (*func)(*src++);
+		if (IsKanjiStr(src)) {
+			*((ushort*)dstp) = *((ushort*)src);
+			(ushort*)src++;
+			(ushort*)dstp++;
+		}
+		else {
+			*dstp = (*func)(*src);
+			src++;
+			dstp++;
+		}
 	}
 	*dstp = 0;
 	return dstp - dst;
>Release-Note:
>Audit-Trail:
>Unformatted:



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