From nobody@FreeBSD.org  Wed Oct  6 03:19:33 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5521416A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  6 Oct 2004 03:19:33 +0000 (GMT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2BAF243D53
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  6 Oct 2004 03:19:33 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i963JXRm032287
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 6 Oct 2004 03:19:33 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.11/8.12.11/Submit) id i963JXFU032286;
	Wed, 6 Oct 2004 03:19:33 GMT
	(envelope-from nobody)
Message-Id: <200410060319.i963JXFU032286@www.freebsd.org>
Date: Wed, 6 Oct 2004 03:19:33 GMT
From: David Xu <davidxu@FreeBSD.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: 64 bits cleanup patches for fcitx 2.0.1
X-Send-Pr-Version: www-2.3

>Number:         72371
>Category:       ports
>Synopsis:       64 bits cleanup patches for fcitx 2.0.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 06 03:20:22 GMT 2004
>Closed-Date:    Fri Oct 15 08:10:10 GMT 2004
>Last-Modified:  Fri Oct 15 08:10:10 GMT 2004
>Originator:     David Xu
>Release:        6.0 CURRENT
>Organization:
FreeBSD
>Environment:
FreeBSD alona.xuyifeng.com 6.0-CURRENT FreeBSD 6.0-CURRENT #1: Wed Oct  6 10:07:32 CST 2004     davidxu@alona.xuyifeng.com:/d1/src/sys/amd64/compile/alona  amd64

>Description:
ports chinese/fcitx is not 64 bits clean, running it under AMD64 cause it to abort.

>How-To-Repeat:
setenv XMODIFIERS "@im=fcitx"
and put:
fcitx & 
at first line of ~/.xinitrc
then startx and presses ctrl + space, and input some characters, it will abort.

>Fix:
patches:
diff -u ./InputWindow.c.old ./InputWindow.c
--- ./InputWindow.c.old	Tue Dec 30 15:54:47 2003
+++ ./InputWindow.c	Wed Oct  6 11:04:54 2004
@@ -110,7 +110,7 @@
     char            str1[] = "Ay&#20013;";
     char            str2[10];
     char           *ps1, *ps2;
-    int             l1, l2;
+    size_t         l1, l2;
 
     if (!xftFont)
 	return;
@@ -120,7 +120,7 @@
     ps2 = str2;
     ps1 = str1;
 
-    l1 = iconv (convUTF8, (char **) &ps1, &l1, &ps2, &l2);
+    l1 = iconv (convUTF8, (const char **) &ps1, &l1, &ps2, &l2);
 
     XftTextExtentsUtf8 (dpy, xftFont, str2, strlen (str2), &extents);
     iInputWindowHeight = extents.height * 2 + extents.height / 2 + 8;
diff -u ./ui.c.old ./ui.c
--- ./ui.c.old	Wed Oct  6 11:05:19 2004
+++ ./ui.c	Wed Oct  6 11:04:54 2004
@@ -284,7 +284,7 @@
     XGlyphInfo      extents;
     char            str1[100];
     char           *ps, *ps1;
-    int             l1, l2;
+    size_t         l1, l2;
 
     if (!xftFont)
 	return 0;
@@ -294,7 +294,7 @@
     ps = str1;
     ps1 = str;
 
-    l1 = iconv (convUTF8, (char **) &str, &l1, &ps, &l2);
+    l1 = iconv (convUTF8, (const char **) &str, &l1, &ps, &l2);
     *ps = '\0';
     XftTextExtentsUtf8 (dpy, xftFont, str1, strlen (str1), &extents);
     return extents.width;
