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

Diff of /bison/lib/lbitset.c

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

revision 1.9 by eggert, Thu Oct 10 07:33:59 2002 UTC revision 1.10 by eggert, Wed Oct 16 06:27:59 2002 UTC
# Line 66  lbitset_elt; Line 66  lbitset_elt;
66    
67  enum lbitset_find_mode  enum lbitset_find_mode
68    { LBITSET_FIND, LBITSET_CREATE, LBITSET_SUBST };    { LBITSET_FIND, LBITSET_CREATE, LBITSET_SUBST };
 typedef int enum_lbitset_find_mode;  
69    
70  static lbitset_elt lbitset_zero_elts[3]; /* Elements of all zero bits.  */  static lbitset_elt lbitset_zero_elts[3]; /* Elements of all zero bits.  */
71    
# Line 75  static struct obstack lbitset_obstack; Line 74  static struct obstack lbitset_obstack;
74  static int lbitset_obstack_init = 0;  static int lbitset_obstack_init = 0;
75  static lbitset_elt *lbitset_free_list;  /* Free list of bitset elements.  */  static lbitset_elt *lbitset_free_list;  /* Free list of bitset elements.  */
76    
 static lbitset_elt *lbitset_elt_alloc PARAMS ((void));  
 static lbitset_elt *lbitset_elt_calloc PARAMS ((void));  
 static void lbitset_elt_link PARAMS ((bitset, lbitset_elt *));  
 static void lbitset_elt_unlink PARAMS ((bitset, lbitset_elt *));  
 static void lbitset_elt_free PARAMS ((lbitset_elt *));  
 static lbitset_elt *lbitset_elt_find PARAMS ((bitset, bitset_windex,  
                                               enum_lbitset_find_mode));  
 static int lbitset_elt_zero_p PARAMS ((lbitset_elt *));  
   
 static void lbitset_prune PARAMS ((bitset, lbitset_elt *));  
 static void lbitset_weed PARAMS ((bitset));  
 static void lbitset_zero PARAMS ((bitset));  
 static int lbitset_equal_p PARAMS ((bitset, bitset));  
 static void lbitset_copy PARAMS ((bitset, bitset));  
 static int lbitset_copy_cmp PARAMS ((bitset, bitset));  
 static void lbitset_set PARAMS ((bitset, bitset_bindex));  
 static void lbitset_reset PARAMS ((bitset, bitset_bindex));  
 static int lbitset_test PARAMS ((bitset, bitset_bindex));  
 static bitset_bindex lbitset_size PARAMS ((bitset));  
 static int lbitset_op3_cmp PARAMS ((bitset, bitset, bitset, enum_bitset_ops));  
 static void lbitset_and PARAMS ((bitset, bitset, bitset));  
 static int lbitset_and_cmp PARAMS ((bitset, bitset, bitset));  
 static void lbitset_andn PARAMS ((bitset, bitset, bitset));  
 static int lbitset_andn_cmp PARAMS ((bitset, bitset, bitset));  
 static void lbitset_or PARAMS ((bitset, bitset, bitset));  
 static int lbitset_or_cmp PARAMS ((bitset, bitset, bitset));  
 static void lbitset_xor PARAMS ((bitset, bitset, bitset));  
 static int lbitset_xor_cmp PARAMS ((bitset, bitset, bitset));  
 static bitset_bindex lbitset_list PARAMS ((bitset, bitset_bindex *,  
                                            bitset_bindex, bitset_bindex *));  
 static bitset_bindex lbitset_list_reverse  
 PARAMS ((bitset, bitset_bindex *, bitset_bindex, bitset_bindex *));  
 static int lbitset_empty_p PARAMS ((bitset));  
 static void lbitset_ones PARAMS ((bitset));  
 static void lbitset_not PARAMS ((bitset, bitset));  
 static int lbitset_subset_p PARAMS ((bitset, bitset));  
 static int lbitset_disjoint_p PARAMS ((bitset, bitset));  
 static void lbitset_free PARAMS ((bitset));  
77  extern void debug_lbitset PARAMS ((bitset));  extern void debug_lbitset PARAMS ((bitset));
78    
79  #define LBITSET_CURRENT1(X) \  #define LBITSET_CURRENT1(X) \
# Line 125  extern void debug_lbitset PARAMS ((bitse Line 86  extern void debug_lbitset PARAMS ((bitse
86    
87  /* Allocate a lbitset element.  The bits are not cleared.  */  /* Allocate a lbitset element.  The bits are not cleared.  */
88  static inline lbitset_elt *  static inline lbitset_elt *
89  lbitset_elt_alloc ()  lbitset_elt_alloc (void)
90  {  {
91    lbitset_elt *elt;    lbitset_elt *elt;
92    
# Line 180  lbitset_elt_alloc () Line 141  lbitset_elt_alloc ()
141    
142  /* Allocate a lbitset element.  The bits are cleared.  */  /* Allocate a lbitset element.  The bits are cleared.  */
143  static inline lbitset_elt *  static inline lbitset_elt *
144  lbitset_elt_calloc ()  lbitset_elt_calloc (void)
145  {  {
146    lbitset_elt *elt;    lbitset_elt *elt;
147    
# Line 191  lbitset_elt_calloc () Line 152  lbitset_elt_calloc ()
152    
153    
154  static inline void  static inline void
155  lbitset_elt_free (elt)  lbitset_elt_free (lbitset_elt *elt)
      lbitset_elt *elt;  
156  {  {
157    elt->next = lbitset_free_list;    elt->next = lbitset_free_list;
158    lbitset_free_list = elt;    lbitset_free_list = elt;
# Line 201  lbitset_elt_free (elt) Line 161  lbitset_elt_free (elt)
161    
162  /* Unlink element ELT from bitset BSET.  */  /* Unlink element ELT from bitset BSET.  */
163  static inline void  static inline void
164  lbitset_elt_unlink (bset, elt)  lbitset_elt_unlink (bitset bset, lbitset_elt *elt)
      bitset bset;  
      lbitset_elt *elt;  
165  {  {
166    lbitset_elt *next = elt->next;    lbitset_elt *next = elt->next;
167    lbitset_elt *prev = elt->prev;    lbitset_elt *prev = elt->prev;
# Line 248  lbitset_elt_unlink (bset, elt) Line 206  lbitset_elt_unlink (bset, elt)
206  /* Cut the chain of bitset BSET before element ELT and free the  /* Cut the chain of bitset BSET before element ELT and free the
207     elements.  */     elements.  */
208  static inline void  static inline void
209  lbitset_prune (bset, elt)  lbitset_prune (bitset bset, lbitset_elt *elt)
      bitset bset;  
      lbitset_elt *elt;  
210  {  {
211    lbitset_elt *next;    lbitset_elt *next;
212    
# Line 282  lbitset_prune (bset, elt) Line 238  lbitset_prune (bset, elt)
238    
239  /* Return nonzero if all bits in an element are zero.  */  /* Return nonzero if all bits in an element are zero.  */
240  static inline int  static inline int
241  lbitset_elt_zero_p (elt)  lbitset_elt_zero_p (lbitset_elt *elt)
      lbitset_elt *elt;  
242  {  {
243    int i;    int i;
244    
# Line 297  lbitset_elt_zero_p (elt) Line 252  lbitset_elt_zero_p (elt)
252    
253  /* Link the bitset element into the current bitset linked list.  */  /* Link the bitset element into the current bitset linked list.  */
254  static inline void  static inline void
255  lbitset_elt_link (bset, elt)  lbitset_elt_link (bitset bset, lbitset_elt *elt)
      bitset bset;  
      lbitset_elt *elt;  
256  {  {
257    bitset_windex windex = elt->index;    bitset_windex windex = elt->index;
258    lbitset_elt *ptr;    lbitset_elt *ptr;
# Line 361  lbitset_elt_link (bset, elt) Line 314  lbitset_elt_link (bset, elt)
314    
315    
316  static lbitset_elt *  static lbitset_elt *
317  lbitset_elt_find (bset, windex, mode)  lbitset_elt_find (bitset bset, bitset_windex windex,
318       bitset bset;                    enum lbitset_find_mode mode)
      bitset_windex windex;  
      enum_lbitset_find_mode mode;  
319  {  {
320    lbitset_elt *elt;    lbitset_elt *elt;
321    lbitset_elt *current;    lbitset_elt *current;
# Line 432  lbitset_elt_find (bset, windex, mode) Line 383  lbitset_elt_find (bset, windex, mode)
383    
384  /* Weed out the zero elements from the list.  */  /* Weed out the zero elements from the list.  */
385  static inline void  static inline void
386  lbitset_weed (bset)  lbitset_weed (bitset bset)
      bitset bset;  
387  {  {
388    lbitset_elt *elt;    lbitset_elt *elt;
389    lbitset_elt *next;    lbitset_elt *next;
# Line 449  lbitset_weed (bset) Line 399  lbitset_weed (bset)
399    
400  /* Set all bits in the bitset to zero.  */  /* Set all bits in the bitset to zero.  */
401  static void  static void
402  lbitset_zero (bset)  lbitset_zero (bitset bset)
      bitset bset;  
403  {  {
404    lbitset_elt *head;    lbitset_elt *head;
405    
# Line 465  lbitset_zero (bset) Line 414  lbitset_zero (bset)
414    
415  /* Return 1 if DST == SRC.  */  /* Return 1 if DST == SRC.  */
416  static inline int  static inline int
417  lbitset_equal_p (dst, src)  lbitset_equal_p (bitset dst, bitset src)
      bitset dst;  
      bitset src;  
418  {  {
419    lbitset_elt *selt;    lbitset_elt *selt;
420    lbitset_elt *delt;    lbitset_elt *delt;
# Line 494  lbitset_equal_p (dst, src) Line 441  lbitset_equal_p (dst, src)
441    
442  /* Copy bits from bitset SRC to bitset DST.  */  /* Copy bits from bitset SRC to bitset DST.  */
443  static inline void  static inline void
444  lbitset_copy (dst, src)  lbitset_copy (bitset dst, bitset src)
      bitset dst;  
      bitset src;  
445  {  {
446    lbitset_elt *elt;    lbitset_elt *elt;
447    lbitset_elt *head;    lbitset_elt *head;
# Line 538  lbitset_copy (dst, src) Line 483  lbitset_copy (dst, src)
483  /* Copy bits from bitset SRC to bitset DST.  Return non-zero if  /* Copy bits from bitset SRC to bitset DST.  Return non-zero if
484     bitsets different.  */     bitsets different.  */
485  static inline int  static inline int
486  lbitset_copy_cmp (dst, src)  lbitset_copy_cmp (bitset dst, bitset src)
      bitset dst;  
      bitset src;  
487  {  {
488    if (src == dst)    if (src == dst)
489      return 0;      return 0;
# Line 561  lbitset_copy_cmp (dst, src) Line 504  lbitset_copy_cmp (dst, src)
504    
505  /* Return size in bits of bitset SRC.  */  /* Return size in bits of bitset SRC.  */
506  static bitset_bindex  static bitset_bindex
507  lbitset_size (src)  lbitset_size (bitset src)
      bitset src;  
508  {  {
509    lbitset_elt *elt;    lbitset_elt *elt;
510    
# Line 577  lbitset_size (src) Line 519  lbitset_size (src)
519    
520  /* Set bit BITNO in bitset DST.  */  /* Set bit BITNO in bitset DST.  */
521  static void  static void
522  lbitset_set (dst, bitno)  lbitset_set (bitset dst, bitset_bindex bitno)
      bitset dst;  
      bitset_bindex bitno;  
523  {  {
524    bitset_windex windex = bitno / BITSET_WORD_BITS;    bitset_windex windex = bitno / BITSET_WORD_BITS;
525    
# Line 592  lbitset_set (dst, bitno) Line 532  lbitset_set (dst, bitno)
532    
533  /* Reset bit BITNO in bitset DST.  */  /* Reset bit BITNO in bitset DST.  */
534  static void  static void
535  lbitset_reset (dst, bitno)  lbitset_reset (bitset dst, bitset_bindex bitno)
      bitset dst;  
      bitset_bindex bitno;  
536  {  {
537    bitset_windex windex = bitno / BITSET_WORD_BITS;    bitset_windex windex = bitno / BITSET_WORD_BITS;
538    
# Line 610  lbitset_reset (dst, bitno) Line 548  lbitset_reset (dst, bitno)
548    
549  /* Test bit BITNO in bitset SRC.  */  /* Test bit BITNO in bitset SRC.  */
550  static int  static int
551  lbitset_test (src, bitno)  lbitset_test (bitset src, bitset_bindex bitno)
      bitset src;  
      bitset_bindex bitno;  
552  {  {
553    bitset_windex windex = bitno / BITSET_WORD_BITS;    bitset_windex windex = bitno / BITSET_WORD_BITS;
554    
555    if (!lbitset_elt_find (src, windex, LBITSET_FIND))    if (!lbitset_elt_find (src, windex, LBITSET_FIND))
556      return 0;      return 0;
557    
558    return (src->b.cdata[windex - src->b.cindex]    return (src->b.cdata[windex - src->b.cindex]
559            >> (bitno % BITSET_WORD_BITS)) & 1;            >> (bitno % BITSET_WORD_BITS)) & 1;
560  }  }
561    
562    
563  static void  static void
564  lbitset_free (bset)  lbitset_free (bitset bset)
      bitset bset;  
565  {  {
566    lbitset_zero (bset);    lbitset_zero (bset);
567  }  }
# Line 636  lbitset_free (bset) Line 571  lbitset_free (bset)
571   *NEXT and store in array LIST.  Return with actual number of bits   *NEXT and store in array LIST.  Return with actual number of bits
572   found and with *NEXT indicating where search stopped.  */   found and with *NEXT indicating where search stopped.  */
573  static bitset_bindex  static bitset_bindex
574  lbitset_list_reverse (bset, list, num, next)  lbitset_list_reverse (bitset bset, bitset_bindex *list,
575       bitset bset;                        bitset_bindex num, bitset_bindex *next)
      bitset_bindex *list;  
      bitset_bindex num;  
      bitset_bindex *next;  
576  {  {
577    bitset_bindex rbitno;    bitset_bindex rbitno;
578    bitset_bindex bitno;    bitset_bindex bitno;
# Line 734  lbitset_list_reverse (bset, list, num, n Line 666  lbitset_list_reverse (bset, list, num, n
666   *NEXT and store in array LIST.  Return with actual number of bits   *NEXT and store in array LIST.  Return with actual number of bits
667   found and with *NEXT indicating where search stopped.  */   found and with *NEXT indicating where search stopped.  */
668  static bitset_bindex  static bitset_bindex
669  lbitset_list (bset, list, num, next)  lbitset_list (bitset bset, bitset_bindex *list,
670       bitset bset;                bitset_bindex num, bitset_bindex *next)
      bitset_bindex *list;  
      bitset_bindex num;  
      bitset_bindex *next;  
671  {  {
672    bitset_bindex bitno;    bitset_bindex bitno;
673    bitset_windex windex;    bitset_windex windex;
# Line 937  lbitset_list (bset, list, num, next) Line 866  lbitset_list (bset, list, num, next)
866    
867    
868  static int  static int
869  lbitset_empty_p (dst)  lbitset_empty_p (bitset dst)
      bitset dst;  
870  {  {
871    lbitset_weed (dst);    lbitset_weed (dst);
872    if (LBITSET_HEAD (dst))    if (LBITSET_HEAD (dst))
# Line 948  lbitset_empty_p (dst) Line 876  lbitset_empty_p (dst)
876    
877    
878  static void  static void
879  lbitset_ones (dst)  lbitset_ones (bitset dst)
      bitset dst;  
880  {  {
881    bitset_windex i;    bitset_windex i;
882    bitset_windex windex;    bitset_windex windex;
# Line 963  lbitset_ones (dst) Line 890  lbitset_ones (dst)
890    /* Ignore empty set.  */    /* Ignore empty set.  */
891    if (!elt)    if (!elt)
892      return;      return;
893      
894    windex = elt->index;    windex = elt->index;
895    for (i = 0; i < windex; i += LBITSET_ELT_WORDS)    for (i = 0; i < windex; i += LBITSET_ELT_WORDS)
896      {      {
# Line 975  lbitset_ones (dst) Line 902  lbitset_ones (dst)
902    
903    
904  static void  static void
905  lbitset_not (dst, src)  lbitset_not (bitset dst, bitset src)
      bitset dst;  
      bitset src;  
906  {  {
907    lbitset_elt *elt;    lbitset_elt *elt;
908    lbitset_elt *selt;    lbitset_elt *selt;
# Line 992  lbitset_not (dst, src) Line 917  lbitset_not (dst, src)
917    /* Ignore empty set.  */    /* Ignore empty set.  */
918    if (!elt)    if (!elt)
919      return;      return;
920      
921    windex = elt->index;    windex = elt->index;
922    for (i = 0; i < windex; i += LBITSET_ELT_WORDS)    for (i = 0; i < windex; i += LBITSET_ELT_WORDS)
923      {      {
# Line 1000  lbitset_not (dst, src) Line 925  lbitset_not (dst, src)
925           or substitute zero elements if src elements not found.  */           or substitute zero elements if src elements not found.  */
926        selt = lbitset_elt_find (src, i, LBITSET_SUBST);        selt = lbitset_elt_find (src, i, LBITSET_SUBST);
927        delt = lbitset_elt_find (dst, i, LBITSET_CREATE);        delt = lbitset_elt_find (dst, i, LBITSET_CREATE);
928          
929        for (j = 0; j < LBITSET_ELT_WORDS; j++)        for (j = 0; j < LBITSET_ELT_WORDS; j++)
930          delt->words[j] = ~selt->words[j];          delt->words[j] = ~selt->words[j];
931      }      }
# Line 1011  lbitset_not (dst, src) Line 936  lbitset_not (dst, src)
936    
937  /* Return 1 if DST == DST | SRC.  */  /* Return 1 if DST == DST | SRC.  */
938  static int  static int
939  lbitset_subset_p (dst, src)  lbitset_subset_p (bitset dst, bitset src)
      bitset dst;  
      bitset src;  
940  {  {
941    lbitset_elt *selt;    lbitset_elt *selt;
942    lbitset_elt *delt;    lbitset_elt *delt;
# Line 1039  lbitset_subset_p (dst, src) Line 962  lbitset_subset_p (dst, src)
962                selt = &lbitset_zero_elts[1];                selt = &lbitset_zero_elts[1];
963              }              }
964          }          }
965          
966        for (j = 0; j < LBITSET_ELT_WORDS; j++)        for (j = 0; j < LBITSET_ELT_WORDS; j++)
967          if (delt->words[j] != (selt->words[j] | delt->words[j]))          if (delt->words[j] != (selt->words[j] | delt->words[j]))
968            return 0;            return 0;
# Line 1050  lbitset_subset_p (dst, src) Line 973  lbitset_subset_p (dst, src)
973    
974  /* Return 1 if DST & SRC == 0.  */  /* Return 1 if DST & SRC == 0.  */
975  static int  static int
976  lbitset_disjoint_p (dst, src)  lbitset_disjoint_p (bitset dst, bitset src)
      bitset dst;  
      bitset src;  
977  {  {
978    lbitset_elt *selt;    lbitset_elt *selt;
979    lbitset_elt *delt;    lbitset_elt *delt;
# Line 1077  lbitset_disjoint_p (dst, src) Line 998  lbitset_disjoint_p (dst, src)
998               intersection of these elements.  */               intersection of these elements.  */
999            continue;            continue;
1000          }          }
1001          
1002        for (j = 0; j < LBITSET_ELT_WORDS; j++)        for (j = 0; j < LBITSET_ELT_WORDS; j++)
1003          if (selt->words[j] & delt->words[j])          if (selt->words[j] & delt->words[j])
1004            return 0;            return 0;
# Line 1087  lbitset_disjoint_p (dst, src) Line 1008  lbitset_disjoint_p (dst, src)
1008    
1009    
1010  static int  static int
1011  lbitset_op3_cmp (dst, src1, src2, op)  lbitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
      bitset dst;  
      bitset src1;  
      bitset src2;  
      enum_bitset_ops op;  
1012  {  {
1013    lbitset_elt *selt1 = LBITSET_HEAD (src1);    lbitset_elt *selt1 = LBITSET_HEAD (src1);
1014    lbitset_elt *selt2 = LBITSET_HEAD (src2);    lbitset_elt *selt2 = LBITSET_HEAD (src2);
# Line 1248  lbitset_op3_cmp (dst, src1, src2, op) Line 1165  lbitset_op3_cmp (dst, src1, src2, op)
1165  }  }
1166    
1167    
 static void  
 lbitset_and (dst, src1, src2)  
      bitset dst;  
      bitset src1;  
      bitset src2;  
 {  
   lbitset_and_cmp (dst, src1, src2);  
 }  
   
   
1168  static int  static int
1169  lbitset_and_cmp (dst, src1, src2)  lbitset_and_cmp (bitset dst, bitset src1, bitset src2)
      bitset dst;  
      bitset src1;  
      bitset src2;  
1170  {  {
1171    lbitset_elt *selt1 = LBITSET_HEAD (src1);    lbitset_elt *selt1 = LBITSET_HEAD (src1);
1172    lbitset_elt *selt2 = LBITSET_HEAD (src2);    lbitset_elt *selt2 = LBITSET_HEAD (src2);
# Line 1287  lbitset_and_cmp (dst, src1, src2) Line 1191  lbitset_and_cmp (dst, src1, src2)
1191    
1192    
1193  static void  static void
1194  lbitset_andn (dst, src1, src2)  lbitset_and (bitset dst, bitset src1, bitset src2)
      bitset dst;  
      bitset src1;  
      bitset src2;  
1195  {  {
1196    lbitset_andn_cmp (dst, src1, src2);    lbitset_and_cmp (dst, src1, src2);
1197  }  }
1198    
1199    
1200  static int  static int
1201  lbitset_andn_cmp (dst, src1, src2)  lbitset_andn_cmp (bitset dst, bitset src1, bitset src2)
      bitset dst;  
      bitset src1;  
      bitset src2;  
1202  {  {
1203    lbitset_elt *selt1 = LBITSET_HEAD (src1);    lbitset_elt *selt1 = LBITSET_HEAD (src1);
1204    lbitset_elt *selt2 = LBITSET_HEAD (src2);    lbitset_elt *selt2 = LBITSET_HEAD (src2);
# Line 1322  lbitset_andn_cmp (dst, src1, src2) Line 1220  lbitset_andn_cmp (dst, src1, src2)
1220    
1221    
1222  static void  static void
1223  lbitset_or (dst, src1, src2)  lbitset_andn (bitset dst, bitset src1, bitset src2)
      bitset dst;  
      bitset src1;  
      bitset src2;  
1224  {  {
1225    lbitset_or_cmp (dst, src1, src2);    lbitset_andn_cmp (dst, src1, src2);
1226  }  }
1227    
1228    
1229  static int  static int
1230  lbitset_or_cmp (dst, src1, src2)  lbitset_or_cmp (bitset dst, bitset src1, bitset src2)
      bitset dst;  
      bitset src1;  
      bitset src2;  
1231  {  {
1232    lbitset_elt *selt1 = LBITSET_HEAD (src1);    lbitset_elt *selt1 = LBITSET_HEAD (src1);
1233    lbitset_elt *selt2 = LBITSET_HEAD (src2);    lbitset_elt *selt2 = LBITSET_HEAD (src2);
# Line 1353  lbitset_or_cmp (dst, src1, src2) Line 1245  lbitset_or_cmp (dst, src1, src2)
1245    
1246    
1247  static void  static void
1248  lbitset_xor (dst, src1, src2)  lbitset_or (bitset dst, bitset src1, bitset src2)
      bitset dst;  
      bitset src1;  
      bitset src2;  
1249  {  {
1250    lbitset_xor_cmp (dst, src1, src2);    lbitset_or_cmp (dst, src1, src2);
1251  }  }
1252    
1253    
1254  static int  static int
1255  lbitset_xor_cmp (dst, src1, src2)  lbitset_xor_cmp (bitset dst, bitset src1, bitset src2)
      bitset dst;  
      bitset src1;  
      bitset src2;  
1256  {  {
1257    lbitset_elt *selt1 = LBITSET_HEAD (src1);    lbitset_elt *selt1 = LBITSET_HEAD (src1);
1258    lbitset_elt *selt2 = LBITSET_HEAD (src2);    lbitset_elt *selt2 = LBITSET_HEAD (src2);
# Line 1383  lbitset_xor_cmp (dst, src1, src2) Line 1269  lbitset_xor_cmp (dst, src1, src2)
1269  }  }
1270    
1271    
1272    static void
1273    lbitset_xor (bitset dst, bitset src1, bitset src2)
1274    {
1275      lbitset_xor_cmp (dst, src1, src2);
1276    }
1277    
1278    
1279    
1280  /* Vector of operations for linked-list bitsets.  */  /* Vector of operations for linked-list bitsets.  */
1281  struct bitset_vtable lbitset_vtable = {  struct bitset_vtable lbitset_vtable = {
# Line 1423  struct bitset_vtable lbitset_vtable = { Line 1316  struct bitset_vtable lbitset_vtable = {
1316    
1317  /* Return size of initial structure.  */  /* Return size of initial structure.  */
1318  size_t  size_t
1319  lbitset_bytes (n_bits)  lbitset_bytes (bitset_bindex n_bits ATTRIBUTE_UNUSED)
      bitset_bindex n_bits ATTRIBUTE_UNUSED;  
1320  {  {
1321    return sizeof (struct lbitset_struct);    return sizeof (struct lbitset_struct);
1322  }  }
# Line 1432  lbitset_bytes (n_bits) Line 1324  lbitset_bytes (n_bits)
1324    
1325  /* Initialize a bitset.  */  /* Initialize a bitset.  */
1326  bitset  bitset
1327  lbitset_init (bset, n_bits)  lbitset_init (bitset bset, bitset_bindex n_bits ATTRIBUTE_UNUSED)
      bitset bset;  
      bitset_bindex n_bits ATTRIBUTE_UNUSED;  
1328  {  {
1329    bset->b.vtable = &lbitset_vtable;    bset->b.vtable = &lbitset_vtable;
1330    return bset;    return bset;
# Line 1442  lbitset_init (bset, n_bits) Line 1332  lbitset_init (bset, n_bits)
1332    
1333    
1334  void  void
1335  lbitset_release_memory ()  lbitset_release_memory (void)
1336  {  {
1337    lbitset_free_list = 0;    lbitset_free_list = 0;
1338    if (lbitset_obstack_init)    if (lbitset_obstack_init)
# Line 1455  lbitset_release_memory () Line 1345  lbitset_release_memory ()
1345    
1346  /* Function to be called from debugger to debug lbitset.  */  /* Function to be called from debugger to debug lbitset.  */
1347  void  void
1348  debug_lbitset (bset)  debug_lbitset (bitset bset)
      bitset bset;  
1349  {  {
1350    lbitset_elt *elt;    lbitset_elt *elt;
1351    unsigned int i;    unsigned int i;
1352    
1353    if (!bset)    if (!bset)
1354      return;      return;
1355      
1356    for (elt = LBITSET_HEAD (bset); elt; elt = elt->next)    for (elt = LBITSET_HEAD (bset); elt; elt = elt->next)
1357      {      {
1358        fprintf (stderr, "Elt %lu\n", (unsigned long) elt->index);        fprintf (stderr, "Elt %lu\n", (unsigned long) elt->index);
# Line 1471  debug_lbitset (bset) Line 1360  debug_lbitset (bset)
1360          {          {
1361            unsigned int j;            unsigned int j;
1362            bitset_word word;            bitset_word word;
1363              
1364            word = elt->words[i];            word = elt->words[i];
1365              
1366            fprintf (stderr, "  Word %u:", i);            fprintf (stderr, "  Word %u:", i);
1367            for (j = 0; j < LBITSET_WORD_BITS; j++)            for (j = 0; j < LBITSET_WORD_BITS; j++)
1368              if ((word & ((bitset_word) 1 << j)))              if ((word & ((bitset_word) 1 << j)))

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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