OSDN Git Service

adjust signness
authorSHIRAKATA Kentaro <argrath@ub32.org>
Sun, 14 Oct 2018 11:38:54 +0000 (20:38 +0900)
committerSHIRAKATA Kentaro <argrath@ub32.org>
Sat, 15 Dec 2018 19:48:52 +0000 (04:48 +0900)
japanese/jconj.c
japanese/jlib.c
win/tty/getline.c

index ff70ae3..088d481 100644 (file)
@@ -349,7 +349,7 @@ jcan(jverb)
      const char *jverb;
 {
     const char *ret;
-    static unsigned char tmp[1024];
+    static char tmp[1024];
 
     int len = strlen(jverb);
     if(!strcmp(jverb + len - 4, "\82·\82é")){
@@ -367,7 +367,7 @@ const char *
 jcannot(jverb)
      const char *jverb;
 {
-    static unsigned char tmp[1024];
+    static char tmp[1024];
 
     int len = strlen(jverb);
     if(!strcmp(jverb + len - 4, "\82·\82é")){
index e5b64ee..70d7a40 100644 (file)
@@ -200,7 +200,7 @@ str2ic(s)
 #ifdef POSIX_ICONV
     if (input_dsc) {
         size_t src_len, dst_len;
-        up = s;
+        up = (unsigned char *)s;
         src_len = strlen(s);
         dst_len = sizeof(buf);
         if (iconv(input_dsc, (char**)&up, &src_len,
@@ -210,7 +210,7 @@ str2ic(s)
 #else
     if( IC==EUC && input_kcode == SJIS ){
         while(*s){
-            up = s;
+            up = (unsigned char *)s;
             if(is_kanji(*up)){
                 pp = sj2e((unsigned char *)s);
                 *(p++) = pp[0];
@@ -257,7 +257,7 @@ ic2str(s)
 #ifdef POSIX_ICONV
     if(output_dsc){
         size_t src_len, dst_len;
-        up = s;
+        up = (unsigned char *)s;
         src_len = strlen(s);
         dst_len = sizeof(buf);
         if(iconv(output_dsc, (char**)&up, &src_len,
@@ -267,7 +267,7 @@ ic2str(s)
 #else
     if( IC==EUC && output_kcode == SJIS ){
         while(*s){
-            up = s;
+            up = (unsigned char *)s;
             if( *up & 0x80 ){
                 pp = e2sj((unsigned char *)s);
                 *(p++) = pp[0];
@@ -587,7 +587,7 @@ offset_in_kanji(s, pos)
             return c;
         }
     } else {
-        return is_kanji2(s, pos);
+        return is_kanji2((char *)s, pos);
     }
 }
 
@@ -730,7 +730,7 @@ jrndm_replace(c)
     unsigned char cc[3];
 
     if(IC==SJIS)
-      memcpy(cc, (char *)sj2e(c), 2);
+      memcpy(cc, (char *)sj2e((unsigned char *)c), 2);
     else
       memcpy(cc, c, 2);
 
@@ -1411,10 +1411,13 @@ jrubout(engr, nxt, use_rubout, select_rnd)
     if(!is_kanji1(engr, nxt)) return 0;
 
     j = kanji2index(engr[nxt], engr[nxt + 1]);
-    if (j >= 0x0000 && j <= 0x02B1) p = &ro0[j << 2];
-    else if (j >= 0x0582 && j <= 0x1116) p = &ro1[(j - 0x0582) << 2];
-    else if (j >= 0x1142 && j <= 0x1E7F) p = &ro2[(j - 0x1142) << 2];
-    else p = "\81H";
+    if (j >= 0x0000 && j <= 0x02B1)
+        p = (unsigned char *)&ro0[j << 2];
+    else if (j >= 0x0582 && j <= 0x1116)
+        p = (unsigned char *)&ro1[(j - 0x0582) << 2];
+    else if (j >= 0x1142 && j <= 0x1E7F)
+        p = (unsigned char *)&ro2[(j - 0x1142) << 2];
+    else p = (unsigned char *)"\81H";
     
     if (p[2] != ' ' || p[3] != ' ') p += select_rnd * 2;
     engr[nxt] = *p++;
index 47eda93..59fdd01 100644 (file)
@@ -173,7 +173,7 @@ getlin_hook_proc hook;
 #if 1 /*JP*/
             {
                 int n;
-                n = offset_in_kanji(tmp, bufp - tmp);
+                n = offset_in_kanji((unsigned char *)tmp, bufp - tmp);
                 if (n > 0) {
                     /* \8cã\82Å1\83o\83C\83g\88ø\82©\82ê\82é\82Ì\82Å\82»\82Ì\95ª\82Í\82±\82±\82Å\82Í\88ø\82©\82È\82¢ */
                     bufp = bufp - (n - 1);
@@ -189,7 +189,7 @@ getlin_hook_proc hook;
 #if 0 /*JP*/
         } else if (' ' <= (unsigned char) c && c != '\177'
 #else
-        } else if (' ' <= uc && uc < '\377'
+        } else if (' ' <= uc && uc < 255
 #endif
                    /* avoid isprint() - some people don't have it
                       ' ' is not always a printing char */