diff Wnn/jserver/daibn_kai.c @ 25:466fe6732d8d

- fixed more NULL pointer related errata - suppress warnings
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 06 Mar 2010 04:37:31 +0900
parents 338478efe78d
children
line wrap: on
line diff
--- a/Wnn/jserver/daibn_kai.c	Fri Mar 05 20:46:36 2010 +0900
+++ b/Wnn/jserver/daibn_kai.c	Sat Mar 06 04:37:31 2010 +0900
@@ -74,7 +74,7 @@
   int tmp;
   struct SYO_BNSETSU *db_set;
   register struct SYO_BNSETSU **sb_que_head;
-  struct BZD *bzd = 0;
+  struct BZD *bzd = NULL;
   int dbncnt = 0;
   int setflg;
   register struct SYO_BNSETSU *sb_one;
@@ -89,9 +89,9 @@
 
   sb_que_head = &db_set;
   *sb_que_head = NULL;
-  if ((tmp = sbn_kai (yomi_sno, yomi_eno, endvect, endvect1, sb_que_head, 1, (struct SYO_BNSETSU *) 0)) <= 0)
+  if ((tmp = sbn_kai (yomi_sno, yomi_eno, endvect, endvect1, sb_que_head, 1, NULL)) <= 0)
     return (tmp);
-  for (sb_one = *sb_que_head; sb_one != 0; sb_one = sb_one->lnk_br)
+  for (sb_one = *sb_que_head; sb_one != NULL; sb_one = sb_one->lnk_br)
     sb_one->son_v = sum_hyouka (sb_one);
 
   while (*sb_que_head != NULL)
@@ -157,9 +157,9 @@
               if (tmp > 0)
                 {
                   sb_one->reference += tmp;
-                  for (sb_one = *sb_que_newcomer; sb_one != 0; sb_one = sb_one->lnk_br)
+                  for (sb_one = *sb_que_newcomer; sb_one != NULL; sb_one = sb_one->lnk_br)
                     sb_one->son_v = sum_hyouka (sb_one);
-                  if (*sb_que_head != 0)
+                  if (*sb_que_head != NULL)
                     *sb_que_head = que_reorder (*sb_que_head, *sb_que_newcomer);
                   else
                     *sb_que_head = *sb_que_newcomer;
@@ -184,17 +184,17 @@
     while (dbncnt > 0 && bzd->v_jc < _DIVID (edagari_hyouka, 2))
       {
         *rbzd = bzd->lnk_br;
-        bzd->lnk_br = 0;
+        bzd->lnk_br = NULL;
         clr_node (bzd);
         bzd = *rbzd;
         dbncnt--;
       }
-    for (; bzd != 0 && bzd->lnk_br != 0; bzd = bzd->lnk_br)
+    for (; bzd != NULL && bzd->lnk_br != NULL; bzd = bzd->lnk_br)
       {
         if (bzd->lnk_br->v_jc < _DIVID (edagari_hyouka, 2))
           {
             bzd_sv = bzd->lnk_br->lnk_br;
-            bzd->lnk_br->lnk_br = 0;
+            bzd->lnk_br->lnk_br = NULL;
             clr_node (bzd->lnk_br);
             bzd->lnk_br = bzd_sv;
             dbncnt--;
@@ -342,7 +342,7 @@
         {
           fzklen = Strlen (fzkchar);
           fzk_buf = rev_fzk (fzkchar, fzklen);
-          if (fzk_buf == 0)
+          if (fzk_buf == NULL)
             return (NO);        /* ええかげん */
 
           fzkcnt = fzk_kai (fzk_buf, fzk_buf + fzklen, v, WNN_VECT_NO, &ichbnpbp);
@@ -373,14 +373,14 @@
      register w_char *fzkchar;
      int len;
 {
-  static w_char *fzk = 0;
+  static w_char *fzk = NULL;
   static int fzk_len = 0;
 
   if (fzk_len < len)
     {
-      if (fzk != 0)
+      if (fzk != NULL)
         free (fzk);
-      if ((fzk = (w_char *) malloc ((len + 1) * sizeof (w_char))) == 0)
+      if ((fzk = (w_char *) malloc ((len + 1) * sizeof (w_char))) == NULL)
         {
           wnn_errorno = WNN_MALLOC_ERR;
           fzk_len = 0;
@@ -407,7 +407,7 @@
   register struct SYO_BNSETSU *next;
   int flg;
 
-  if (new == 0)
+  if (new == NULL)
     return (que);
   if ((flg = sbjunjo (que, new)) < 0)
     {
@@ -500,13 +500,13 @@
 sbjunjo (que, new)
      register struct SYO_BNSETSU *que, *new;
 {
-  if (new == 0)
+  if (new == NULL)
     return (1);
   if (que->j_c > new->j_c)
     return (-1);
   if (que->j_c < new->j_c)
     {
-      if (que->lnk_br == 0)
+      if (que->lnk_br == NULL)
         return (0);
       if (que->lnk_br->j_c > new->j_c)
         return (0);
@@ -520,7 +520,7 @@
     return (-2);
   if (que->kangovect > new->kangovect)
     return (-1);
-  if (que->lnk_br == 0)
+  if (que->lnk_br == NULL)
     return (0);
   if (que->lnk_br->j_c > new->j_c)
     return (0);
@@ -549,7 +549,7 @@
   else if (hyouka < _DIVID (edagari_hyouka, 2))
     return (0);
 
-  if (*bzd != 0)
+  if (*bzd != NULL)
     {
       if ((*bzd)->j_c == sbn->j_c)
         {
@@ -561,7 +561,7 @@
         }
       else
         {
-          if (((*bzd)->lnk_br = getbzdsp ()) == 0)
+          if (((*bzd)->lnk_br = getbzdsp ()) == NULL)
             return (-1);
           (*bzd) = (*bzd)->lnk_br;
           ret = 1;
@@ -569,15 +569,15 @@
     }
   else
     {
-      if ((*rbzd = *bzd = getbzdsp ()) == 0)
+      if ((*rbzd = *bzd = getbzdsp ()) == NULL)
         return (-1);
       ret = 1;
     }
   (*bzd)->v_jc = hyouka;
   (*bzd)->j_c = sbn->j_c;
   (*bzd)->sbn_cnt = sbn->kbcnt;
-  (*bzd)->lnk_br = 0;
-  (*bzd)->lnk_son = 0;
+  (*bzd)->lnk_br = NULL;
+  (*bzd)->lnk_son = NULL;
   (*bzd)->son_v = 0;
   (*bzd)->sbn = sbn;
   (*bzd)->kbcnt = 1;