@@ -323,7 +323,7 @@
 void OutputString (Window window, char *str, int x, int y, XColor color)
 {
     char            strOutput[100] = "";	//&#35813;&#38271;&#24230;&#24212;&#35813;&#22815;&#29992;&#20102;
-    int             l1, l2;
+    size_t          l1, l2;
     char           *ps;
     XftColor        xftColor;
     XRenderColor    renderColor;
@@ -339,7 +339,7 @@
     l2 = 99;
     ps = strOutput;
 
-    l1 = iconv (convUTF8, (char **) (&str), &l1, &ps, &l2);
+    l1 = iconv (convUTF8, (const char **) (&str), &l1, &ps, &l2);
 
     renderColor.red = color.red;
     renderColor.green = color.green;
diff -u ./xim.c.old ./xim.c
--- ./xim.c.old	Wed Oct  6 11:05:19 2004
+++ ./xim.c	Wed Oct  6 11:04:54 2004
@@ -336,7 +336,7 @@
     char           *ps;
 
     if (bIsUtf8) {
-	int             l1, l2;
+	size_t            l1, l2;
 
 	ps = strOutput;
 	l1 = strlen (strHZ);

>Release-Note:
>Audit-Trail:

From: Dryice Liu <dryice@hotpop.com>
To: freebsd-gnats-submit@FreeBSD.org
Cc: davidxu@FreeBSD.org
Subject: Re: ports/72371: 64 bits cleanup patches for fcitx 2.0.1
Date: Thu, 14 Oct 2004 23:46:08 +0800

 Thanks for the patch. Maintainer approve.
 
 Here's a clean-up version to make the ports committer's life easier :)
 
 Added files:
 
 files/patch-InputWindow.c
 files/patch-ui.c
 files/patch-xim.c
 
 
 ----------------------------------------------------------------------
 diff -ruN fcitx.orig/files/patch-InputWindow.c fcitx/files/patch-InputWindo=
 w.c
 --- fcitx.orig/files/patch-InputWindow.c	Thu Jan  1 08:00:00 1970
 +++ fcitx/files/patch-InputWindow.c	Thu Oct 14 23:22:24 2004
 @@ -0,0 +1,20 @@
 +--- InputWindow.c.orig	Tue Dec 30 15:54:47 2003
 ++++ InputWindow.c	Thu Oct 14 23:18:49 2004
 +@@ -110,7 +110,7 @@
 +     char            str1[] =3D "Ay=D6=D0";
 +     char            str2[10];
 +     char           *ps1, *ps2;
 +-    int             l1, l2;
 ++    size_t          l1, l2;
 +=20
 +     if (!xftFont)
 + 	return;
 +@@ -120,7 +120,7 @@
 +     ps2 =3D str2;
 +     ps1 =3D str1;
 +=20
 +-    l1 =3D iconv (convUTF8, (char **) &ps1, &l1, &ps2, &l2);
 ++    l1 =3D iconv (convUTF8, (const char **) &ps1, &l1, &ps2, &l2);
 +=20
 +     XftTextExtentsUtf8 (dpy, xftFont, str2, strlen (str2), &extents);
 +     iInputWindowHeight =3D extents.height * 2 + extents.height / 2 + 8;
 diff -ruN fcitx.orig/files/patch-ui.c fcitx/files/patch-ui.c
 --- fcitx.orig/files/patch-ui.c	Thu Jan  1 08:00:00 1970
 +++ fcitx/files/patch-ui.c	Thu Oct 14 23:23:50 2004
 @@ -0,0 +1,38 @@
 +--- ui.c.orig	Sun Jan  4 15:42:01 2004
 ++++ ui.c	Thu Oct 14 23:20:27 2004
 +@@ -284,7 +284,7 @@
 +     XGlyphInfo      extents;
 +     char            str1[100];
 +     char           *ps, *ps1;
 +-    int             l1, l2;
 ++    size_t          l1, l2;
 +=20
 +     if (!xftFont)
 + 	return 0;
 +@@ -294,7 +294,7 @@
 +     ps =3D str1;
 +     ps1 =3D str;
 +=20
 +-    l1 =3D iconv (convUTF8, (char **) &str, &l1, &ps, &l2);
 ++    l1 =3D iconv (convUTF8, (const char **) &str, &l1, &ps, &l2);
 +     *ps =3D '\0';
 +     XftTextExtentsUtf8 (dpy, xftFont, str1, strlen (str1), &extents);
 +     return extents.width;
 +@@ -323,7 +323,7 @@
 + void OutputString (Window window, char *str, int x, int y, XColor color)
 + {
 +     char            strOutput[100] =3D "";	//=B8=C3=B3=A4=B6=C8=D3=A6=B8=
 =C3=B9=BB=D3=C3=C1=CB
 +-    int             l1, l2;
 ++    size_t          l1, l2;
 +     char           *ps;
 +     XftColor        xftColor;
 +     XRenderColor    renderColor;
 +@@ -339,7 +339,7 @@
 +     l2 =3D 99;
 +     ps =3D strOutput;
 +=20
 +-    l1 =3D iconv (convUTF8, (char **) (&str), &l1, &ps, &l2);
 ++    l1 =3D iconv (convUTF8, (const char **) (&str), &l1, &ps, &l2);
 +=20
 +     renderColor.red =3D color.red;
 +     renderColor.green =3D color.green;
 diff -ruN fcitx.orig/files/patch-xim.c fcitx/files/patch-xim.c
 --- fcitx.orig/files/patch-xim.c	Thu Jan  1 08:00:00 1970
 +++ fcitx/files/patch-xim.c	Thu Oct 14 23:22:53 2004
 @@ -0,0 +1,11 @@
 +--- xim.c.orig	Tue Jan  6 14:12:11 2004
 ++++ xim.c	Thu Oct 14 23:21:07 2004
 +@@ -336,7 +336,7 @@
 +     char           *ps;
 +=20
 +     if (bIsUtf8) {
 +-	int             l1, l2;
 ++	size_t          l1, l2;
 +=20
 + 	ps =3D strOutput;
 + 	l1 =3D strlen (strHZ);
 ----------------------------------------------------------------------
 
 
 --=20
 Cheers,
 Dryice
 
 http://dryice.3322.org
 

From: David Xu <davidxu@freebsd.org>
To: Dryice Liu <dryice@hotpop.com>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: ports/72371: 64 bits cleanup patches for fcitx 2.0.1
Date: Fri, 15 Oct 2004 07:24:07 +0800

 Looks good to me.
 Thanks.
 
 David Xu
 
 
 Dryice Liu wrote:
 
 >Thanks for the patch. Maintainer approve.
 >
 >Here's a clean-up version to make the ports committer's life easier :)
 >
 >Added files:
 >
 >files/patch-InputWindow.c
 >files/patch-ui.c
 >files/patch-xim.c
 >
 >  
 >
 
State-Changed-From-To: open->closed 
State-Changed-By: clive 
State-Changed-When: Fri Oct 15 08:09:51 GMT 2004 
State-Changed-Why:  
Committed, thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72371 
>Unformatted:
