comparison Wnn/jserver/jbiki.c @ 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 790205f476c0
children 6bfa7ea3b75b
comparison
equal deleted inserted replaced
2:b605a0e60f5b 3:ed4bb01eb317
183 } 183 }
184 184
185 maxlevel = max (maxlevel, len); 185 maxlevel = max (maxlevel, len);
186 if (j_e_p >= jmtw_end) 186 if (j_e_p >= jmtw_end)
187 return (-1); 187 return (-1);
188 j_e_p->kanji1 = (UCHAR *)p->kanjipter; 188 j_e_p->kanji1 = p->kanjipter; //xxx is this an offset? may result in failure --yaz
189 j_e_p->kanji2 = 0; 189 j_e_p->kanji2 = 0;
190 j_e_p->serial = p->serial; 190 j_e_p->serial = p->serial;
191 j_e_p->kosuu = p->kosuu; 191 j_e_p->kosuu = p->kosuu;
192 j_e_p->jishono = number; 192 j_e_p->jishono = number;
193 j_e_p->jptr = NULL; 193 j_e_p->jptr = NULL;
271 struct uind2 *hop; 271 struct uind2 *hop;
272 272
273 if (yomi[0] == 0) 273 if (yomi[0] == 0)
274 return (ui1p->yomi1 > 0); 274 return (ui1p->yomi1 > 0);
275 y1 = yomi[0] << 16 | yomi[1]; 275 y1 = yomi[0] << 16 | yomi[1];
276 if (tmp = (ui1p->yomi1 - y1)) 276 if ((tmp = (ui1p->yomi1 - y1)))
277 { 277 {
278 return ((ui1p->yomi1 > y1) ? 1 : -1); 278 return ((ui1p->yomi1 > y1) ? 1 : -1);
279 } 279 }
280 if (yomi[1] == 0) 280 if (yomi[1] == 0)
281 return (0); 281 return (0);
282 if (yomi[2] == 0) 282 if (yomi[2] == 0)
283 return (ui1p->yomi2 > 0); 283 return (ui1p->yomi2 > 0);
284 y2 = yomi[2] << 16 | yomi[3]; 284 y2 = yomi[2] << 16 | yomi[3];
285 if (tmp = (ui1p->yomi2 - y2)) 285 if ((tmp = (ui1p->yomi2 - y2)))
286 { 286 {
287 return ((ui1p->yomi2 > y2) ? 1 : -1); 287 return ((ui1p->yomi2 > y2) ? 1 : -1);
288 } 288 }
289 hop = ((struct uind2 *) ((ui1p->pter) + jtl->hontai)); 289 hop = ((struct uind2 *) ((ui1p->pter) + jtl->hontai));
290 if ((len = hop->yomi[0]) < 4) 290 if ((len = hop->yomi[0]) < 4)
443 } 443 }
444 444
445 maxlevel = max (maxlevel, level + 1); 445 maxlevel = max (maxlevel, level + 1);
446 if (j_e_p >= jmtw_end) 446 if (j_e_p >= jmtw_end)
447 return (-1); 447 return (-1);
448 j_e_p->kanji1 = (UCHAR *) (hopter + 8); 448 j_e_p->kanji1 = *(int *) (hopter + 8); //xxx what's? --yaz
449 j_e_p->kanji2 = sumst[index - 1]; 449 j_e_p->kanji2 = sumst[index - 1];
450 j_e_p->serial = serial = *(int *) (hopter + 4) + sumst[index - 1]; 450 j_e_p->serial = serial = *(int *) (hopter + 4) + sumst[index - 1];
451 j_e_p->kosuu = cnt; 451 j_e_p->kosuu = cnt;
452 j_e_p->jishono = number; 452 j_e_p->jishono = number;
453 j_e_p->jptr = NULL; 453 j_e_p->jptr = NULL;
585 kanji = jtl->kanji; 585 kanji = jtl->kanji;
586 586
587 for (ind = rd_binary (tary, yomi, jtl->maxri1[which], ri2, kanji, which); ind >= 0; ind = tary[ind].pter1) 587 for (ind = rd_binary (tary, yomi, jtl->maxri1[which], ri2, kanji, which); ind >= 0; ind = tary[ind].pter1)
588 { 588 {
589 p = tary[ind].pter + ri2; 589 p = tary[ind].pter + ri2;
590 len = Get_kanji_len (p->kanjipter + kanji, which); 590 len = Get_kanji_len (p->kanjipter + kanji, which); // xxx regard p->kanjipter as an offset for now --yaz
591 if (jmt + len > jmt_end) 591 if (jmt + len > jmt_end)
592 return (-1); 592 return (-1);
593 /* set jmt */ 593 /* set jmt */
594 jepp = &(jmt[len - 1]); 594 jepp = &(jmt[len - 1]);
595 for (; *jepp; jepp = &((*jepp)->jptr)); 595 for (; *jepp; jepp = &((*jepp)->jptr));
605 else 605 else
606 { 606 {
607 *jepp = j_e_p; 607 *jepp = j_e_p;
608 if (j_e_p >= jmtw_end) 608 if (j_e_p >= jmtw_end)
609 return (-1); 609 return (-1);
610 j_e_p->kanji1 = (UCHAR *)p->kanjipter; //xxx this may result in failure --yaz 610 j_e_p->kanji1 = p->kanjipter; //xxx this may result in failure --yaz
611 j_e_p->kanji2 = 0; 611 j_e_p->kanji2 = 0;
612 j_e_p->serial = serial; 612 j_e_p->serial = serial;
613 j_e_p->kosuu = 1; 613 j_e_p->kosuu = 1;
614 j_e_p->jishono = number; 614 j_e_p->jishono = number;
615 j_e_p->jptr = NULL; 615 j_e_p->jptr = NULL;