aboutsummaryrefslogtreecommitdiff
path: root/chinese/hc
diff options
context:
space:
mode:
authorVanilla I. Shu <vanilla@FreeBSD.org>2011-09-05 06:43:20 +0000
committerVanilla I. Shu <vanilla@FreeBSD.org>2011-09-05 06:43:20 +0000
commitba709719d6331032a6f6c57eeaed721f2a116418 (patch)
tree0fc1cf5090a6b00c3f9ab55dfaa494b992871a89 /chinese/hc
parentcda1a1ac1e72a6458e805526669039721d1b2f7f (diff)
downloadports-ba709719d6331032a6f6c57eeaed721f2a116418.tar.gz
ports-ba709719d6331032a6f6c57eeaed721f2a116418.zip
Fix build error with clang.
Notes
Notes: svn path=/head/; revision=281202
Diffstat (limited to 'chinese/hc')
-rw-r--r--chinese/hc/files/patch-0111
-rw-r--r--chinese/hc/files/patch-hc.c23
-rw-r--r--chinese/hc/files/patch-hclib.c41
-rw-r--r--chinese/hc/files/patch-hclib.h11
4 files changed, 83 insertions, 3 deletions
diff --git a/chinese/hc/files/patch-01 b/chinese/hc/files/patch-01
index 2e56bffc366c..4892ab29624f 100644
--- a/chinese/hc/files/patch-01
+++ b/chinese/hc/files/patch-01
@@ -1,6 +1,11 @@
---- Makefile.orig Wed Mar 10 23:22:44 1993
-+++ Makefile Tue Feb 4 02:48:17 1997
-@@ -5,12 +5,12 @@
+--- Makefile.orig 1993-03-11 15:22:44.000000000 +0800
++++ Makefile 2011-09-05 14:30:15.000000000 +0800
+@@ -1,16 +1,16 @@
+ # Makefile for hc (Hanzi Converter) 3.0
+
+ hc: hc.o hclib.o
+- cc -o hc hc.o hclib.o
++ $(CC) -o hc hc.o hclib.o
b2g:
echo "#! /bin/csh" > b2g
diff --git a/chinese/hc/files/patch-hc.c b/chinese/hc/files/patch-hc.c
new file mode 100644
index 000000000000..79fd9b9b836c
--- /dev/null
+++ b/chinese/hc/files/patch-hc.c
@@ -0,0 +1,23 @@
+--- hc.c.orig 2011-09-05 14:33:19.000000000 +0800
++++ hc.c 2011-09-05 14:34:11.000000000 +0800
+@@ -54,9 +54,11 @@
+
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include "hclib.h"
+
+-static usage(prog)
++static int usage(prog)
+ char *prog;
+ {
+ fprintf(stderr,"usage: %s -m mode -map mapping [-t t1 t2 ...] < file\n",
+@@ -68,6 +70,7 @@ char *prog;
+ }
+
+
++int
+ main(argc, argv)
+ int argc;
+ char *argv[];
diff --git a/chinese/hc/files/patch-hclib.c b/chinese/hc/files/patch-hclib.c
new file mode 100644
index 000000000000..5e0f33dd3620
--- /dev/null
+++ b/chinese/hc/files/patch-hclib.c
@@ -0,0 +1,41 @@
+--- hclib.c.orig 2011-09-05 14:36:04.000000000 +0800
++++ hclib.c 2011-09-05 14:38:30.000000000 +0800
+@@ -155,7 +155,7 @@ static void add(a1, am, i, code)
+ else if (am[i]) /* already has multiple mappings */
+ {
+ /* Check multiple mapping list, if there, return. */
+- while (x=am[i][n])
++ while ((x = am[i][n]))
+ {
+ if (x==code) return;
+ else n++;
+@@ -191,17 +191,17 @@ static int do_line (lcnt, buffer)
+
+ if (!inGBrange(gb_code))
+ {
+- fprintf(stderr, "Invalid GB code in line %d\n", lcnt);
++ fprintf(stderr, "Invalid GB code in line %ld\n", lcnt);
+ return(0);
+ }
+- while (c1=buffer[i++])
++ while ((c1 = buffer[i++]))
+ {
+ c2 = buffer[i++];
+ if (!(c1&&c2)) break;
+ big_code = DB(c1,c2);
+ if (!inBIGrange(big_code))
+ {
+- fprintf(stderr, "Invalid BIG5 code in line %d\n", lcnt);
++ fprintf(stderr, "Invalid BIG5 code in line %ld\n", lcnt);
+ return(0);
+ }
+ add(GtoB, mGtoB, gb_code - GBfirst, big_code);
+@@ -261,7 +261,7 @@ static int cvrt(a1, am, i, result, n)
+ if (codeDes == 0) return(0);
+ result[0] = codeDes;
+ if (am[i])
+- while (x = am[i][k])
++ while ((x = am[i][k]))
+ {
+ if (k>=n) break;
+ result[++k] = x;
diff --git a/chinese/hc/files/patch-hclib.h b/chinese/hc/files/patch-hclib.h
new file mode 100644
index 000000000000..9d56eee37f5e
--- /dev/null
+++ b/chinese/hc/files/patch-hclib.h
@@ -0,0 +1,11 @@
+--- hclib.h.orig 2011-09-05 14:32:54.000000000 +0800
++++ hclib.h 2011-09-05 14:34:36.000000000 +0800
+@@ -114,7 +114,7 @@ extern int hc_convert(/* int mode, u_int
+ Hanzi that cannot be converted is replaced by a "box" character code.
+ If do_mult is true, all multiple mappings will be shown in <<...>>.
+ */
+-extern hc_convert_fp(/* FILE *ifp, FILE *ofp, int mode, int do_mult */);
++extern int hc_convert_fp(/* FILE *ifp, FILE *ofp, int mode, int do_mult */);
+
+ /* Convert a hanzi code according to mode, and return the converted code.
+ In case of multiple mappings, an arbitrary one is returned.