changeset 3:ed4bb01eb317

- suppress warnings. - partially fixed comparison between pointer and 0.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Thu, 13 Dec 2007 19:53:14 +0900
parents b605a0e60f5b
children 422e51e3191e 338478efe78d
files Wnn/etc/bdic.c Wnn/etc/msg.c Wnn/etc/pwd.c Wnn/jserver/bnsetu_kai.c Wnn/jserver/de.c Wnn/jserver/do_henkan1.c Wnn/jserver/initjserv.c Wnn/jserver/jbiki.c Wnn/jserver/jikouho_d.c Wnn/jserver/jishosub.c Wnn/jserver/rd_jishoop.c Wnn/jserver/renbn_kai.c
diffstat 12 files changed, 43 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/Wnn/etc/bdic.c	Thu Dec 13 17:42:01 2007 +0900
+++ b/Wnn/etc/bdic.c	Thu Dec 13 19:53:14 2007 +0900
@@ -1204,7 +1204,7 @@
       || get_int (&jt1->maxhontai, ifpter) == -1
       || get_int (&jt1->gosuu, ifpter) == -1
       || get_nstring (ifpter, WNN_PASSWD_LEN, jt1->hpasswd) == -1
-      || get_int (&jt1->total, ifpter) == -1
+      || get_int ((int *)&jt1->total, ifpter) == -1
       || get_int (&jt1->maxri1[D_YOMI], ifpter) == -1
       || get_int (&jt1->maxri1[D_KANJI], ifpter) == -1
       || get_int (&jt1->maxri2, ifpter) == -1
--- a/Wnn/etc/msg.c	Thu Dec 13 17:42:01 2007 +0900
+++ b/Wnn/etc/msg.c	Thu Dec 13 19:53:14 2007 +0900
@@ -382,7 +382,7 @@
         }
     }
 
-  if (msg_bd = get_msg_bd (cd, id))
+  if ((msg_bd = get_msg_bd (cd, id)))
     return (msg_bd);
 error:
   if (msg != 0 && *msg != '\0')
--- a/Wnn/etc/pwd.c	Thu Dec 13 17:42:01 2007 +0900
+++ b/Wnn/etc/pwd.c	Thu Dec 13 19:53:14 2007 +0900
@@ -51,6 +51,8 @@
 #include "wnn_os.h"
 #endif /* !JS */
 
+#include <time.h>
+
 #ifdef JS
 # define JS_STATIC static
 #else  /* !JS */
--- a/Wnn/jserver/bnsetu_kai.c	Thu Dec 13 17:42:01 2007 +0900
+++ b/Wnn/jserver/bnsetu_kai.c	Thu Dec 13 19:53:14 2007 +0900
@@ -620,7 +620,7 @@
     }
 
 /* 接続可能か */
-  if (sbnptr->status_bkwd = kan_ck_vector (giji_hinsi, vector) == WNN_CONNECT_BK)
+  if ((sbnptr->status_bkwd = kan_ck_vector (giji_hinsi, vector)) == WNN_CONNECT_BK)
     goto _Can_connect;
 #ifdef  nodef
   /* 数字に接続できないが,アスキには接続できる */
--- a/Wnn/jserver/de.c	Thu Dec 13 17:42:01 2007 +0900
+++ b/Wnn/jserver/de.c	Thu Dec 13 19:53:14 2007 +0900
@@ -233,7 +233,7 @@
     {
       log_err ("cannot open message file libwnn.msg.");
     }
-  if (cswidth_name = get_cswidth_name (LANG_NAME))
+  if ((cswidth_name = get_cswidth_name (LANG_NAME)) != NULL)
     set_cswidth (create_cswidth (cswidth_name));
 
   port = -1;
@@ -883,7 +883,7 @@
 puts_cur (char *p)
 {
   int c;
-  while (c = *p++)
+  while ((c = *p++) != '\0')
     putc_cur (c);
   putc_cur (0);
 }
@@ -903,7 +903,7 @@
 putws_cur (w_char *p)
 {
   int c;
-  while (c = *p++)
+  while ((c = *p++) != '\0')
     put2_cur (c);
   put2_cur (0);
 }
--- a/Wnn/jserver/do_henkan1.c	Thu Dec 13 17:42:01 2007 +0900
+++ b/Wnn/jserver/do_henkan1.c	Thu Dec 13 19:53:14 2007 +0900
@@ -435,7 +435,7 @@
   register struct JT *jtl;
 
   jtl = (struct JT *) (files[dic_table[jentptr->jishono].body].area);
