Files

202 lines
6.0 KiB
Diff

--- lib/chalib.c.orig 2003-08-15 12:58:57.000000000 +0900
+++ lib/chalib.c 2011-11-18 22:36:39.000000000 +0900
@@ -364,7 +364,7 @@
char *euc_str;
euc_str = cha_malloc(strlen(str_in) + 1);
- cha_jistoeuc(str_in, euc_str);
+ cha_jistoeuc((unsigned char*)str_in, (unsigned char*)euc_str);
rc = chasen_sparse_main(euc_str, fp_out);
free(euc_str);
@@ -405,7 +405,7 @@
char *euc_str;
euc_str = cha_malloc(strlen(str_in) + 1);
- cha_jistoeuc(str_in, euc_str);
+ cha_jistoeuc((unsigned char*)str_in, (unsigned char*)euc_str);
if (chasen_sparse_main(euc_str, NULL))
return NULL;
--- lib/dartsdic.cpp.orig 2003-07-31 01:06:57.000000000 +0900
+++ lib/dartsdic.cpp 2011-11-18 22:43:18.000000000 +0900
@@ -68,7 +68,7 @@
da = (darts_t*)cha_malloc(sizeof(darts_t));
da->da_mmap = cha_mmap_file(daname);
- darts->setArray(cha_mmap_map(da->da_mmap));
+ darts->set_array(cha_mmap_map(da->da_mmap));
da->da = darts;
da->lex_mmap = cha_mmap_file(lexname);
da->dat_mmap = cha_mmap_file(datname);
@@ -177,18 +177,18 @@
lex_indices.push_back(i->second);
}
lens[size] = key.size();
- (const char*)keys[size] = key.data();
+ keys[size] = (char*)key.data();
vals[size] = redump_lex(lens[size], lex_indices, tmpfile, lexfile);
if (vals[size] < 0) {
std::cerr << "Unexpected error at " << key << std::endl;
- cha_exit_perror("build darts file");
+ cha_exit_perror((char*)"build darts file");
}
size++;
}
std::cerr << size << " keys" << std::endl;
DoubleArrayL da;
- da.build(size, keys, lens, vals);
+ da.build(size, (const char**)keys, lens, vals);
da.save(builder->path->c_str(), "wb");
return builder->entries->size();
--- lib/parse.c.orig 2003-07-31 01:06:57.000000000 +0900
+++ lib/parse.c 2011-11-18 22:49:29.000000000 +0900
@@ -412,7 +412,7 @@
int head_path;
static int path0 = -1;
- cha_tok_parse(Cha_tokenizer, sentence, len + 1);
+ cha_tok_parse(Cha_tokenizer, (unsigned char*)sentence, len + 1);
cha_block_clear(Cha_mrph_block);
free_chars();
--- lib/jfgets.c.orig 2003-07-09 02:08:49.000000000 +0900
+++ lib/jfgets.c 2011-11-19 07:51:01.000000000 +0900
@@ -166,13 +166,13 @@
static unsigned char tmp_buf[INNER_BUFSIZE];
int last;
- if (fgets(tmp_buf, bufsize, stream) == NULL)
+ if (fgets((char*)tmp_buf, bufsize, stream) == NULL)
return NULL;
/*
* remove the last extra character
*/
- last = strlen(tmp_buf) - 1;
+ last = strlen((char*)tmp_buf) - 1;
if (iskanji1(tmp_buf, last)) {
ungetc(tmp_buf[last], stream);
tmp_buf[last] = 0;
@@ -185,7 +185,7 @@
* you must care about string length.
*/
- cha_jistoeuc(tmp_buf, buffer);
+ cha_jistoeuc(tmp_buf, (unsigned char*)buffer);
return buffer;
}
@@ -205,7 +205,7 @@
int kflag; /* kanji flag(0=not found, 1=found) */
if (pos == NULL &&
- (pos = cha_fget_line(ibuf, sizeof(ibuf), stream)) == NULL)
+ (pos = (unsigned char*)cha_fget_line((char*)ibuf, sizeof(ibuf), stream)) == NULL)
return NULL;
kflag = 0;
@@ -217,7 +217,7 @@
* line is end without '\n', long string read more
*/
if (*pos == '\0')
- if ((pos = cha_fget_line(ibuf, sizeof(ibuf), stream)) == NULL)
+ if ((pos = (unsigned char*)cha_fget_line((char*)ibuf, sizeof(ibuf), stream)) == NULL)
break;
/*
@@ -234,7 +234,7 @@
/*
* hit delimiter
*/
- if (isterminator(pos - 2, jfgets_delimiter)) {
+ if (isterminator(pos - 2, (unsigned char*)jfgets_delimiter)) {
if (*pos == '\n')
pos++;
break;
@@ -256,7 +256,7 @@
q--;
if ((pos =
- cha_fget_line(ibuf, sizeof(ibuf), stream)) == NULL)
+ (unsigned char*)cha_fget_line((char*)ibuf, sizeof(ibuf), stream)) == NULL)
break;
while (*pos == ' ' || *pos == '\t')
@@ -290,7 +290,7 @@
/*
* hit delimiter
*/
- if (isterminator(pos - 1, jfgets_delimiter)) {
+ if (isterminator(pos - 1, (unsigned char*)jfgets_delimiter)) {
if (*pos == '\n')
pos++;
break;
--- lib/print.c.orig 2011-11-18 23:18:31.000000000 +0900
+++ lib/print.c 2011-11-19 07:52:38.000000000 +0900
@@ -303,7 +303,7 @@
int len, i;
while (*s1) {
- len = cha_tok_mblen(Cha_tokenizer, s1, 4 /* XXX */);
+ len = cha_tok_mblen(Cha_tokenizer, (unsigned char*)s1, 4 /* XXX */);
for (i = 0; i < len; i++)
if (s1[i] != s2[i])
return s1 - s0;
@@ -327,7 +327,7 @@
int plen, maxplen = 0;
for (;;) {
- for (; *y; y += cha_tok_mblen(Cha_tokenizer, y, 4 /* XXX */)) {
+ for (; *y; y += cha_tok_mblen(Cha_tokenizer, (unsigned char*)y, 4 /* XXX */)) {
if (stat == 0) {
stat = 1;
if ((plen = comm_prefix_len(m, y)) > 0) {
@@ -340,7 +340,7 @@
y0 = y;
if (!*m || !*y)
goto end_ruby;
- m += cha_tok_mblen(Cha_tokenizer, m, 4 /* XXX */);
+ m += cha_tok_mblen(Cha_tokenizer, (unsigned char*)m, 4 /* XXX */);
plen = maxplen = 0;
continue;
}
@@ -351,7 +351,7 @@
}
if (maxplen == 0) {
if (*m)
- m += cha_tok_mblen(Cha_tokenizer, m, 4 /* XXX */);
+ m += cha_tok_mblen(Cha_tokenizer, (unsigned char*)m, 4 /* XXX */);
if (!*m)
ymax = y;
}
@@ -548,7 +548,7 @@
if (anno_no >= 0 &&
(Cha_anno_info[anno_no].hinsi
|| Cha_anno_info[anno_no].format)) {
- mrph.headword = Cha_tokenizer->string + pos_end;
+ mrph.headword = (char*)(Cha_tokenizer->string + pos_end);
mrph.headword_len = mrph.stem_len =
cha_tok_char_type_len(Cha_tokenizer, pos_end);
mrph.reading_len = -1;
@@ -588,7 +588,7 @@
while (*s) {
int i;
- int len = cha_tok_mblen(Cha_tokenizer, (s), 4 /* XXX */);
+ int len = cha_tok_mblen(Cha_tokenizer, (unsigned char*)s, 4 /* XXX */);
if (state == 0 && len == 1 && *s == '{') {
state = 1;
@@ -874,7 +874,7 @@
value *= mrph->weight * Cha_mrph_cost_weight;
break;
case 'S': /* entire sentence */
- word = Cha_tokenizer->string;
+ word = (char*)Cha_tokenizer->string;
break;
case 'p': /* the information about path */
if (s[1] == '\0') {