Fix all compilation errors

This commit is contained in:
Nishi 2026-06-19 02:39:41 +09:00
commit 4ebce359ea
13 changed files with 48 additions and 45 deletions

View file

@ -1,2 +1,5 @@
#!/bin/sh #!/bin/sh
while [ ! -d .git ]; do
cd ..
done
clang-format --verbose -i `find src lib include -name "*.c" -or -name "*.h"` clang-format --verbose -i `find src lib include -name "*.c" -or -name "*.h"`

View file

@ -140,8 +140,8 @@ typedef struct dict {
TypeDicSeg segunit; TypeDicSeg segunit;
TypeDicSeg maxunit; TypeDicSeg maxunit;
IFunc getofs; IFuncDict getofs;
IFunc getidx; IFuncDict getidx;
IFunc getdic; IFunc getdic;
IFunc putidx; IFunc putidx;
IFunc putdic; IFunc putdic;

View file

@ -46,9 +46,11 @@ typedef unsigned char u_char;
typedef unsigned short u_short; typedef unsigned short u_short;
typedef unsigned int u_int; typedef unsigned int u_int;
typedef void (*VFunc)(); typedef void (*VFunc)(void*, void*, void*);
typedef u_char* (*UCPFunc)(); typedef u_char* (*UCPFunc)(u_char*, u_char*, int);
typedef int (*IFunc)(); typedef int (*IFunc)(void*, int);
typedef int (*IFuncDict)(void*);
typedef u_char TypeGroup; typedef u_char TypeGroup;
typedef u_char TypeGram; typedef u_char TypeGram;

View file

@ -37,7 +37,7 @@
#include "sj_kanakan.h" #include "sj_kanakan.h"
static u_char *delcldata(), *srchclpos(); static u_char *delcldata(u_char*), *srchclpos(u_char*);
static int delclold(); static int delclold();
int clstudy(u_char* yomi1, u_char* yomi2, STDYOUT* stdy) { int clstudy(u_char* yomi1, u_char* yomi2, STDYOUT* stdy) {

View file

@ -39,33 +39,31 @@
#include "sj_kanakan.h" #include "sj_kanakan.h"
VFunc cvtnum_func[] = { VFunc cvtnum_func[] = {
num_type00, num_type01, num_type02, num_type03, (VFunc)num_type00, (VFunc)num_type01, (VFunc)num_type02, (VFunc)num_type03,
num_type04, num_type05, num_type06, num_type07, (VFunc)num_type04, (VFunc)num_type05, (VFunc)num_type06, (VFunc)num_type07,
num_type08, num_type09, num_type10, num_type11, (VFunc)num_type08, (VFunc)num_type09, (VFunc)num_type10, (VFunc)num_type11,
num_type12, num_type13, num_type14}; (VFunc)num_type12, (VFunc)num_type13, (VFunc)num_type14};
UCPFunc getkan_func[] = { UCPFunc getkan_func[] = {
getkan_norm, getkan_norm, getkan_hira, getkan_kata, (UCPFunc)getkan_norm, (UCPFunc)getkan_norm, (UCPFunc)getkan_hira, (UCPFunc)getkan_kata,
getkan_knj, getkan_ofs, getkan_norm, getkan_none, (UCPFunc)getkan_knj, (UCPFunc)getkan_ofs, (UCPFunc)getkan_norm, (UCPFunc)getkan_none,
getkan_norm, getkan_norm, getkan_hira, getkan_kata, (UCPFunc)getkan_norm, (UCPFunc)getkan_norm, (UCPFunc)getkan_hira, (UCPFunc)getkan_kata,
getkan_knj, getkan_ofs, getkan_norm, getkan_none}; (UCPFunc)getkan_knj, (UCPFunc)getkan_ofs, (UCPFunc)getkan_norm, (UCPFunc)getkan_none};
IFunc setjrec_func[] = { IFunc setjrec_func[] = {
setj_norm2, setj_norm2, setj_norm1, setj_norm1, (IFunc)setj_norm2, (IFunc)setj_norm2, (IFunc)setj_norm1, (IFunc)setj_norm1,
setj_knj, setj_ofs, setj_norm2, setj_atrb, (IFunc)setj_knj, (IFunc)setj_ofs, (IFunc)setj_norm2, (IFunc)setj_atrb,
setj_norm2, setj_norm2, setj_norm1, setj_norm1, (IFunc)setj_norm2, (IFunc)setj_norm2, (IFunc)setj_norm1, (IFunc)setj_norm1,
setj_knj, setj_ofs, setj_norm2, setj_atrb}; (IFunc)setj_knj, (IFunc)setj_ofs, (IFunc)setj_norm2, (IFunc)setj_atrb};
IFunc hiraknj_func[] = { IFunc hiraknj_func[] = {
hiraknj_hira, hiraknj_norm, hiraknj_hask, hiraknj_kask, (IFunc)hiraknj_hira, (IFunc)hiraknj_norm, (IFunc)hiraknj_hask, (IFunc)hiraknj_kask,
hiraknj_knj, hiraknj_ofs, hiraknj_norm, hiraknj_atrb, (IFunc)hiraknj_knj, (IFunc)hiraknj_ofs, (IFunc)hiraknj_norm, (IFunc)hiraknj_atrb,
hiraknj_hira, hiraknj_norm, hiraknj_hask, hiraknj_kask, (IFunc)hiraknj_hira, (IFunc)hiraknj_norm, (IFunc)hiraknj_hask, (IFunc)hiraknj_kask,
hiraknj_knj, hiraknj_ofs, hiraknj_norm, hiraknj_atrb}; (IFunc)hiraknj_knj, (IFunc)hiraknj_ofs, (IFunc)hiraknj_norm, (IFunc)hiraknj_atrb};
u_char *makekan_1byte(), *makekan_knj(), *makekan_ofs();
u_char *makekan_norm(), *makekan_none();
UCPFunc makekan_func[] = { UCPFunc makekan_func[] = {
makekan_norm, makekan_norm, makekan_1byte, makekan_1byte, (UCPFunc)makekan_norm, (UCPFunc)makekan_norm, (UCPFunc)makekan_1byte, (UCPFunc)makekan_1byte,
makekan_knj, makekan_ofs, makekan_norm, makekan_none, (UCPFunc)makekan_knj, (UCPFunc)makekan_ofs, (UCPFunc)makekan_norm, (UCPFunc)makekan_none,
makekan_norm, makekan_norm, makekan_1byte, makekan_1byte, (UCPFunc)makekan_norm, (UCPFunc)makekan_norm, (UCPFunc)makekan_1byte, (UCPFunc)makekan_1byte,
makekan_knj, makekan_ofs, makekan_norm, makekan_none}; (UCPFunc)makekan_knj, (UCPFunc)makekan_ofs, (UCPFunc)makekan_norm, (UCPFunc)makekan_none};

View file

@ -38,7 +38,7 @@
#include "sj_kanakan.h" #include "sj_kanakan.h"
static u_char* code2kanji(); static u_char* code2kanji(u_char* s, u_char* d, u_char* ym, int yl, int flg);
u_char* u_char*
getkan_none(u_char* s, u_char* d, u_char* ym, int yl, int flg) { getkan_none(u_char* s, u_char* d, u_char* ym, int yl, int flg) {

View file

@ -37,7 +37,7 @@
#include "sj_kanakan.h" #include "sj_kanakan.h"
static void setstynum(), setnspr(), regetrank(); static void setstynum(), setnspr(KHREC*, STDYIN*), regetrank();
void getrank() { void getrank() {

View file

@ -38,7 +38,7 @@
#include "sj_kanakan.h" #include "sj_kanakan.h"
static void dic_mu(), dic_cl(); static void dic_mu(int), dic_cl();
void mkjiritu(int mode) { void mkjiritu(int mode) {
u_char chkind1; u_char chkind1;

View file

@ -41,10 +41,10 @@
#include "sj_kanakan.h" #include "sj_kanakan.h"
static void getkhtbl(), cl_kanji(); static void getkhtbl(CLREC*), cl_kanji(JREC*, CLREC*);
static int diffknj(); static int diffknj(JREC*, u_char*, int);
static void cl_numcmn(); static void cl_numcmn(JREC*, CLREC*);
static u_char* makekan(); static u_char* makekan(u_char*, u_char*, int);
void mkkouho() { void mkkouho() {
CLREC* clrec; CLREC* clrec;

View file

@ -40,7 +40,7 @@
static int prev_kanji(), prev_hinsi(), prev_douon(); static int prev_kanji(), prev_hinsi(), prev_douon();
static int next_kanji(), next_hinsi(), next_douon(); static int next_kanji(), next_hinsi(), next_douon();
static void set_kanji(), set_buf(), add_yomi(); static void set_kanji(), set_buf(u_char*), add_yomi();
static void set_idxyomi(); static void set_idxyomi();
static void cd2sjh_chr(u_char ch, u_char* dst); static void cd2sjh_chr(u_char ch, u_char* dst);

View file

@ -294,10 +294,10 @@ opendict(char* name, char* passwd) {
dfp->dict.seglen = get4byte(dp + DICTSEGLEN); dfp->dict.seglen = get4byte(dp + DICTSEGLEN);
dfp->dict.segunit = get4byte(dp + DICTSEGNUM); dfp->dict.segunit = get4byte(dp + DICTSEGNUM);
dfp->dict.maxunit = i ? get4byte(dp + DICTSEGMAX) : 0; dfp->dict.maxunit = i ? get4byte(dp + DICTSEGMAX) : 0;
dfp->dict.getofs = getofs; dfp->dict.getofs = (IFuncDict)getofs;
dfp->dict.getidx = getidx; dfp->dict.getidx = (IFuncDict)getidx;
dfp->dict.getdic = (IFunc)getdic; dfp->dict.getdic = (IFunc)getdic;
dfp->dict.putidx = putidx; dfp->dict.putidx = (IFunc)putidx;
dfp->dict.putdic = (IFunc)putdic; dfp->dict.putdic = (IFunc)putdic;
dfp->dict.rszdic = (IFunc)rszdic; dfp->dict.rszdic = (IFunc)rszdic;
dfp->refcnt = 1; dfp->refcnt = 1;

View file

@ -39,7 +39,7 @@
#include "sj_kanakan.h" #include "sj_kanakan.h"
static int hiraknj(); static int hiraknj(u_char*);
void setkouho(CLREC* clrec, TypeDicOfs offs, int mode) { void setkouho(CLREC* clrec, TypeDicOfs offs, int mode) {
JREC* jrec; JREC* jrec;

View file

@ -41,7 +41,7 @@
#include "sj_kanakan.h" #include "sj_kanakan.h"
static void srch_kurai1(), srch_kurai2(); static void srch_kurai1(u_char*, u_char*), srch_kurai2(u_char*, u_char*);
static void static void
srch_josuu_sub(JREC* jrec, TypeGram gram) { srch_josuu_sub(JREC* jrec, TypeGram gram) {