Mercurial > freewnn
changeset 22:c966456648ad
- fixed argument style in function definition
- created header files for prototype check. (in progress)
- suppress warnings
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Thu, 17 Apr 2008 01:17:45 +0900 |
parents | 22b754fbd8fe |
children | e1aadb6dcbd4 |
files | Wnn/etc/gethinsi.c Wnn/etc/hindo.c Wnn/etc/revdic.c Wnn/etc/yincoding.c Wnn/jutil/atod.c Wnn/jutil/atod.h Wnn/jutil/atorev.h Wnn/jutil/dtoa.c Wnn/jutil/dtoa.h Wnn/jutil/ujisf.c Wnn/jutil/ujisf.h Wnn/jutil/wddel.c Wnn/jutil/wdreg.c |
diffstat | 13 files changed, 250 insertions(+), 255 deletions(-) [+] |
line wrap: on
line diff
--- a/Wnn/etc/gethinsi.c Tue Apr 15 19:32:47 2008 +0900 +++ b/Wnn/etc/gethinsi.c Thu Apr 17 01:17:45 2008 +0900 @@ -122,20 +122,19 @@ int mnode = 0; static void -error_long () +error_long (void) { wnnerror_hinsi = WNN_TOO_LONG_HINSI_FILE_LINE; } static void -error_no_heap () +error_no_heap (void) { wnnerror_hinsi = WNN_TOO_BIG_HINSI_FILE; } static int -get_char0 (fp) - FILE *fp; +get_char0 (FILE *fp) { int c, d; @@ -181,8 +180,7 @@ } static int -get_char (fp) /* remove null lines */ - FILE *fp; +get_char (FILE *fp) /* remove null lines */ { static int c = -1; int d; @@ -215,10 +213,7 @@ /* get one phrase and return the separater */ static int -get_phrase (s0, size, fp) - UCHAR *s0; - int size; - FILE *fp; +get_phrase (UCHAR *s0, int size, FILE *fp) { UCHAR *s = s0; int c; @@ -250,9 +245,7 @@ } static int -stradd (cp, str) - w_char **cp; - char *str; +stradd (w_char **cp, char *str) { int len = strlen (str); @@ -268,9 +261,7 @@ } static int -w_stradd (cp, str) - unsigned short **cp; - unsigned short *str; +w_stradd (unsigned short **cp, unsigned short *str) { *cp = whp; @@ -288,8 +279,7 @@ } int -wnn_loadhinsi (fname) - unsigned char *fname; +wnn_loadhinsi (unsigned char *fname) { FILE *fp; UCHAR buf[SIZE]; @@ -420,8 +410,7 @@ } static int -find_hinsi_by_name (c) - register w_char *c; +find_hinsi_by_name (register w_char *c) { register int k; if (!hinsi_loaded) @@ -450,8 +439,7 @@ int -wnn_find_hinsi_by_name (c) - register char *c; +wnn_find_hinsi_by_name (register char *c) { w_char hin[WNN_HINSI_NAME_LEN]; @@ -461,8 +449,7 @@ static w_char * -get_hinsi_name (k) - int k; +get_hinsi_name (int k) { if (!hinsi_loaded) { @@ -483,8 +470,7 @@ } char * -wnn_get_hinsi_name (k) - int k; +wnn_get_hinsi_name (int k) { w_char *s; static char hin[WNN_HINSI_NAME_LEN * 2]; @@ -499,9 +485,7 @@ static #endif /* JSERVER */ int -wnn_get_fukugou_component_body (k, shp) - register int k; - register unsigned short **shp; +wnn_get_fukugou_component_body (register int k, register unsigned short **shp) { static unsigned short tmp; register unsigned short *s; @@ -526,9 +510,7 @@ } int -wnn_get_fukugou_component (k, shp) - register int k; - register unsigned short **shp; +wnn_get_fukugou_component (register int k, register unsigned short **shp) { if (!hinsi_loaded) { @@ -544,8 +526,7 @@ #ifdef JSERVER w_char * -wnn_hinsi_name (no) - int no; +wnn_hinsi_name (int no) { w_char *c; if ((c = get_hinsi_name (no)) == NULL) @@ -556,8 +537,7 @@ } int -wnn_hinsi_number (name) - w_char *name; +wnn_hinsi_number (w_char *name) { int n; if ((n = find_hinsi_by_name (name)) == -1) @@ -568,11 +548,7 @@ } int -wnn_hinsi_list (name, c, mynode, mmynode) - w_char *name; - w_char **c; - struct wnn_hinsi_node *mynode; - int mmynode; +wnn_hinsi_list (w_char *name, w_char **c, struct wnn_hinsi_node *mynode, int mmynode) { int k; @@ -600,10 +576,7 @@ } int -wnn_has_hinsi (mynode, mmynode, name) - struct wnn_hinsi_node *mynode; - int mmynode; - w_char *name; +wnn_has_hinsi (struct wnn_hinsi_node *mynode, int mmynode, w_char *name) { w_char *c; int k, j;
--- a/Wnn/etc/hindo.c Tue Apr 15 19:32:47 2008 +0900 +++ b/Wnn/etc/hindo.c Thu Apr 17 01:17:45 2008 +0900 @@ -58,8 +58,7 @@ /** 整数引数の平方根関数。但し引数<0の時のエラーチェックはなし(0を返す)。*/ static int -isqrt (i) - int i; +isqrt (int i) { register int a, b; @@ -73,8 +72,7 @@ /** 実頻度a→仮頻度b */ int -asshuku (hin) - int hin; +asshuku (int hin) { register int c; @@ -106,8 +104,7 @@ /** 仮頻度b→実頻度(mid)a */ int -motoni2 (hin) - int hin; +motoni2 (int hin) { register int c;
--- a/Wnn/etc/revdic.c Tue Apr 15 19:32:47 2008 +0900 +++ b/Wnn/etc/revdic.c Thu Apr 17 01:17:45 2008 +0900 @@ -70,10 +70,8 @@ void -rev_ud_hontai (hostart, maxhontai, match) - UCHAR *hostart; - int maxhontai; - int match; /* whether the cpu type match the dictionary */ +rev_ud_hontai (UCHAR *hostart, int maxhontai, int match) +/* whether the cpu type match the dictionary */ { UCHAR *hoend = hostart + maxhontai; struct uind2 *hop, *hop1; @@ -113,10 +111,7 @@ void -rev_ud_table (tary, maxtable, match) - struct uind1 *tary; - int maxtable; - int match; +rev_ud_table (struct uind1 *tary, int maxtable, int match) { int k; @@ -130,10 +125,7 @@ } void -rev_hinsi (hinsi, maxserial, match) - unsigned short *hinsi; - int maxserial; - int match; +rev_hinsi (unsigned short *hinsi, int maxserial, int match) { int k; @@ -154,10 +146,7 @@ void rev_sd_node (); void -rev_sd_hontai0 (hopter, hostart, match) - UCHAR *hostart; - UCHAR *hopter; - int match; +rev_sd_hontai0 (UCHAR *hostart, UCHAR *hopter, int match) { if (match) { @@ -172,17 +161,13 @@ } void -rev_sd_hontai (hostart, match) - UCHAR *hostart; - int match; +rev_sd_hontai (UCHAR *hostart, int match) { rev_sd_hontai0 (hostart, hostart, match); } void -travel_next_nodes (hopter, hostart, match) - UCHAR *hostart, *hopter; - int match; +travel_next_nodes (UCHAR *hostart, UCHAR *hopter, int match) { int k; int tsize; @@ -226,9 +211,7 @@ #define rev_if_int(x) (match? rev_int_org(x): rev_int(x)) void -rev_sd_node (hopter, hostart, match) - UCHAR *hostart, *hopter; - int match; +rev_sd_node (UCHAR *hostart, UCHAR *hopter, int match) { /* whether current state of dict matches the cpu type of the machine */ int k; @@ -280,7 +263,7 @@ int -little_endian () +little_endian (void) { int a = 1; #ifdef BYTE_SWAP @@ -291,10 +274,7 @@ } void -rev_rd_rind1 (ri1, maxri1, match) - struct rind1 *ri1; - int maxri1; - int match; +rev_rd_rind1 (struct rind1 *ri1, int maxri1, int match) { int k; @@ -306,10 +286,7 @@ } void -rev_rd_rind2 (ri2, maxri2, match) - struct rind2 *ri2; - int maxri2; - int match; +rev_rd_rind2 (struct rind2 *ri2, int maxri2, int match) { int k; @@ -324,10 +301,7 @@ void rev_w_char (); void -rev_kanji (kpter, maxk, match) - UCHAR *kpter; - int maxk; - int match; +rev_kanji (UCHAR *kpter, int maxk, int match) { UCHAR *kend = kpter + maxk; @@ -339,9 +313,7 @@ } void -rev_w_char (p, maxp) - w_char *p; - int maxp; +rev_w_char (w_char *p, int maxp) { for (; maxp > 0; maxp--) { @@ -357,9 +329,7 @@ */ int -revdic (jtl, match) - struct JT *jtl; - int match; +revdic (struct JT *jtl, int match) { extern int rev_ud (), rev_rd (), rev_sd (); int syurui = jtl->syurui; @@ -387,9 +357,7 @@ void rev_common (); int -rev_ud (jtl, match) - struct JT *jtl; - int match; +rev_ud (struct JT *jtl, int match) { rev_common (jtl, match); rev_ud_hontai (jtl->hontai, jtl->maxhontai, match); @@ -398,9 +366,7 @@ } int -rev_sd (jtl, match) - struct JT *jtl; - int match; +rev_sd (struct JT *jtl, int match) { rev_common (jtl, match); rev_sd_hontai (jtl->hontai, match); @@ -408,9 +374,7 @@ } int -rev_rd (jtl, match) - struct JT *jtl; - int match; +rev_rd (struct JT *jtl, int match) { rev_common (jtl, match); rev_rd_rind1 (jtl->ri1[D_YOMI], jtl->maxri1[D_YOMI], match); @@ -420,9 +384,7 @@ } void -rev_common (jtl, match) - struct JT *jtl; - int match; +rev_common (struct JT *jtl, int match) { if (jtl->hinsi) rev_hinsi (jtl->hinsi, jtl->maxserial, match); @@ -436,8 +398,7 @@ /* rev_short is called from atod.c.... kanapiiii */ void -rev_short_fun (sp) - w_char *sp; +rev_short_fun (w_char *sp) { rev_short (sp); }
--- a/Wnn/etc/yincoding.c Tue Apr 15 19:32:47 2008 +0900 +++ b/Wnn/etc/yincoding.c Thu Apr 17 01:17:45 2008 +0900 @@ -618,10 +618,10 @@ Lenth means the lenth in console but not num of character. */ int -cwnn_yincod_pzy (pzy_buf, c, which) - register w_char *pzy_buf; /* out: a Pinyin or Zhuyin */ - register w_char c; /* input: a yincod */ - int which; /* option Pinyin or Zhuyin */ +cwnn_yincod_pzy (register w_char *pzy_buf, register w_char c, int which) +// register w_char *pzy_buf; /* out: a Pinyin or Zhuyin */ +// register w_char c; /* input: a yincod */ +// int which; /* option Pinyin or Zhuyin */ { register int sheng_raw; register int yun_raw;
--- a/Wnn/jutil/atod.c Tue Apr 15 19:32:47 2008 +0900 +++ b/Wnn/jutil/atod.c Thu Apr 17 01:17:45 2008 +0900 @@ -70,26 +70,69 @@ #include "wnn_string.h" #include "wnn_os.h" -extern int wnn_loadhinsi (), init_heap (), little_endian (), Sorted (), asshuku (), revdic (); -extern void ujis_header (), read_ujis (), reverse_yomi (), create_rev_dict (), -uniq_je (), sort_if_not_sorted (), output_header (), udytoS (), output_ri (), exit1 (), new_pwd (), rev_short_fun (), rev_w_char (); -extern -#ifdef BDIC_WRITE_CHECK - int +/* for prototype */ +#include "atorev.h" +#include "ujisf.h" +#include "atod.h" + +/* prototypes */ +int wnn_loadhinsi (unsigned char *fname); +int init_heap (int hpb, int yhpb, int l, int rl, FILE *ipf); +int little_endian (void); +int revdic (struct JT *jtl, int match); + +int Sorted (register char *st, register int lc, int size, int (*sort_fun) ()); +int asshuku (); + +#ifdef CHINESE +void ujis_header (int *which_dict); #else - void +void ujis_header (void); #endif - put_n_EU_str (); -static void ujistoud (), output_dic_index (), usage (), sdic_sort (), -ujistosd (), not_enough_area (), get_pwd (), output_hindo (), output_hinsi (), output_kanji (), rev_dic_data (), set_pter1 (), output_comment (), output_hinsi_list (); -void upd_kanjicount (), output_dic_data (); + +void read_ujis (int rev, int to_esc, int which_dict); +void uniq_je (int (*func)()); +void reverse_yomi (void); +void sort_if_not_sorted (void); +void exit1 (void); + +void create_rev_dict (void); +void output_header (FILE* ofpter, struct JT* jtp, struct wnn_file_head* fhp); +void udytoS (); +void output_ri (FILE* ofpter); +void new_pwd (); +void rev_short_fun (); +void rev_w_char (); + +#ifdef BDIC_WRITE_CHECK + int put_n_EU_str (); +#else + void put_n_EU_str (); +#endif + +static void ujistoud (void); +static void output_dic_index (void); +static void usage (void); +static void sdic_sort (void); +static void ujistosd (int start_je, int level); +static void not_enough_area (void); +static void get_pwd (char* fname, char* crypted); +static void output_hindo (FILE* ofpter); +static void output_hinsi (FILE* ofpter); +static void output_kanji (FILE* ofpter); +static void rev_dic_data (void); +static void set_pter1 (void); +static void output_comment (FILE* fp); +static void output_hinsi_list (FILE* fp); +void upd_kanjicount (int k); +void output_dic_data (void); /* Switcher variable between UD and SD */ int which_dict = WNN_REV_DICT; #ifdef CHINESE extern int pzy_flag; -static void output_sisheng (); +static void output_sisheng (FILE* ofpter); #endif /* Variables both for UD and SD */ @@ -221,8 +264,7 @@ } } -extern int sort_func_je (); -int sort_func_sdic (const char* a, const char* b); +int sort_func_sdic (const void* a, const void* b); FILE *ofpter; int @@ -545,7 +587,7 @@ } int -sort_func_sdic (const char* a, const char* b) +sort_func_sdic (const void *a, const void *b) { int tmp; struct je *pa, *pb;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Wnn/jutil/atod.h Thu Apr 17 01:17:45 2008 +0900 @@ -0,0 +1,6 @@ +/* atod.c */ +void alloc_area(void); +void upd_kanjicount(int k); +void output_dic_data(void); +int sort_func_sdic(const void *a, const void *b); +int analize_size(int start_je, int level, int *statep, int *end_jep, int *mid_jep);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Wnn/jutil/atorev.h Thu Apr 17 01:17:45 2008 +0900 @@ -0,0 +1,3 @@ +/* atorev.c */ +void create_rev_dict(void); +void output_ri(FILE *ofpter);
--- a/Wnn/jutil/dtoa.c Tue Apr 15 19:32:47 2008 +0900 +++ b/Wnn/jutil/dtoa.c Thu Apr 17 01:17:45 2008 +0900 @@ -70,12 +70,42 @@ extern int pzy_flag; /* Pinyin or Zhuyin */ #endif -extern void parse_options (), usage (), input_dic (), udtoujis (), kset (), sdtoujis (), ghindo (), sort (), output_ujis (), exit1 (), init_jeary (), get_kanji_str (); -extern int input_header (), input_comment (), input_hinsi_list (), little_endian (), revdic (), wnn_loadhinsi (), init_heap (), w_stradd (), input_hindo_header (), motoni2 (); +/* prototypes */ +void parse_options(int *argc, char ***argv); +void usage(void); +void input_dic(FILE *ifpter); +void udtoujis(void); +void kset(void); +void sdtoujis(char *hopter, register int level); +void ghindo (int argc, char **argv); +int input_comment (register FILE *fp); +int input_hinsi_list (register FILE *fp); +static int rdtoujis (void); +static int set_hinsi (void); +static int input_hindo (register FILE *ifpter); +static int add_hindo (register FILE *ifpter, int num); + +/* extern */ +void sort (void); +void output_ujis (register FILE *opter, int serial_out, int esc_exp); +void exit1 (void); +void init_jeary (void); +void get_kanji_str (UCHAR* kptr, w_char* kanji, w_char* yomi, w_char* comment); + +int input_header (FILE* ifpter, struct JT* jtp, struct wnn_file_head* fhp); +int little_endian (void); +int revdic (struct JT *jtl, int match); +int wnn_loadhinsi (unsigned char *fname); +int w_stradd (register w_char *str, register w_char **cp); +int motoni2 (int hin); +int init_heap (int hpb, int yhpb, int l, int rl, FILE *ipf); +int input_hindo_header (FILE* ifpter, struct HJT* hjtp, struct wnn_file_head* fhp); + #ifdef CONVERT_with_SiSheng -extern int cwnn_yincod_pzy_str (), input_sisheng (); + int cwnn_yincod_pzy (register w_char *pzy_buf, register w_char c, int which); + int input_sisheng (register FILE *ifpter); #endif -static int rdtoujis (), set_hinsi (), input_hindo (), add_hindo (); + /* Moved from Wnn/etc/bdic.c */ int get_n_EU_str (FILE* ifpter, int n, w_char* st); int get_short (short* sp, FILE* ifpter); @@ -94,9 +124,7 @@ char *hinsi_file_name = NULL; int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { FILE *ifpter; char *cswidth_name; @@ -156,9 +184,7 @@ void -parse_options (argc, argv) - int *argc; - char ***argv; +parse_options (int *argc, char ***argv) { int c; extern int optind; @@ -218,7 +244,7 @@ void -usage () +usage (void) { fprintf (stderr, "Usage: %s [-nse -h hinsi_file_name] <dictionary file> <hindo file>*\n", com_name); fprintf (stderr, "Output the Text dictionary to stdout\n"); @@ -229,8 +255,7 @@ } void -input_dic (ifpter) - FILE *ifpter; +input_dic (FILE *ifpter) { init_heap (0, /* jt.maxkanji, */ @@ -266,7 +291,7 @@ } void -udtoujis () +udtoujis (void) { w_char yomi[LENGTHYOMI]; /* 2 byte yomi */ @@ -323,7 +348,7 @@ int je = 0; void -kset () +kset (void) { int i; UCHAR *c; @@ -343,9 +368,7 @@ } void -sdtoujis (hopter, level) - char *hopter; - register int level; +sdtoujis (char *hopter, register int level) { register int k, j; register int tsize; @@ -433,7 +456,7 @@ } static int -rdtoujis () +rdtoujis (void) { w_char yomi[LENGTHYOMI]; /* 2 byte yomi */ w_char kan[LENGTHYOMI]; /* 2 byte yomi */ @@ -466,9 +489,7 @@ } void -ghindo (argc, argv) - int argc; - char **argv; +ghindo (int argc, char **argv) { FILE *fp; struct wnn_file_head h_file_head; @@ -498,9 +519,7 @@ } static int -add_hindo (ifpter, num) - register FILE *ifpter; - int num; +add_hindo (register FILE *ifpter, int num) { register int i; register int k; @@ -516,23 +535,20 @@ /* input dict routines */ int -input_comment (fp) - register FILE *fp; +input_comment (register FILE *fp) { return (get_n_EU_str (fp, jt.maxcomment, file_comment)); } int -input_hinsi_list (fp) - register FILE *fp; +input_hinsi_list (register FILE *fp) { return (get_n_EU_str (fp, jt.maxhinsi_list, hinsi_list)); } static int -input_hindo (ifpter) - register FILE *ifpter; +input_hindo (register FILE *ifpter) { register int i; register int k; @@ -546,7 +562,7 @@ } static int -set_hinsi () +set_hinsi (void) { register int i; @@ -559,8 +575,7 @@ #ifdef CONVERT_with_SiSheng int -input_sisheng (ifpter) - register FILE *ifpter; +input_sisheng (register FILE *ifpter) { register int i; unsigned short s;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Wnn/jutil/dtoa.h Thu Apr 17 01:17:45 2008 +0900 @@ -0,0 +1,10 @@ +/* dtoa.c */ +void parse_options(int *argc, char ***argv); +void input_dic(FILE *ifpter); +void udtoujis(void); +void kset(void); +void sdtoujis(char *hopter, register int level); +void ghindo(int argc, char **argv); +int input_comment(register FILE *fp); +int input_hinsi_list(register FILE *fp); +int get_short(short *sp, FILE *ifpter);
--- a/Wnn/jutil/ujisf.c Tue Apr 15 19:32:47 2008 +0900 +++ b/Wnn/jutil/ujisf.c Thu Apr 17 01:17:45 2008 +0900 @@ -68,15 +68,22 @@ #define max(a, b) ((a < b)? b:a) #endif +/* prototypes */ extern unsigned char kanjiaddr (); extern void Print_entry (); extern int wnn_find_hinsi_by_name (); #ifdef CHINESE extern void cwnn_zy_str_analysis (), cwnn_py_str_analysis (); #endif -int sort_func (), Sorted (), w_stradd (); -static void Kanjistradd (), bunpou_num (), read_kanji_str (), toesc (); -void exit1 (); + + +#include "ujisf.h" + +static void Kanjistradd (w_char *k, w_char *y, w_char *c, register UCHAR **cp); +static void bunpou_num (register char *a, register int *p); +static void read_kanji_str (register char *c, register char *o); +static void toesc (char *ckanji, char *cyomi); +void exit1 (void); extern struct JT jt; @@ -113,8 +120,7 @@ static char stack[LINE_SIZE] = { 0 }; int -get_line (c) - register char *c; +get_line (register char *c) { if (stack[0]) { @@ -132,17 +138,14 @@ } void -unget_line (c) - char *c; +unget_line (char *c) { strcpy (stack, c); } char * -get_string (str, buf) - register char *str; - char *buf; +get_string (register char *str, char *buf) { register char *c = buf; for (; *c == '\t' || *c == ' '; c++); @@ -160,8 +163,7 @@ } void -bad_line (bf) - char *bf; +bad_line (char *bf) { static int badl = 0; @@ -175,19 +177,14 @@ } void -error_no_heap () +error_no_heap (void) { fprintf (stderr, "Heap area is exhausted.\n"); exit1 (); } static int -get_one_line (buffer, jep, rev, to_esc, which_dict) - char *buffer; - register struct je **jep; - int rev; - int to_esc; - int which_dict; +get_one_line (char *buffer, register struct je **jep, int rev, int to_esc, int which_dict) { register char *c = buffer; static char tmp[LINE_SIZE]; @@ -343,9 +340,7 @@ } static void -Kanjistradd (k, y, c, cp) - register UCHAR **cp; - w_char *k, *y, *c; +Kanjistradd (w_char *k, w_char *y, w_char *c, register UCHAR **cp) { int len; if (hp + LENGTHKANJI >= heapend) @@ -367,9 +362,7 @@ } int -w_stradd (str, cp) - register w_char **cp; - register w_char *str; +w_stradd (register w_char *str, register w_char **cp) { register int len = wnn_Strlen (str); @@ -388,12 +381,11 @@ return (0); } -void + #ifdef CHINESE -ujis_header (which_dict) - int *which_dict; +void ujis_header (int *which_dict) #else -ujis_header () +void ujis_header (void) #endif { char buffer[LINE_SIZE]; @@ -497,10 +489,7 @@ } void -read_ujis (rev, to_esc, which_dict) - int rev; - int to_esc; - int which_dict; +read_ujis (int rev, int to_esc, int which_dict) { char buffer[LINE_SIZE]; register int tmp; @@ -527,7 +516,7 @@ } void -reverse_yomi () +reverse_yomi (void) { register int i; w_char ytmp[LINE_SIZE]; @@ -548,11 +537,7 @@ extern char *wnn_get_hinsi_name (); void -print_je (jep, opter, serial_out, esc_exp) - register FILE *opter; - register struct je *jep; - int serial_out; - int esc_exp; +print_je (register struct je *jep, register FILE *opter, int serial_out, int esc_exp) { /* if (jep->yomi != 0) { */ if (jep->hinsi != SAKUJO_HINSI) @@ -562,9 +547,7 @@ } #ifdef nodef -kprint (fp, kpter) - register FILE *fp; - register w_char *kpter; +kprint (register FILE *fp, register w_char *kpter) { char out_str[LENGTHKANJI]; register int out_len; @@ -582,10 +565,7 @@ #endif void -output_ujis (opter, serial_out, esc_exp) - register FILE *opter; - int serial_out; - int esc_exp; +output_ujis (register FILE *opter, int serial_out, int esc_exp) { register struct je **jep; char buffer[WNN_COMMENT_LEN + WNN_HINSI_LEN]; @@ -625,9 +605,7 @@ } int -init_heap (hpb, yhpb, l, rl, ipf) - int hpb, yhpb, l, rl; - FILE *ipf; +init_heap (int hpb, int yhpb, int l, int rl, FILE *ipf) { jehp = je_heap = (struct je *) malloc ((rl * sizeof (struct je))); hp = heap = (UCHAR *) malloc (hpb); @@ -646,7 +624,7 @@ } void -init_jeary () +init_jeary (void) { int k; for (k = 0; k < jt.maxserial; k++) @@ -680,9 +658,7 @@ /* must be updated later */ static void -bunpou_num (a, p) - register char *a; - register int *p; +bunpou_num (register char *a, register int *p) { int tmp; if ((tmp = wnn_find_hinsi_by_name (a)) == -1) @@ -704,32 +680,26 @@ #ifdef CHINESE static void -sisheng_num (a, p) - register char *a; - register int *p; +sisheng_num (register char *a, register int *p) { sscanf (a, "%d", p); } #endif int -sort_func_je (a, b) - char *a, *b; +sort_func_je (const void *a, const void *b) { - return (sort_func (a, b, D_YOMI)); + return (sort_func ((char *)a, (char *)b, D_YOMI)); } int -sort_func_je_kanji (a, b) - char *a, *b; +sort_func_je_kanji (const void *a, const void *b) { - return (sort_func (a, b, D_KANJI)); + return (sort_func ((char *)a, (char *)b, D_KANJI)); } int -sort_func (a, b, which) - register char *a, *b; - int which; +sort_func (register char *a, register char *b, int which) { register int tmp; register struct je *pa, *pb; @@ -804,13 +774,13 @@ } void -sort () +sort (void) { qsort ((char *) jeary, jt.maxserial, sizeof (struct je *), sort_func_je); } void -sort_if_not_sorted () +sort_if_not_sorted (void) { if (!Sorted ((char *) jeary, jt.maxserial, sizeof (struct je *), sort_func_je)) { @@ -819,14 +789,13 @@ } void -sort_kanji () +sort_kanji (void) { qsort ((char *) jeary, jt.maxserial, sizeof (struct je *), sort_func_je_kanji); } void -uniq_je (func) - int (*func) (); +uniq_je (int (*func) ()) { int k; struct je **prev, **jep; @@ -881,8 +850,7 @@ } #ifdef nodef -make_kanji_str (o, c) - register UCHAR *o, *c; +make_kanji_str (register UCHAR *o, register UCHAR *c) { register UCHAR *o0 = o; @@ -909,8 +877,7 @@ #endif static void -read_kanji_str (c, o) - register char *c, *o; +read_kanji_str (register char *c, register char *o) { for (; *o; c++) { @@ -948,8 +915,7 @@ #ifdef CHINESE static void -read_kanji_str_w (c, o) - register w_char *c, *o; +read_kanji_str_w (register w_char *c, register w_char *) { for (; *o; c++) { @@ -987,11 +953,7 @@ #endif int -Sorted (st, lc, size, sort_fun) - register char *st; - register int lc; - int size; - int (*sort_fun) (); +Sorted (register char *st, register int lc, int size, int (*sort_fun) (const void *a, const void *b)) { char *dst = st + size; for (lc--; lc > 0; lc--, st = dst, dst += size) @@ -1005,8 +967,7 @@ } int -is_katakana (k, y) - register char *k, *y; +is_katakana (register char *k, register char *y) { for (; *k && *y;) { @@ -1028,8 +989,7 @@ } static void -toesc (ckanji, cyomi) - char *ckanji, *cyomi; +toesc (char *ckanji, char *cyomi) { if (strcmp (ckanji, cyomi) == 0) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Wnn/jutil/ujisf.h Thu Apr 17 01:17:45 2008 +0900 @@ -0,0 +1,30 @@ +/* ujisf.c */ +int get_line(register char *c); +void unget_line(char *c); +char *get_string(register char *str, char *buf); +void bad_line(char *bf); +void error_no_heap(void); + +#ifdef CHINESE +void ujis_header (int *which_dict); +#else +void ujis_header (void); +#endif + +void read_ujis(int rev, int to_esc, int which_dict); +void reverse_yomi(void); +void print_je(register struct je *jep, register FILE *opter, int serial_out, int esc_exp); +void output_ujis(register FILE *opter, int serial_out, int esc_exp); +int init_heap(int hpb, int yhpb, int l, int rl, FILE *ipf); +void init_jeary(void); +int sort_func_je(const void *a, const void *b); +int sort_func_je_kanji(const void *a, const void *b); +int sort_func(register char *a, register char *b, int which); +void sort(void); +void sort_if_not_sorted(void); +void sort_kanji(void); +void uniq_je(int (*func)(const void *a, const void *b)); +int Sorted(register char *st, register int lc, int size, int (*sort_fun)(const void *a, const void *b)); +int is_katakana(register char *k, register char *y); +int w_stradd (register w_char *str, register w_char **cp); +void exit1 (void);
--- a/Wnn/jutil/wddel.c Tue Apr 15 19:32:47 2008 +0900 +++ b/Wnn/jutil/wddel.c Thu Apr 17 01:17:45 2008 +0900 @@ -81,7 +81,7 @@ static struct wnn_ret_buf rb = { 0, NULL }; static void -usage () +usage (void) { fprintf (stderr, "wddel [-D server_name] [-n env_name][-d dic_no][-L][-E][-H][-C] [file_name] < text dict\n"); fprintf (stderr, "file_name or -d dic_no must be specified\n"); @@ -93,7 +93,7 @@ } static void -err () +err (void) { printf ((char *) wnn_perror ()); printf ("\n bye.\n"); @@ -101,9 +101,7 @@ } int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { extern char *getenv (); extern int optind; @@ -251,7 +249,7 @@ continue; } wnn_Sstrcpy (Com, com); - if (js_word_comment_set (env, dic_no, sno, Com) == -1) + if (js_word_comment_set (env, dic_no, sno, (w_char *)Com) == -1) // casting may be wrong --yaz { fprintf (stderr, "serial-no = %d\n", sno); err ();
--- a/Wnn/jutil/wdreg.c Tue Apr 15 19:32:47 2008 +0900 +++ b/Wnn/jutil/wdreg.c Thu Apr 17 01:17:45 2008 +0900 @@ -188,7 +188,7 @@ { if (access (fname, F_OK) == -1) { - if (js_dic_file_create_client (env, fname, WNN_REV_DICT, "", "", "") == -1) + if (js_dic_file_create_client (env, fname, WNN_REV_DICT, (w_char *)"", "", "") == -1) { err (); } @@ -203,7 +203,7 @@ WNN_FILE_STAT s; if (js_file_stat (env, fname, &s) == -1) { - if (js_dic_file_create (env, fname, WNN_REV_DICT, "", "", "") == -1) + if (js_dic_file_create (env, fname, WNN_REV_DICT, (w_char *)"", "", "") == -1) { err (); }