Mercurial > freewnn
diff Wnn/jserver/jikouho_d.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 | ed4bb01eb317 |
children |
line wrap: on
line diff
--- a/Wnn/jserver/jikouho_d.c Fri Mar 05 20:46:36 2010 +0900 +++ b/Wnn/jserver/jikouho_d.c Sat Mar 06 04:37:31 2010 +0900 @@ -84,7 +84,7 @@ { register int i; register int cnt; - struct JKT_DBN *rjkt_dbn = 0; + struct JKT_DBN *rjkt_dbn = NULL; register struct DSD_DBN *dbn; int divid; @@ -185,7 +185,7 @@ register struct JKT_SBN *sb_one; struct JKT_SBN *sbn_tmp; register struct JKT_SBN **sb_que_newcomer; - struct JKT_DBN *jktdbn = 0; + struct JKT_DBN *jktdbn = NULL; int dbncnt = 0; #ifndef NO_KANA int gijiflag = 0; /* 疑似文節を作ったか:最初の小文節のみ */ @@ -223,7 +223,7 @@ else if (tmp > 0) { sb_one->reference += tmp; - if (*sb_que_head != 0) + if (*sb_que_head != NULL) *sb_que_head = jkt_que_reorder (*sb_que_head, *sb_que_newcomer); else *sb_que_head = *sb_que_newcomer; @@ -247,9 +247,9 @@ if ((sb_one = get_hira_kouho (&db_tmp, yomi_sno, yomi_eno)) < (struct JKT_SBN *) 0) return (-1); - if (sb_one > (struct JKT_SBN *) 0) + if (sb_one != NULL) { - sb_one->parent = 0; + sb_one->parent = NULL; sb_one->bend_m = yomi_sno; sb_one->kbcnt = 1; if (set_jkt_dai (rjkt_dbn, &jktdbn, sb_one) < 0) @@ -418,7 +418,7 @@ { struct JKT_DBN *getjktdbn (); - if (*jktdbn != 0) + if (*jktdbn != NULL) { if (((*jktdbn)->lnk_br = getjktdbn ()) == NULL) return (-1); @@ -431,7 +431,7 @@ } (*jktdbn)->j_c = sbn->j_c; (*jktdbn)->sbn_cnt = sbn->kbcnt; - (*jktdbn)->lnk_br = 0; + (*jktdbn)->lnk_br = NULL; (*jktdbn)->sbn = sbn; (*jktdbn)->bend_m = yomi_sno_tmp; return (0); @@ -462,7 +462,7 @@ register int fzkcnt, ii, jktcnt; register int i, /* 幹語の終わりのインデックス */ j; /* 文節始めのインデックス */ - struct JKT_SBN *jktsbn_top = 0; + struct JKT_SBN *jktsbn_top = NULL; struct ICHBNP *ichbnpbp; struct JKT_SBN *gijisbn_top; int get_giji_flg = -1; /* 擬似文節を作れたか */ @@ -552,7 +552,7 @@ } freesbn (giji_sbn); - if (gijisbn_top != 0) + if (gijisbn_top != NULL) { if (get_giji_flg > j) { @@ -585,7 +585,7 @@ get_dsd_dbn (cnt) register int cnt; { - static struct DSD_DBN *m_dbn = 0; + static struct DSD_DBN *m_dbn = NULL; static int md_cnt = 0; if (md_cnt < cnt) @@ -612,7 +612,7 @@ get_dsd_sbn (cnt) register int cnt; { - static struct DSD_SBN *m_sbn = 0; + static struct DSD_SBN *m_sbn = NULL; static int ms_cnt = 0; if (ms_cnt < cnt) @@ -683,14 +683,14 @@ freejktdbn (dbn); dbn = next_dbn; #else /* CONVERT_from_TOP */ - for (sbn = dbn->sbn; sbn != 0; sbn = sbn->parent, d_sbn++) + for (sbn = dbn->sbn; sbn != NULL; sbn = sbn->parent, d_sbn++) { son = cnt_son (dbn->sbn, sbn); par = cnt_par (sbn); p_sbn = d_sbn; for (j = 0; j < son; j++) { - for (sone = sbn->sbn; sone != 0; sone = sone->lnk_br) + for (sone = sbn->sbn; sone != NULL; sone = sone->lnk_br) { for (i = 0; i < par; i++) { @@ -703,7 +703,7 @@ p_sbn->kangovect = sbn->kangovect; p_sbn->v_jc = sone->v_jc; p_sbn->status_bkwd = sone->status_bkwd; - if (sbn->status == WNN_NOT_CONNECT && sone->jentptr == 0) + if (sbn->status == WNN_NOT_CONNECT && sone->jentptr == NULL) p_sbn->status = WNN_GIJI; else p_sbn->status = sbn->status; @@ -730,7 +730,7 @@ { int son, par; register struct DSD_SBN *p_sbn; - if (sbn != 0) + if (sbn != NULL) { sbn_set (dbn, pr_d_sbn, sone, sbn->parent); @@ -755,7 +755,7 @@ for (j = 0; j < son; j++) { - for (sone = sbn->sbn; sone != 0; sone = sone->lnk_br) + for (sone = sbn->sbn; sone != NULL; sone = sone->lnk_br) { for (i = 0; i < par; i++) { @@ -768,7 +768,7 @@ p_sbn->kangovect = sbn->kangovect; p_sbn->v_jc = sone->v_jc; p_sbn->status_bkwd = sone->status_bkwd; - if (sbn->status == WNN_NOT_CONNECT && sone->jentptr == 0) + if (sbn->status == WNN_NOT_CONNECT && sone->jentptr == NULL) p_sbn->status = WNN_GIJI; else p_sbn->status = sbn->status;