Remove unused sys_getConvString()

This commit is contained in:
kichikuou
2020-07-24 13:21:48 +09:00
parent fb10cbc52d
commit 350d8bb367
4 changed files with 20 additions and 49 deletions
+20 -25
View File
@@ -610,6 +610,25 @@ static BYTE hankakutable[3][192][2] = {{
{0x83, 0xff}
}};
static const BYTE kanatbl[][2] = {
0x81, 0x40, 0x81, 0x42, 0x81, 0x75, 0x81, 0x76,
0x81, 0x41, 0x81, 0x45, 0x82, 0xf0, 0x82, 0x9f,
0x82, 0xa1, 0x82, 0xa3, 0x82, 0xa5, 0x82, 0xa7,
0x82, 0xe1, 0x82, 0xe3, 0x82, 0xe5, 0x82, 0xc1,
0x81, 0x5b, 0x82, 0xa0, 0x82, 0xa2, 0x82, 0xa4,
0x82, 0xa6, 0x82, 0xa8, 0x82, 0xa9, 0x82, 0xab,
0x82, 0xad, 0x82, 0xaf, 0x82, 0xb1, 0x82, 0xb3,
0x82, 0xb5, 0x82, 0xb7, 0x82, 0xb9, 0x82, 0xbb,
0x82, 0xbd, 0x82, 0xbf, 0x82, 0xc2, 0x82, 0xc4,
0x82, 0xc6, 0x82, 0xc8, 0x82, 0xc9, 0x82, 0xca,
0x82, 0xcb, 0x82, 0xcc, 0x82, 0xcd, 0x82, 0xd0,
0x82, 0xd3, 0x82, 0xd6, 0x82, 0xd9, 0x82, 0xdc,
0x82, 0xdd, 0x82, 0xde, 0x82, 0xdf, 0x82, 0xe0,
0x82, 0xe2, 0x82, 0xe4, 0x82, 0xe6, 0x82, 0xe7,
0x82, 0xe8, 0x82, 0xe9, 0x82, 0xea, 0x82, 0xeb,
0x82, 0xed, 0x82, 0xf1, 0x81, 0x4a, 0x81, 0x4b
};
BYTE *zen2han(const BYTE *src) {
BYTE c0, c1;
char *dst, *_dst;
@@ -645,7 +664,6 @@ BYTE *zen2han(const BYTE *src) {
BYTE *han2zen(const BYTE *src) {
BYTE c0;
BYTE *dst, *_dst;
BYTE *kindex;
dst = _dst = malloc(strlen(src) * 2 + 1);
if (dst == NULL) {
@@ -661,7 +679,7 @@ BYTE *han2zen(const BYTE *src) {
} else if (c0 >= 0xe0) {
*dst++ = (char)c0; *dst++ = *src++;
} else if (c0 >= 0xa0) {
kindex = hankana2sjis(c0);
const BYTE *kindex = kanatbl[c0 - 0xa0];
*dst++ = *kindex; *dst++ = *(kindex+1);
} else {
*dst++ = (char)c0; *dst++ = *src++;
@@ -671,29 +689,6 @@ BYTE *han2zen(const BYTE *src) {
return _dst;
}
// index = 0xa0~
char *hankana2sjis(int index) {
static char kanatbl[][2] = {
0x81, 0x40, 0x81, 0x42, 0x81, 0x75, 0x81, 0x76,
0x81, 0x41, 0x81, 0x45, 0x82, 0xf0, 0x82, 0x9f,
0x82, 0xa1, 0x82, 0xa3, 0x82, 0xa5, 0x82, 0xa7,
0x82, 0xe1, 0x82, 0xe3, 0x82, 0xe5, 0x82, 0xc1,
0x81, 0x5b, 0x82, 0xa0, 0x82, 0xa2, 0x82, 0xa4,
0x82, 0xa6, 0x82, 0xa8, 0x82, 0xa9, 0x82, 0xab,
0x82, 0xad, 0x82, 0xaf, 0x82, 0xb1, 0x82, 0xb3,
0x82, 0xb5, 0x82, 0xb7, 0x82, 0xb9, 0x82, 0xbb,
0x82, 0xbd, 0x82, 0xbf, 0x82, 0xc2, 0x82, 0xc4,
0x82, 0xc6, 0x82, 0xc8, 0x82, 0xc9, 0x82, 0xca,
0x82, 0xcb, 0x82, 0xcc, 0x82, 0xcd, 0x82, 0xd0,
0x82, 0xd3, 0x82, 0xd6, 0x82, 0xd9, 0x82, 0xdc,
0x82, 0xdd, 0x82, 0xde, 0x82, 0xdf, 0x82, 0xe0,
0x82, 0xe2, 0x82, 0xe4, 0x82, 0xe6, 0x82, 0xe7,
0x82, 0xe8, 0x82, 0xe9, 0x82, 0xea, 0x82, 0xeb,
0x82, 0xed, 0x82, 0xf1, 0x81, 0x4a, 0x81, 0x4b
};
return kanatbl[index - 0xa0];
}
char *num2sjis(int num) {
static char suji[][3] = {
0x82,0x4f,0x00, /* 0 */
-1
View File
@@ -27,7 +27,6 @@
extern BYTE *zen2han(const BYTE *src);
extern BYTE *han2zen(const BYTE *src);
extern char *hankana2sjis(int index);
extern char *num2sjis(int num);
#endif /* __HANKAKU_H__ */
-22
View File
@@ -97,28 +97,6 @@ char *sys_getConstString() {
return msgbuf;
}
/* 加工済み(半カナ->全カナ) 文字列抽出 */
char* sys_getConvString(char term) {
int c0;
char *index = msgbuf;
char *kindex;
while ((c0 = sl_getc()) != (int)term) {
if (c0 == 0x20) {
*index++ = 0x81; *index++ = 0x40;
} else if (c0 >= 0xe0) {
*index++ = (char)c0; *index++ = (char)sl_getc();
} else if (c0 >= 0xa0) {
kindex = hankana2sjis(c0);
*index++ = *kindex; *index++ = *(kindex+1);
} else {
*index++ = (char)c0; *index++ = (char)sl_getc();
}
}
*index = 0;
return msgbuf;
}
/* 選択肢・通常メッセージ振り分け */
void sys_addMsg(const char *str) {
const char *msg = NULL;
-1
View File
@@ -45,7 +45,6 @@ extern int getCaliValue();
extern int *getCaliVariable();
extern int *getVariable();
extern char *sys_getString(char term);
extern char *sys_getConvString(char term);
extern void sys_addMsg(const char *str);
extern void sys_setHankakuMode(int mode);
extern char *sys_getConstString();