/[bison]/bison/lib/abitset.c
ViewVC logotype

Diff of /bison/lib/abitset.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by akim, Tue Jul 2 13:51:26 2002 UTC revision 1.2 by eggert, Mon Aug 12 14:09:24 2002 UTC
# Line 208  abitset_reverse_list (src, list, num, ne Line 208  abitset_reverse_list (src, list, num, ne
208    bitcnt = bitno % BITSET_WORD_BITS;    bitcnt = bitno % BITSET_WORD_BITS;
209    bitoff = windex * BITSET_WORD_BITS;    bitoff = windex * BITSET_WORD_BITS;
210    
211    for (; windex != ~0U; windex--, bitoff -= BITSET_WORD_BITS,    do
          bitcnt = BITSET_WORD_BITS - 1)  
212      {      {
213        word = srcp[windex] << (BITSET_WORD_BITS - 1 - bitcnt);        word = srcp[windex] << (BITSET_WORD_BITS - 1 - bitcnt);
214        for (; word; bitcnt--)        for (; word; bitcnt--)
# Line 225  abitset_reverse_list (src, list, num, ne Line 224  abitset_reverse_list (src, list, num, ne
224              }              }
225            word <<= 1;            word <<= 1;
226          }          }
227          bitoff -= BITSET_WORD_BITS;
228          bitcnt = BITSET_WORD_BITS - 1;
229      }      }
230      while (windex--);
231    
232    *next = n_bits - (bitoff + 1);    *next = n_bits - (bitoff + 1);
233    return count;    return count;
# Line 348  abitset_unused_clear (dst) Line 350  abitset_unused_clear (dst)
350    last_bit = ABITSET_N_BITS (dst) % BITSET_WORD_BITS;    last_bit = ABITSET_N_BITS (dst) % BITSET_WORD_BITS;
351    if (last_bit)    if (last_bit)
352      ABITSET_WORDS (dst)[dst->b.csize - 1] &=      ABITSET_WORDS (dst)[dst->b.csize - 1] &=
353        (bitset_word) ((1 << last_bit) - 1);        ((bitset_word) 1 << last_bit) - 1;
354  }  }
355    
356    
# Line 370  abitset_op1 (dst, op) Line 372  abitset_op1 (dst, op)
372        break;        break;
373    
374      case BITSET_OP_ONES:      case BITSET_OP_ONES:
375        memset (dstp, ~0, bytes);        memset (dstp, -1, bytes);
376        abitset_unused_clear (dst);        abitset_unused_clear (dst);
377        break;        break;
378    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26