-  kptr = (long)jtl->kanji + jentptr->kanji1; // xxx which one is the offset?? --yaz
+  kptr = (UCHAR *)(jtl->kanji + jentptr->kanji1); // xxx which one is the offset?? --yaz
   if (jentptr->which == D_YOMI)
     {
       Get_knj1 (kptr, oy, oyl, jentptr->kanji2 + u, kouho, NULL, NULL);
@@ -474,6 +474,6 @@
   struct JT *jtl;
 
   jtl = (struct JT *) (files[dic_table[jentptr->jishono].body].area);
-  kptr = (long)jtl->kanji + jentptr->kanji1;
+  kptr = (UCHAR *)(jtl->kanji + jentptr->kanji1); // xxx may result in failure --yaz
   Get_knj2 (kptr, jentptr->kanji2 + u, kouho, NULL, com);
 }
--- a/Wnn/jserver/initjserv.c	Thu Dec 13 17:42:01 2007 +0900
+++ b/Wnn/jserver/initjserv.c	Thu Dec 13 19:53:14 2007 +0900
@@ -266,7 +266,7 @@
 		{
 		  break;
 		}
-              giji_eisuu[i] = expand_argument (word);
+          giji_eisuu[i] = expand_argument ((unsigned char *)word);
 	    }
 	  log_debug ("command %s has %d parameters.", code, i);
           for (; i < 20; i++)
@@ -363,7 +363,7 @@
     }
   else if (*st == '\\')
     {
-      return (get_bcksla (st + 1));
+        return (get_bcksla ((char *)(st + 1)));
     }
   else if (*st == '0')
     {
@@ -391,7 +391,7 @@
     }
   else
     {
-      return (atoi (st));
+        return (atoi ((char *)st));
     }
 }
 
--- a/Wnn/jserver/jbiki.c	Thu Dec 13 17:42:01 2007 +0900
+++ b/Wnn/jserver/jbiki.c	Thu Dec 13 19:53:14 2007 +0900
@@ -185,7 +185,7 @@
           maxlevel = max (maxlevel, len);
           if (j_e_p >= jmtw_end)
             return (-1);
-          j_e_p->kanji1 = (UCHAR *)p->kanjipter;
+          j_e_p->kanji1 = p->kanjipter; //xxx is this an offset? may result in failure --yaz
           j_e_p->kanji2 = 0;
           j_e_p->serial = p->serial;
           j_e_p->kosuu = p->kosuu;
@@ -273,7 +273,7 @@
   if (yomi[0] == 0)
     return (ui1p->yomi1 > 0);
   y1 = yomi[0] << 16 | yomi[1];
-  if (tmp = (ui1p->yomi1 - y1))
+  if ((tmp = (ui1p->yomi1 - y1)))
     {
       return ((ui1p->yomi1 > y1) ? 1 : -1);
     }
@@ -282,7 +282,7 @@
   if (yomi[2] == 0)
     return (ui1p->yomi2 > 0);
   y2 = yomi[2] << 16 | yomi[3];
-  if (tmp = (ui1p->yomi2 - y2))
+  if ((tmp = (ui1p->yomi2 - y2)))
     {
       return ((ui1p->yomi2 > y2) ? 1 : -1);
     }
@@ -445,7 +445,7 @@
           maxlevel = max (maxlevel, level + 1);
           if (j_e_p >= jmtw_end)
             return (-1);
-          j_e_p->kanji1 = (UCHAR *) (hopter + 8);
+          j_e_p->kanji1 = *(int *) (hopter + 8); //xxx what's? --yaz
           j_e_p->kanji2 = sumst[index - 1];
           j_e_p->serial = serial = *(int *) (hopter + 4) + sumst[index - 1];
           j_e_p->kosuu = cnt;
