--- np2/statsave.c 2004/07/01 11:42:54 1.42 +++ np2/statsave.c 2005/03/05 06:02:28 1.46 @@ -96,7 +96,7 @@ extern COMMNG cm_mpu98; extern COMMNG cm_rs232c; typedef struct { - char *buf; + OEMCHAR *buf; int remain; } ERR_BUF; @@ -104,7 +104,7 @@ typedef struct { // ---- // 関数ポインタを intに変更。 -static BOOL proc2num(void *func, const PROCTBL *tbl, int size) { +static BRESULT proc2num(void *func, const PROCTBL *tbl, int size) { int i; @@ -118,7 +118,7 @@ static BOOL proc2num(void *func, const P return(FAILURE); } -static BOOL num2proc(void *func, const PROCTBL *tbl, int size) { +static BRESULT num2proc(void *func, const PROCTBL *tbl, int size) { int i; @@ -149,7 +149,7 @@ typedef struct { NP2FHDR f; } _SFFILEH, *SFFILEH; -static SFFILEH statflag_open(const char *filename, char *err, int errlen) { +static SFFILEH statflag_open(const OEMCHAR *filename, OEMCHAR *err, int errlen) { FILEH fh; SFFILEH ret; @@ -186,7 +186,7 @@ sfo_err1: static int statflag_closesection(SFFILEH sffh) { UINT leng; - BYTE zero[16]; + UINT8 zero[16]; if (sffh == NULL) { goto sfcs_err1; @@ -261,7 +261,7 @@ sfr_err: return(STATFLAG_FAILURE); } -static SFFILEH statflag_create(const char *filename) { +static SFFILEH statflag_create(const OEMCHAR *filename) { SFFILEH ret; FILEH fh; @@ -355,7 +355,7 @@ static void statflag_close(SFFILEH sffh) } } -void statflag_seterr(STFLAGH sfh, const char *str) { +void statflag_seterr(STFLAGH sfh, const OEMCHAR *str) { if ((sfh) && (sfh->errlen)) { milstr_ncat(sfh->err, str, sfh->errlen); @@ -547,7 +547,7 @@ static int nevent_write(STFLAGH sfh, int UINT i; ZeroMemory(&nit, sizeof(nit)); - for (i=0; itype) { @@ -1256,7 +1256,7 @@ const SFENTRY *tblterm; return(ret); } -int statsave_check(const char *filename, char *buf, int size) { +int statsave_check(const OEMCHAR *filename, OEMCHAR *buf, int size) { SFFILEH sffh; int ret; @@ -1274,7 +1274,7 @@ const SFENTRY *tblterm; while((!done) && (ret != STATFLAG_FAILURE)) { ret |= statflag_readsection(sffh); tbl = np2tbl; - tblterm = tbl + (sizeof(np2tbl)/sizeof(SFENTRY)); + tblterm = tbl + NELEMENTS(np2tbl); while(tbl < tblterm) { if (!memcmp(sffh->sfh.hdr.index, tbl->index, 10)) { break; @@ -1328,7 +1328,7 @@ const SFENTRY *tblterm; return(ret); } -int statsave_load(const char *filename) { +int statsave_load(const OEMCHAR *filename) { SFFILEH sffh; int ret; @@ -1353,7 +1353,7 @@ const SFENTRY *tblterm; rs232c_midipanic(); mpu98ii_midipanic(); pc9861k_midipanic(); - sxsi_trash(); + sxsi_alltrash(); ret |= flagload_common(&sffh->sfh, np2tbl); @@ -1374,7 +1374,7 @@ const SFENTRY *tblterm; while((!done) && (ret != STATFLAG_FAILURE)) { ret |= statflag_readsection(sffh); tbl = np2tbl + 1; - tblterm = np2tbl + (sizeof(np2tbl)/sizeof(SFENTRY)); + tblterm = np2tbl + NELEMENTS(np2tbl); while(tbl < tblterm) { if (!memcmp(sffh->sfh.hdr.index, tbl->index, 10)) { break;