ports/119989: [PORTS][PATCH] chinese/chinput3: fixed compile problems

Yuri yuri at tsoft.com
Sat Jan 26 00:20:02 UTC 2008


>Number:         119989
>Category:       ports
>Synopsis:       [PORTS][PATCH] chinese/chinput3: fixed compile problems
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 26 00:20:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Yuri
>Release:        7.0-PRERELEASE
>Organization:
n/a
>Environment:
irrelevant
>Description:
Fixed errors and most warnings in this port.
Package itself seems to be disowned.
Owners listed in the package are all in turbolinux.com.cn which doesn't exist any more.

New patches actually belong to the package itself, but unclear who maintains it, if anyone.


>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN chinput3.orig/Makefile chinput3/Makefile
--- chinput3.orig/Makefile	2007-07-03 02:32:54.000000000 -0700
+++ chinput3/Makefile	2008-01-25 15:58:39.000000000 -0800
@@ -30,10 +30,6 @@
 BROKEN=		Does not compile on !i386
 .endif
 
-.if ${OSVERSION} >= 700042
-BROKEN=		Does not compile with GCC 4.2
-.endif
-
 post-patch:
 	@${REINPLACE_CMD} -e '/extern int ForwardEvent();/d' \
 		${WRKSRC}/src/Chinput-*/src/*.c
diff -ruN chinput3.orig/files/patch-cce-cin2tab.c chinput3/files/patch-cce-cin2tab.c
--- chinput3.orig/files/patch-cce-cin2tab.c	1969-12-31 16:00:00.000000000 -0800
+++ chinput3/files/patch-cce-cin2tab.c	2008-01-25 14:46:21.000000000 -0800
@@ -0,0 +1,11 @@
+--- src/unicon-im/ImmModules/cce/cin2tab.c.orig	2008-01-25 14:10:07.000000000 -0800
++++ src/unicon-im/ImmModules/cce/cin2tab.c	2008-01-25 14:32:40.000000000 -0800
+@@ -162,7 +162,7 @@
+ int i,k;
+ char fname[64], fname_cin[64], fname_tab[64];
+ char fname_phr[64],fname_lx[64];
+-char tt[128];
++unsigned char tt[128];
+ unsigned char *cmd, *arg;
+ hz_input_table InpTable;
+ int TotalKeyNum;
diff -ruN chinput3.orig/files/patch-cce-xl_hzinput chinput3/files/patch-cce-xl_hzinput
--- chinput3.orig/files/patch-cce-xl_hzinput	1969-12-31 16:00:00.000000000 -0800
+++ chinput3/files/patch-cce-xl_hzinput	2008-01-25 15:54:06.000000000 -0800
@@ -0,0 +1,22 @@
+--- src/unicon-im/ImmModules/cce/xl_hzinput.c.orig	2008-01-25 14:10:07.000000000 -0800
++++ src/unicon-im/ImmModules/cce/xl_hzinput.c	2008-01-25 15:49:32.000000000 -0800
+@@ -124,7 +124,7 @@
+ 
+ static void GetAssociatePhrases (HzInputTable_T *pClient, unsigned char *p)
+ {
+-    int index,len = strlen(p);
++    int index,len = strlen((const char*)p);
+ 
+     if (pClient->InputCount <= pClient->InputMatch)  /* All Match */
+     {
+@@ -291,8 +291,8 @@
+     {
+          fseek( pClient->cur_table->AssocFile, index << 2, SEEK_SET );
+          fread( &PhraseNo, sizeof(int), 1, pClient->cur_table->AssocFile );
+-         LoadPhrase(pClient,  PhraseNo, str );
+-         strcpy(pClient->seltab[pClient->CurSelNum],str+2);
++         LoadPhrase(pClient,  PhraseNo, (char*)str );
++         strcpy(pClient->seltab[pClient->CurSelNum],(char*)str+2);
+          CurLen += strlen(pClient->seltab[pClient->CurSelNum++]);
+          index++;
+     }
diff -ruN chinput3.orig/files/patch-register chinput3/files/patch-register
--- chinput3.orig/files/patch-register	1969-12-31 16:00:00.000000000 -0800
+++ chinput3/files/patch-register	2008-01-25 14:18:20.000000000 -0800
@@ -0,0 +1,11 @@
+--- src/Chinput-3.0.2/src/IMdkit/lib/i18nClbk.c.orig	2008-01-25 14:16:09.000000000 -0800
++++ src/Chinput-3.0.2/src/IMdkit/lib/i18nClbk.c	2008-01-25 14:13:15.000000000 -0800
+@@ -129,7 +129,7 @@
+     XIMPreeditDrawCallbackStruct *draw =
+         (XIMPreeditDrawCallbackStruct *) &preedit_CB->todo.draw;
+     CARD16 connect_id = call_data->any.connect_id;
+-    register int feedback_count;
++    int feedback_count;
+     register int i;
+     BITMASK32 status = 0x0;
+ 
diff -ruN chinput3.orig/files/patch-server-TLS_AsciiConvertor chinput3/files/patch-server-TLS_AsciiConvertor
--- chinput3.orig/files/patch-server-TLS_AsciiConvertor	1969-12-31 16:00:00.000000000 -0800
+++ chinput3/files/patch-server-TLS_AsciiConvertor	2008-01-25 15:55:40.000000000 -0800
@@ -0,0 +1,11 @@
+--- src/unicon-im/server/TLS_AsciiConvertor.cpp.orig	2008-01-25 14:10:08.000000000 -0800
++++ src/unicon-im/server/TLS_AsciiConvertor.cpp	2008-01-25 15:46:52.000000000 -0800
+@@ -202,7 +202,7 @@
+ 
+ int IsSymbol (unsigned char key)
+ {
+-    char *szSymbol = ";:'\"<,>.?/[{]{";
++    const char *szSymbol = ";:'\"<,>.?/[{]{";
+     int i, len = strlen (szSymbol);
+     for (i = 0; i < len; i++)
+        if (key == szSymbol[i])
diff -ruN chinput3.orig/files/patch-server-TLS_HzConvertTable chinput3/files/patch-server-TLS_HzConvertTable
--- chinput3.orig/files/patch-server-TLS_HzConvertTable	1969-12-31 16:00:00.000000000 -0800
+++ chinput3/files/patch-server-TLS_HzConvertTable	2008-01-25 15:56:20.000000000 -0800
@@ -0,0 +1,13 @@
+--- src/unicon-im/server/TLS_HzConvertTable.h.orig	2008-01-25 14:10:08.000000000 -0800
++++ src/unicon-im/server/TLS_HzConvertTable.h	2008-01-25 15:23:12.000000000 -0800
+@@ -19,8 +19,8 @@
+ */
+ 
+ typedef struct _GB2BIG5 {
+-	char *gb;
+-	char *big5;
++	const char *gb;
++	const char *big5;
+ } GB2BIG5;
+ 
+ #define TABLENUM sizeof(g2b)/sizeof(g2b[0])
diff -ruN chinput3.orig/files/patch-server-TLS_ImmOp chinput3/files/patch-server-TLS_ImmOp
--- chinput3.orig/files/patch-server-TLS_ImmOp	1969-12-31 16:00:00.000000000 -0800
+++ chinput3/files/patch-server-TLS_ImmOp	2008-01-25 14:46:08.000000000 -0800
@@ -0,0 +1,11 @@
+--- src/unicon-im/server/TLS_ImmOp.cpp.orig	2008-01-25 14:10:08.000000000 -0800
++++ src/unicon-im/server/TLS_ImmOp.cpp	2008-01-25 14:20:30.000000000 -0800
+@@ -23,7 +23,7 @@
+  * Author: see CREDITS
+  */
+ 
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <string.h>
+ #include <dlfcn.h>
diff -ruN chinput3.orig/files/patch-server-TLS_LibMain chinput3/files/patch-server-TLS_LibMain
--- chinput3.orig/files/patch-server-TLS_LibMain	1969-12-31 16:00:00.000000000 -0800
+++ chinput3/files/patch-server-TLS_LibMain	2008-01-25 14:45:24.000000000 -0800
@@ -0,0 +1,11 @@
+--- src/unicon-im/server/TLS_LibMain.cpp.orig	2008-01-25 14:10:08.000000000 -0800
++++ src/unicon-im/server/TLS_LibMain.cpp	2008-01-25 14:21:32.000000000 -0800
+@@ -35,7 +35,7 @@
+ #include <signal.h>
+ #include <netdb.h>
+ #include <unistd.h>
+-#include <iostream.h>
++#include <iostream>
+ //#include <pth.h>
+ 
+ #include <TLS_MemFile.hpp>
diff -ruN chinput3.orig/files/patch-server-TLS_MemFile chinput3/files/patch-server-TLS_MemFile
--- chinput3.orig/files/patch-server-TLS_MemFile	1969-12-31 16:00:00.000000000 -0800
+++ chinput3/files/patch-server-TLS_MemFile	2008-01-25 14:45:59.000000000 -0800
@@ -0,0 +1,20 @@
+--- src/unicon-im/server/TLS_MemFile.cpp.orig	2008-01-25 14:10:08.000000000 -0800
++++ src/unicon-im/server/TLS_MemFile.cpp	2008-01-25 14:22:31.000000000 -0800
+@@ -23,7 +23,7 @@
+  * Author: see CREDITS
+  */
+ 
+-#include <iostream.h>
++#include <iostream>
+ #include <assert.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -32,6 +32,8 @@
+ 
+ #include <TLS_MemFile.hpp>
+ 
++using namespace std;
++
+ TLS_CMemFile::TLS_CMemFile (unsigned long max0)
+ {
+     buf = (char *) malloc (max0);
diff -ruN chinput3.orig/files/patch-turbo-cin2tab chinput3/files/patch-turbo-cin2tab
--- chinput3.orig/files/patch-turbo-cin2tab	1969-12-31 16:00:00.000000000 -0800
+++ chinput3/files/patch-turbo-cin2tab	2008-01-25 14:42:42.000000000 -0800
@@ -0,0 +1,73 @@
+--- src/unicon-im/ImmModules/turbo/cin2tab.c.orig	2008-01-25 14:10:08.000000000 -0800
++++ src/unicon-im/ImmModules/turbo/cin2tab.c	2008-01-25 14:37:33.000000000 -0800
+@@ -29,6 +29,7 @@
+ #include <sys/types.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <ctype.h> // for tolower
+ #include "xl_hzinput.h"
+ #include "xl_sysphrase.h"
+ #include "xl_phrase.h"
+@@ -194,24 +195,24 @@
+     /************** Now some basic information ************************/
+     strcpy(InpTable.magic_number,MAGIC_NUMBER);
+     cmd_arg(tt, &cmd, &arg);
+-    if (strcmp(cmd,"%ename") || !(*arg) )
++    if (strcmp((const char*)cmd,"%ename") || !(*arg) )
+         print_error("%d:  %%ename english_name  expected", lineno);
+     arg[CIN_ENAME_LENGTH-1]=0;
+     strcpy(InpTable.ename,arg);
+ 
+     cmd_arg(tt, &cmd, &arg);
+-    if (strcmp(cmd,"%prompt") || !(*arg) )
++    if (strcmp((const char*)cmd,"%prompt") || !(*arg) )
+         print_error("%d:  %%prompt prompt_name  expected", lineno);
+     arg [CIN_CNAME_LENGTH-1]=0;
+     strcpy(InpTable.cname, arg);
+ 
+     cmd_arg(tt,&cmd, &arg); 
+-    if (strcmp(cmd,"%selkey") || !(*arg) )
++    if (strcmp((const char*)cmd,"%selkey") || !(*arg) )
+         print_error("%d:  %%selkey select_key_list expected", lineno);
+     strcpy(InpTable.selkey,arg);
+ 
+     cmd_arg(tt,&cmd, &arg);
+-    if (strcmp(cmd,"%last_full") || !(*arg)) 
++    if (strcmp((const char*)cmd,"%last_full") || !(*arg)) 
+         InpTable.last_full = 1;
+     else 
+     {
+@@ -222,21 +223,21 @@
+         cmd_arg(tt, &cmd, &arg);
+     }
+ 
+-    if (strcmp(cmd,"%dupsel") || !(*arg) )
++    if (strcmp((const char*)cmd,"%dupsel") || !(*arg) )
+         print_error("%d:  %%dupsel NO of dup sel keys  expected", lineno);
+     InpTable.MaxDupSel=atoi(arg);
+ 
+     /*************** now the keyname ****************************/
+ 
+     cmd_arg(tt,&cmd, &arg);
+-    if (strcmp(cmd,"%keyname") || strcmp(arg,"begin"))
++    if (strcmp((const char*)cmd,"%keyname") || strcmp((const char*)arg,"begin"))
+         print_error("%d:  %%keyname begin   expected", lineno);
+ 
+     TotalKeyNum=0;
+     while(1) 
+     {
+         cmd_arg(tt,&cmd, &arg);
+-        if (!strcmp(cmd,"%keyname")) break;
++        if (!strcmp((const char*)cmd,"%keyname")) break;
+         k = tolower(cmd[0]);  /* k = char */
+         if (InpTable.KeyMap[k]) 
+             print_error("%d:  key %c is already used",lineno, k);
+@@ -265,7 +266,7 @@
+         cmd_arg(tt,&cmd,&arg);
+         if (!cmd[0] || !arg[0]) 
+             break;
+-        len = strlen(cmd);
++        len = strlen((const char*)cmd);
+         if (len > InpTable.MaxPress) 
+             InpTable.MaxPress=len;
+         if (len > 10) 


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



More information about the freebsd-ports-bugs mailing list