@@ -587,7 +587,7 @@
   for (ind = rd_binary (tary, yomi, jtl->maxri1[which], ri2, kanji, which); ind >= 0; ind = tary[ind].pter1)
     {
       p = tary[ind].pter + ri2;
-      len = Get_kanji_len (p->kanjipter + kanji, which);
+      len = Get_kanji_len (p->kanjipter + kanji, which); // xxx regard p->kanjipter as an offset for now --yaz
       if (jmt + len > jmt_end)
         return (-1);
       /* set jmt */
@@ -607,7 +607,7 @@
               *jepp = j_e_p;
               if (j_e_p >= jmtw_end)
                 return (-1);
-              j_e_p->kanji1 = (UCHAR *)p->kanjipter; //xxx this may result in failure --yaz
+              j_e_p->kanji1 = p->kanjipter; //xxx this may result in failure --yaz
               j_e_p->kanji2 = 0;
               j_e_p->serial = serial;
               j_e_p->kosuu = 1;
--- a/Wnn/jserver/jikouho_d.c	Thu Dec 13 17:42:01 2007 +0900
+++ b/Wnn/jserver/jikouho_d.c	Thu Dec 13 19:53:14 2007 +0900
@@ -600,7 +600,7 @@
           wnn_errorno = WNN_JKTAREA_FULL;
           error1 ("malloc err in dbn_set (at daibnsetsu jikouho).\n");
           md_cnt = 0;
-          return ((struct DSD_DBN *) -1);
+          return NULL;
         }
       else
         md_cnt = cnt;
@@ -625,7 +625,7 @@
           wnn_errorno = WNN_JKTAREA_FULL;
           error1 ("malloc err in dbn_set (at daibnsetsu jikouho).\n");
           ms_cnt = 0;
-          return ((struct DSD_SBN *) -1);
+          return NULL;
         }
       else
         ms_cnt = cnt;
@@ -656,9 +656,9 @@
 
   cnt_dbn (dbn, &cnt, &sbn_cnt);
 
-  if ((d_dbn = *dsd_dbn = get_dsd_dbn (cnt)) <= (struct DSD_DBN *) 0)
+  if ( (d_dbn = *dsd_dbn = get_dsd_dbn (cnt)) == NULL)
     return (-1);
-  if ((sv_sbn = d_sbn = get_dsd_sbn (sbn_cnt)) <= (struct DSD_SBN *) 0)
+  if ( (sv_sbn = d_sbn = get_dsd_sbn (sbn_cnt)) == NULL)
     return (-1);
 
   while (dbn)
--- a/Wnn/jserver/jishosub.c	Thu Dec 13 17:42:01 2007 +0900
+++ b/Wnn/jserver/jishosub.c	Thu Dec 13 19:53:14 2007 +0900
@@ -187,7 +187,7 @@
               yomi[len] = charst[key];
               yomi[len + 1] = 0;
 
-              jd->kanji1 = kanji1;
+              jd->kanji1 = (int)kanji1; // xxx this may result in failure --yaz
               jd->kanji2 = serial - serialst;
               jd->serial = serial;
               jd->kosuu = 1;
@@ -353,7 +353,7 @@
   Strncpy (yomi + 4, (p->yomi) + 1, len - 4);
   yomi[len] = 0;
 
-  jd->kanji1 = (UCHAR *)p->kanjipter;
+  jd->kanji1 = p->kanjipter; // xxx this may result in failure --yaz
   jd->kanji2 = serial - p->serial;
   jd->serial = serial;
   jd->kosuu = 1;
--- a/Wnn/jserver/rd_jishoop.c	Thu Dec 13 17:42:01 2007 +0900
+++ b/Wnn/jserver/rd_jishoop.c	Thu Dec 13 19:53:14 2007 +0900
@@ -289,7 +289,7 @@
   p = jtl->ri2 + serial;
   get_kanji_str (jtl->kanji + p->kanjipter, NULL, yomi, NULL);
 
-  jd->kanji1 = (UCHAR *)p->kanjipter;
+  jd->kanji1 = p->kanjipter; // xxx this may result in failure --yaz
   jd->kanji2 = 0;
   jd->serial = serial;
   jd->kosuu = 1;
--- a/Wnn/jserver/renbn_kai.c	Thu Dec 13 17:42:01 2007 +0900
+++ b/Wnn/jserver/renbn_kai.c	Thu Dec 13 19:53:14 2007 +0900
@@ -67,8 +67,8 @@
     buncnt = 0;                 /* 決定した大文節数 */
   struct BZD *rbzdptr;          /* 決定の対象となるノード top pointer */
   struct BZD *brbzdptr,        /* work pointer */
-   *dicide_bp = 0,              /* 決定した大文節の top pointer */
-   *dicide_np,                  /* 決定した大文節への pointer */
+   *dicide_bp = NULL,              /* 決定した大文節の top pointer */
+   *dicide_np = NULL,                  /* 決定した大文節への pointer */
    *wkbzdptr,                   /* work pointer         */
    *maxbzd;                     /* 決定の対象となっている大文節の */
   /* 最大の評価値を持つノードへの pointer */
