• R/O
  • SSH
  • HTTPS

pykf: Commit


Commit MetaInfo

Révision15 (tree)
l'heure2012-03-20 17:55:05
Auteurishimoto

Message de Log

Removed compiler warnings.

Change Summary

Modification

--- trunk/src/pykf.h (revision 14)
+++ trunk/src/pykf.h (revision 15)
@@ -1,7 +1,7 @@
11
22
33 /* kanji conversion tables */
4-extern unsigned int tbl_jis0213[];
4+extern int tbl_jis0213[];
55 extern int tbl_sjis2jis[];
66 extern int tbl_jis2sjis[];
77
@@ -9,17 +9,17 @@
99 /* Japanese character encodings */
1010 enum {ERROR=-1, UNKNOWN=0, ASCII=1, SJIS=2, EUC=3, JIS=4, UTF8=5, UTF16_LE=7, UTF16_BE=8};
1111
12-int guess(int imax, unsigned char buf[], int strict);
13-int sjistojis(int len, unsigned char *buf, unsigned char **ret, int *retlen, int jis0208);
14-int euctojis(int len, unsigned char *buf, unsigned char **ret, int *retlen, int jis0208);
15-int sjistoeuc(int len, unsigned char *buf, unsigned char **ret, int *retlen);
16-int jistoeuc(int len, unsigned char *buf, unsigned char **ret, int *retlen);
17-int jistosjis(int len, unsigned char *buf, unsigned char **ret, int *retlen);
18-int euctosjis(int len, unsigned char *buf, unsigned char **ret, int *retlen);
12+int guess(int imax, char buf[], int strict);
13+int sjistojis(int len, char *buf, char **ret, int *retlen, int jis0208);
14+int euctojis(int len, char *buf, char **ret, int *retlen, int jis0208);
15+int sjistoeuc(int len, char *buf, char **ret, int *retlen);
16+int jistoeuc(int len, char *buf, char **ret, int *retlen);
17+int jistosjis(int len, char *buf, char **ret, int *retlen);
18+int euctosjis(int len, char *buf, char **ret, int *retlen);
1919
20-int sjistohankana(int len, unsigned char *buf, unsigned char **ret, int *retlen);
21-int euctohankana(int len, unsigned char *buf, unsigned char **ret, int *retlen);
22-int sjistofullkana(int len, unsigned char *buf, unsigned char **ret, int *retlen);
23-int euctofullkana(int len, unsigned char *buf, unsigned char **ret, int *retlen);
20+int sjistohankana(int len, char *buf, char **ret, int *retlen);
21+int euctohankana(int len, char *buf, char **ret, int *retlen);
22+int sjistofullkana(int len, char *buf, char **ret, int *retlen);
23+int euctofullkana(int len, char *buf, char **ret, int *retlen);
2424
2525
--- trunk/src/converter.c (revision 14)
+++ trunk/src/converter.c (revision 15)
@@ -55,7 +55,7 @@
5555
5656
5757
58-int guess(int imax, unsigned char buf[], int strict)
58+int guess(int imax, char buf[], int strict)
5959 {
6060 int i, n;
6161 int ascii, euc, sjis, utf8, bad_euc, bad_sjis, bad_utf8;
@@ -339,10 +339,10 @@
339339 }
340340
341341 LOCAL_INLINE
342-void jis_to_sjis2(unsigned char *ph, unsigned char *pl);
342+void jis_to_sjis2(char *ph, char *pl);
343343
344344 LOCAL_INLINE
345-int isjis0213(unsigned char h, unsigned char l) {
345+int isjis0213(char h, char l) {
346346 int *p;
347347 int jis = (h << 8 | l) & 0xffff;
348348
@@ -358,7 +358,7 @@
358358
359359
360360 LOCAL_INLINE
361-int mskanji_to_jis(unsigned char *ph, unsigned char *pl) {
361+int mskanji_to_jis(char *ph, char *pl) {
362362 int *p;
363363 int sjis = (*ph << 8 | *pl) & 0xffff;
364364
@@ -379,7 +379,7 @@
379379 }
380380
381381 LOCAL_INLINE
382-void sjis_to_jis(unsigned char *ph, unsigned char *pl)
382+void sjis_to_jis(char *ph, char *pl)
383383 {
384384 if (*ph <= 0x9f) {
385385 if (*pl < 0x9f)
@@ -401,7 +401,7 @@
401401 }
402402
403403 LOCAL_INLINE
404-void sjis_to_jis2(unsigned char *ph, unsigned char *pl)
404+void sjis_to_jis2(char *ph, char *pl)
405405 {
406406 if (mskanji_to_jis(ph, pl))
407407 return;
@@ -411,7 +411,7 @@
411411
412412
413413 LOCAL_INLINE
414-void jis_to_sjis(unsigned char *ph, unsigned char *pl)
414+void jis_to_sjis(char *ph, char *pl)
415415 {
416416 if (*ph & 1) {
417417 if (*pl < 0x60)
@@ -429,7 +429,7 @@
429429
430430
431431 LOCAL_INLINE
432-int jis_to_mskanji(unsigned char *ph, unsigned char *pl) {
432+int jis_to_mskanji(char *ph, char *pl) {
433433 int *p;
434434 int jis = (*ph << 8 | *pl) & 0xffff;
435435
@@ -446,7 +446,7 @@
446446
447447
448448 LOCAL_INLINE
449-void jis_to_sjis2(unsigned char *ph, unsigned char *pl)
449+void jis_to_sjis2(char *ph, char *pl)
450450 {
451451 if (jis_to_mskanji(ph, pl))
452452 return;
@@ -458,9 +458,9 @@
458458
459459
460460
461-int sjistojis(int len, unsigned char *buf, unsigned char **ret, int *retlen, int j0208)
461+int sjistojis(int len, char *buf, char **ret, int *retlen, int j0208)
462462 {
463- unsigned char c, d;
463+ char c, d;
464464 int pos, tmplen, retpos=0;
465465 char tmp[10];
466466 char *newbuf;
@@ -570,9 +570,9 @@
570570 return 1;
571571 }
572572
573-int euctojis(int len, unsigned char *buf, unsigned char **ret, int *retlen, int j0208)
573+int euctojis(int len, char *buf, char **ret, int *retlen, int j0208)
574574 {
575- unsigned char c, d;
575+ char c, d;
576576 int pos, tmplen, retpos=0;
577577 char tmp[10];
578578 char *newbuf;
@@ -685,9 +685,9 @@
685685 }
686686
687687
688-int sjistoeuc(int len, unsigned char *buf, unsigned char **ret, int *retlen)
688+int sjistoeuc(int len, char *buf, char **ret, int *retlen)
689689 {
690- unsigned char c, d;
690+ char c, d;
691691 int pos, tmplen, retpos=0;
692692 char tmp[10];
693693 char *newbuf;
@@ -753,7 +753,7 @@
753753 return 1;
754754 }
755755
756-int jistoeuc(int len, unsigned char *buf, unsigned char **ret, int *retlen)
756+int jistoeuc(int len, char *buf, char **ret, int *retlen)
757757 {
758758 int pos, tmplen, retpos=0;
759759 char tmp[10];
@@ -846,9 +846,9 @@
846846 }
847847
848848
849-int jistosjis(int len, unsigned char *buf, unsigned char **ret, int *retlen)
849+int jistosjis(int len, char *buf, char **ret, int *retlen)
850850 {
851- unsigned char c, d;
851+ char c, d;
852852 int pos, tmplen, retpos=0;
853853 char tmp[10];
854854 char *newbuf;
@@ -942,9 +942,9 @@
942942 return 1;
943943 }
944944
945-int euctosjis(int len, unsigned char *buf, unsigned char **ret, int *retlen)
945+int euctosjis(int len, char *buf, char **ret, int *retlen)
946946 {
947- unsigned char c, d;
947+ char c, d;
948948 int pos, tmplen, retpos=0;
949949 char tmp[10];
950950 char *newbuf;
@@ -1009,7 +1009,7 @@
10091009 return 1;
10101010 }
10111011
1012-static const unsigned char *h_kana[] = {
1012+static const char *h_kana[] = {
10131013 "\xdd", "\xdc", "\xdb", "\xda", "\xd9", "\xd8", "\xd7", "\xd6", "\xd5", "\xd4",
10141014 "\xd3", "\xd2", "\xd1", "\xd0", "\xcf", "\xce\xdf", "\xce\xde", "\xce", "\xcd\xdf",
10151015 "\xcd\xde", "\xcd", "\xcc\xdf", "\xcc\xde", "\xcc", "\xcb\xdf", "\xcb\xde",
@@ -1021,7 +1021,7 @@
10211021 "\xb3", "\xb2", "\xb1", "\xb0", "\xaf", "\xae", "\xad", "\xac", "\xab",
10221022 "\xaa", "\xa9", "\xa8", "\xa7", "\xa6", "\xa5", "\xa4", "\xa3", "\xa2", "\xa1", NULL};
10231023
1024-static const unsigned char *euc_h_kana[] = {
1024+static const char *euc_h_kana[] = {
10251025 "\x8e\xdd", "\x8e\xdc", "\x8e\xdb", "\x8e\xda", "\x8e\xd9", "\x8e\xd8", "\x8e\xd7", "\x8e\xd6", "\x8e\xd5", "\x8e\xd4",
10261026 "\x8e\xd3", "\x8e\xd2", "\x8e\xd1", "\x8e\xd0", "\x8e\xcf", "\x8e\xce\x8e\xdf", "\x8e\xce\x8e\xde", "\x8e\xce", "\x8e\xcd\x8e\xdf",
10271027 "\x8e\xcd\x8e\xde", "\x8e\xcd", "\x8e\xcc\x8e\xdf", "\x8e\xcc\x8e\xde", "\x8e\xcc", "\x8e\xcb\x8e\xdf", "\x8e\xcb\x8e\xde",
@@ -1033,7 +1033,7 @@
10331033 "\x8e\xb3", "\x8e\xb2", "\x8e\xb1", "\x8e\xb0", "\x8e\xaf", "\x8e\xae", "\x8e\xad", "\x8e\xac", "\x8e\xab",
10341034 "\x8e\xaa", "\x8e\xa9", "\x8e\xa8", "\x8e\xa7", "\x8e\xa6", "\x8e\xa5", "\x8e\xa4", "\x8e\xa3", "\x8e\xa2", "\x8e\xa1", NULL};
10351035
1036-static const unsigned char *sjis_f_kana[] = {
1036+static const char *sjis_f_kana[] = {
10371037 "\x83\x93", "\x83\x8f", "\x83\x8d", "\x83\x8c", "\x83\x8b", "\x83\x8a",
10381038 "\x83\x89", "\x83\x88", "\x83\x86", "\x83\x84", "\x83\x82", "\x83\x81",
10391039 "\x83\x80", "\x83\x7e", "\x83\x7d", "\x83\x7c", "\x83\x7b", "\x83\x7a",
@@ -1051,7 +1051,7 @@
10511051 "\x81\x76", "\x81\x75", "\x81\x42", NULL};
10521052
10531053
1054-static const unsigned char *euc_f_kana[] = {
1054+static const char *euc_f_kana[] = {
10551055 "\xa5\xf3", "\xa5\xef", "\xa5\xed", "\xa5\xec", "\xa5\xeb", "\xa5\xea",
10561056 "\xa5\xe9", "\xa5\xe8", "\xa5\xe6", "\xa5\xe4", "\xa5\xe2", "\xa5\xe1",
10571057 "\xa5\xe0", "\xa5\xdf", "\xa5\xde", "\xa5\xdd", "\xa5\xdc", "\xa5\xdb",
@@ -1069,7 +1069,7 @@
10691069 "\xa1\xd7", "\xa1\xd6", "\xa1\xa3", NULL};
10701070
10711071
1072-int sjistohankana(int len, unsigned char *buf, unsigned char **ret, int *retlen) {
1072+int sjistohankana(int len, char *buf, char **ret, int *retlen) {
10731073 int pos, tmplen, retpos=0;
10741074 char tmp[10];
10751075 char *newbuf;
@@ -1142,7 +1142,7 @@
11421142 }
11431143
11441144
1145-int sjistofullkana(int len, unsigned char *buf, unsigned char **ret, int *retlen) {
1145+int sjistofullkana(int len, char *buf, char **ret, int *retlen) {
11461146 int pos, tmplen, retpos=0;
11471147 char tmp[10];
11481148 char *newbuf;
@@ -1223,7 +1223,7 @@
12231223 return 1;
12241224 }
12251225
1226-int euctohankana(int len, unsigned char *buf, unsigned char **ret, int *retlen) {
1226+int euctohankana(int len, char *buf, char **ret, int *retlen) {
12271227 int pos, tmplen, retpos=0;
12281228 char tmp[10];
12291229 char *newbuf;
@@ -1302,7 +1302,7 @@
13021302 }
13031303
13041304
1305-int euctofullkana(int len, unsigned char *buf, unsigned char **ret, int *retlen) {
1305+int euctofullkana(int len, char *buf, char **ret, int *retlen) {
13061306 int pos, tmplen, retpos=0;
13071307 char tmp[10];
13081308 char *newbuf;
--- trunk/src/pykf.c (revision 14)
+++ trunk/src/pykf.c (revision 15)
@@ -129,7 +129,7 @@
129129 static PyObject*
130130 pykf_tojis(PyObject* self, PyObject* args, PyObject* kwds)
131131 {
132- unsigned char *s, *conv;
132+ char *s, *conv;
133133 int enc=UNKNOWN, len, convlen;
134134 PyObject *ret;
135135 int strict = check_strict;
@@ -193,7 +193,7 @@
193193 static PyObject*
194194 pykf_toeuc(PyObject* self, PyObject* args, PyObject* kwds)
195195 {
196- unsigned char *s, *conv;
196+ char *s, *conv;
197197 int enc=UNKNOWN, len, convlen;
198198 PyObject *ret;
199199 int strict = check_strict;
@@ -256,7 +256,7 @@
256256 static PyObject*
257257 pykf_tosjis(PyObject* self, PyObject* args, PyObject *kwds)
258258 {
259- unsigned char *s, *conv;
259+ char *s, *conv;
260260 int enc=UNKNOWN, len, convlen;
261261 PyObject *ret;
262262 int strict = check_strict;
@@ -319,7 +319,7 @@
319319 static PyObject*
320320 pykf_tohalfkana(PyObject* self, PyObject* args, PyObject *kwds)
321321 {
322- unsigned char *s, *conv;
322+ char *s, *conv;
323323 int enc=UNKNOWN, len, convlen;
324324 PyObject *ret;
325325 int strict = check_strict;
@@ -379,7 +379,7 @@
379379 static PyObject*
380380 pykf_tofullkana(PyObject* self, PyObject* args, PyObject *kwds)
381381 {
382- unsigned char *s, *conv;
382+ char *s, *conv;
383383 int enc=UNKNOWN, len, convlen;
384384 int strict = check_strict;
385385 PyObject *ret;
@@ -440,7 +440,7 @@
440440 static PyObject*
441441 pykf_split(PyObject* self, PyObject* args, PyObject *kwds)
442442 {
443- unsigned char *s;
443+ char *s;
444444 int enc=UNKNOWN, len;
445445 int pos;
446446 PyObject *ret, *o;
Afficher sur ancien navigateur de dépôt.