Fix build error with clang.
This commit is contained in:
parent
86ce0d9beb
commit
d9dbee85e7
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=281195
2 changed files with 44 additions and 8 deletions
|
@ -1,15 +1,15 @@
|
|||
--- Makefile.orig Wed Feb 24 14:21:39 1993
|
||||
+++ Makefile Sun Apr 2 11:42:44 2000
|
||||
--- Makefile.orig 1993-02-24 14:21:39.000000000 +0800
|
||||
+++ Makefile 2011-09-05 14:22:03.000000000 +0800
|
||||
@@ -1,9 +1,9 @@
|
||||
-CC=cc
|
||||
+CC=cc -DCHINDICT=\"$(PREFIX)/share/chinese/gb/TONEPY.tit\"
|
||||
+DEFINE= -DCHINDICT=\"$(PREFIX)/share/chinese/gb/TONEPY.tit\"
|
||||
|
||||
all: c2t
|
||||
|
||||
c2t: c2t.o
|
||||
- $(CC) -O -o c2t c2t.o
|
||||
+ $(CC) $(CFLAGS) -o c2t c2t.o
|
||||
+ $(CC) $(CFLAGS) $(DEFINE) -o c2t c2t.o
|
||||
|
||||
c2t.o: c2t.c
|
||||
- $(CC) -O -c c2t.c
|
||||
+ $(CC) $(CFLAGS) -c c2t.c
|
||||
+ $(CC) $(CFLAGS) $(DEFINE) -c c2t.c
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
--- c2t.c.orig Wed Feb 24 07:29:23 1993
|
||||
+++ c2t.c Tue Dec 19 19:51:28 2006
|
||||
@@ -22,10 +22,14 @@
|
||||
--- c2t.c.orig 1993-02-24 14:29:23.000000000 +0800
|
||||
+++ c2t.c 2011-09-05 14:25:34.000000000 +0800
|
||||
@@ -18,14 +18,18 @@
|
||||
|
||||
#define MEMAREA 4096 /* max number of lines in DICT file, wc -l DICT */
|
||||
|
||||
-main(argc, argv)
|
||||
+int main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
|
@ -16,3 +21,34 @@
|
|||
register int rpit=0, tila=0, rraja=0, mulpin=0;
|
||||
int monitila=0;
|
||||
FILE *piffi=0;
|
||||
@@ -57,12 +61,12 @@ char **argv;
|
||||
i =0;
|
||||
} /*if argc > 1 */
|
||||
if ((piffi = fopen (DICT, "r")) == 0) {
|
||||
- printf (stderr, "Error: unable to open pinyin dictionnary %s\n",
|
||||
+ fprintf (stderr, "Error: unable to open pinyin dictionnary %s\n",
|
||||
DICT);
|
||||
exit (-1);
|
||||
}
|
||||
if ((taulu = (char **)malloc (MEMAREA*sizeof(char *))) == 0) {
|
||||
- printf (stderr, "Error: out of memory when allocating taulu(MEMAREA too large)\n");
|
||||
+ fprintf (stderr, "Error: out of memory when allocating taulu(MEMAREA too large)\n");
|
||||
exit (-2);
|
||||
}
|
||||
pipo = taulu;
|
||||
@@ -81,13 +85,13 @@ char **argv;
|
||||
} else {
|
||||
if (rivi[0] == '#') continue;
|
||||
if ((*pipo = (char *)malloc (rpit+8)) == 0) {
|
||||
- printf (stderr, "Error: out of memory when allocating *pipo\n");
|
||||
+ fprintf (stderr, "Error: out of memory when allocating *pipo\n");
|
||||
exit (-3);
|
||||
}
|
||||
strcpy (*pipo, rivi);
|
||||
pipo++;
|
||||
if (++rraja >= MEMAREA) {
|
||||
- printf (stderr, "Error: out of memory when allocating *pipo(MEMAREA too small)...\n");
|
||||
+ fprintf (stderr, "Error: out of memory when allocating *pipo(MEMAREA too small)...\n");
|
||||
exit (-4);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue