/* check if two current characters are L and V */
lindex = last - LBase;
- if (0 <= lindex && lindex < (unsigned long) LCount) {
+ if (lindex < (unsigned long) LCount) {
unsigned long vindex = ch - VBase;
- if (0 <= vindex && vindex < (unsigned long) VCount) {
+ if (vindex < (unsigned long) VCount) {
/* make syllable of form LV */
last = SBase + (lindex * VCount + vindex) * TCount;
str[rlen-1] = last; /* reset last */
/* check if two current characters are LV and T */
sindex = last - SBase;
- if (0 <= sindex && sindex < (unsigned long) SCount
+ if (sindex < (unsigned long) SCount
&& (sindex % TCount) == 0)
{
unsigned long tindex = ch - TBase;
- if (0 <= tindex && tindex <= (unsigned long) TCount) {
+ if (tindex <= (unsigned long) TCount) {
/* make syllable of form LVT */
last += tindex;
str[rlen-1] = last; /* reset last */
* Handle the case of the codes matching and simply replace the number
* that was there before.
*/
- if (ncodes_used > 0 && code == ncodes[i].code) {
+ if (i < ncodes_used && code == ncodes[i].code) {
ncodes[i].idx = make_number(num, denom);
return;
}
i = 0;
}
- p = ucs = (long *) malloc( len * sizeof(*ucs) );
+ p = ucs = malloc( len * sizeof(*ucs) );
if ( ucs == NULL ) {
free(out);
return NULL;
* proper normalized form.
*/
- ucs = (long *) malloc( ( ( norm1 || l1 > l2 ) ? l1 : l2 ) * sizeof(*ucs) );
+ ucs = malloc( ( ( norm1 || l1 > l2 ) ? l1 : l2 ) * sizeof(*ucs) );
if ( ucs == NULL ) {
return l1 > l2 ? 1 : -1; /* what to do??? */
}
if ( norm1 ) {
ucsout1 = ucs;
l1 = ulen;
- ucs = (long *) malloc( l2 * sizeof(*ucs) );
+ ucs = malloc( l2 * sizeof(*ucs) );
if ( ucs == NULL ) {
return l1 > l2 ? 1 : -1; /* what to do??? */
}