@@ -76,7 +76,7 @@
   extern int _status;
 
   dicidyno = yomi_sno - 1;
-  rbzdptr = 0;
+  rbzdptr = NULL;
   rtmknode = 1;
 
   _status = 0;
@@ -91,7 +91,7 @@
     return (-1);
   while (dicidyno + 1 < yomi_eno)
     {
-      if (rbzdptr == 0)
+      if (rbzdptr == NULL)
         {
           if (dbn_kai (dicidyno + 1, yomi_eno, beginvect,
 #ifndef NO_FZK
@@ -103,16 +103,16 @@
               init_work_areas ();
               return (-1);      /* ERROR */
             }
-          if (rbzdptr == 0)
+          if (rbzdptr == NULL)
             {
               if (set_kata_giji_bzd (dicidyno + 1, yomi_eno, endvect, endvect1, &rbzdptr, buncnt) < 0)
                 return (-1);
               buncnt++;
               rtmknode = 0;
-              if (dicide_bp == 0)
+              if (dicide_bp == NULL)
                 dicide_bp = rbzdptr;
-              else
-                dicide_np->lnk_son = rbzdptr;
+              else if (dicide_np != NULL)
+                  dicide_np->lnk_son = rbzdptr;
               break;
             }
         }
@@ -180,12 +180,12 @@
     }
 
   cnt_bzd (dicide_bp, &dbn_cnt, &sbn_cnt);
-  if ((*dsd_dbn = get_dsd_dbn (dbn_cnt)) <= (struct DSD_DBN *) 0)
+  if ((*dsd_dbn = get_dsd_dbn (dbn_cnt)) == NULL)
     {
       init_work_areas ();
       return (-1);
     }
-  if ((dsd_sbn = get_dsd_sbn (sbn_cnt)) <= (struct DSD_SBN *) 0)
+  if ((dsd_sbn = get_dsd_sbn (sbn_cnt)) == NULL)
     {
       init_work_areas ();
       return (-1);
@@ -247,7 +247,7 @@
       wkbzdptr = brbzdptr->lnk_br;
       if (brbzdptr->j_c == yomi_eno - 1)
         {                       /* 文節長さ */
-          if (maxbzd == 0)
+          if (maxbzd == NULL)
             {
               maxbzd = brbzdptr;
             }
@@ -267,18 +267,18 @@
         }
     }
 
-  if (maxbzd == 0)
+  if (maxbzd == NULL)
     {
       if (set_kata_giji_bzd (yomi_sno, yomi_eno, endvect, endvect1, &maxbzd, 0) < 0)
         return (-1);
     }
   cnt_bzd (maxbzd, &dbn_cnt, &sbn_cnt);
-  if ((*dsd_dbn = get_dsd_dbn (dbn_cnt)) <= (struct DSD_DBN *) 0)
+  if ((*dsd_dbn = get_dsd_dbn (dbn_cnt)) == NULL)
     {
       init_work_areas ();
       return (-1);
     }
-  if ((dsd_sbn = get_dsd_sbn (sbn_cnt)) <= (struct DSD_SBN *) 0)
+  if ((dsd_sbn = get_dsd_sbn (sbn_cnt)) == NULL)
     {
       init_work_areas ();
       return (-1);
@@ -333,7 +333,7 @@
       wksbnptr = brsbnptr->lnk_br;
       if (brsbnptr->j_c == yomi_eno - 1)
         {                       /* 文節長さ */
-          if (maxsbn == 0)
+          if (maxsbn == NULL)
             {
               maxsbn = brsbnptr;
               divid = get_status (brsbnptr->kangovect, beginvect,
@@ -373,7 +373,7 @@
         }
     }
 
-  if (maxsbn == 0)
+  if (maxsbn == NULL)
     {
       if (set_kata_giji_sbn (yomi_sno, yomi_eno, endvect, endvect1, &maxsbn) < 0)
         return (-1);
@@ -381,7 +381,7 @@
   if (maxsbn->jentptr == 0 && maxsbn->status == WNN_NOT_CONNECT)
     maxsbn->status = WNN_GIJI;
   sbn_cnt = cnt_syo (maxsbn);
-  if ((*dsd_sbn = get_dsd_sbn (sbn_cnt)) <= (struct DSD_SBN *) 0)
+  if ((*dsd_sbn = get_dsd_sbn (sbn_cnt)) == NULL)
     {
       init_work_areas ();
       return (-1);