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

Diff of /bison/lib/bitset.c

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

revision 1.6 by eggert, Wed Oct 2 07:45:37 2002 UTC revision 1.7 by eggert, Thu Oct 10 07:18:47 2002 UTC
# Line 31  Line 31 
31  const char * const bitset_type_names[] = BITSET_TYPE_NAMES;  const char * const bitset_type_names[] = BITSET_TYPE_NAMES;
32    
33  static void bitset_print PARAMS ((FILE *, bitset, int));  static void bitset_print PARAMS ((FILE *, bitset, int));
34    static int bitset_op4_cmp PARAMS ((bitset, bitset, bitset, bitset, int));
35    
36    
37  /* Return number of bytes required to create a N_BIT bitset  /* Return number of bytes required to create a N_BIT bitset
38     of TYPE.  The bitset may grow to require more bytes than this.  */     of TYPE.  The bitset may grow to require more bytes than this.  */
39  size_t  size_t
40  bitset_bytes (type, n_bits)  bitset_bytes (type, n_bits)
41       enum bitset_type type;       enum_bitset_type type;
42       bitset_bindex n_bits;       bitset_bindex n_bits;
43  {  {
44    size_t bytes;    size_t bytes;
# Line 72  bitset Line 73  bitset
73  bitset_init (bset, n_bits, type)  bitset_init (bset, n_bits, type)
74       bitset bset;       bitset bset;
75       bitset_bindex n_bits;       bitset_bindex n_bits;
76       enum bitset_type type;       enum_bitset_type type;
77  {  {
78    if (bitset_stats_enabled)    if (bitset_stats_enabled)
79      return bitset_stats_init (bset, n_bits, type);      return bitset_stats_init (bset, n_bits, type);
# Line 130  bitset_type_choose (n_bits, attr) Line 131  bitset_type_choose (n_bits, attr)
131  bitset  bitset
132  bitset_alloc (n_bits, type)  bitset_alloc (n_bits, type)
133       bitset_bindex n_bits;       bitset_bindex n_bits;
134       enum bitset_type type;       enum_bitset_type type;
135  {  {
136    size_t bytes;    size_t bytes;
137    bitset bset;    bitset bset;
# Line 152  bitset Line 153  bitset
153  bitset_obstack_alloc (bobstack, n_bits, type)  bitset_obstack_alloc (bobstack, n_bits, type)
154       struct obstack *bobstack;       struct obstack *bobstack;
155       bitset_bindex n_bits;       bitset_bindex n_bits;
156       enum bitset_type type;       enum_bitset_type type;
157  {  {
158    size_t bytes;    size_t bytes;
159    bitset bset;    bitset bset;
# Line 422  bitset_op4_cmp (dst, src1, src2, src3, o Line 423  bitset_op4_cmp (dst, src1, src2, src3, o
423       bitset src1;       bitset src1;
424       bitset src2;       bitset src2;
425       bitset src3;       bitset src3;
426       enum bitset_ops op;       enum_bitset_ops op;
427  {  {
428    int changed = 0;    int changed = 0;
429    int stats_enabled_save;    int stats_enabled_save;
# Line 460  bitset_op4_cmp (dst, src1, src2, src3, o Line 461  bitset_op4_cmp (dst, src1, src2, src3, o
461  }  }
462    
463    
464    /* DST = (SRC1 & SRC2) | SRC3.  */
465    void
466    bitset_and_or_ (dst, src1, src2, src3)
467         bitset dst;
468         bitset src1;
469         bitset src2;
470         bitset src3;
471    {
472      bitset_and_or_cmp_ (dst, src1, src2, src3);
473    }
474    
475    
476  /* DST = (SRC1 & SRC2) | SRC3.  Return non-zero if  /* DST = (SRC1 & SRC2) | SRC3.  Return non-zero if
477     DST != (SRC1 & SRC2) | SRC3.  */     DST != (SRC1 & SRC2) | SRC3.  */
478  int  int
# Line 473  bitset_and_or_cmp_ (dst, src1, src2, src Line 486  bitset_and_or_cmp_ (dst, src1, src2, src
486  }  }
487    
488    
489    /* DST = (SRC1 & ~SRC2) | SRC3.  */
490    void
491    bitset_andn_or_ (dst, src1, src2, src3)
492         bitset dst;
493         bitset src1;
494         bitset src2;
495         bitset src3;
496    {
497      bitset_andn_or_cmp_ (dst, src1, src2, src3);
498    }
499    
500    
501  /* DST = (SRC1 & ~SRC2) | SRC3.  Return non-zero if  /* DST = (SRC1 & ~SRC2) | SRC3.  Return non-zero if
502     DST != (SRC1 & ~SRC2) | SRC3.  */     DST != (SRC1 & ~SRC2) | SRC3.  */
503  int  int
# Line 486  bitset_andn_or_cmp_ (dst, src1, src2, sr Line 511  bitset_andn_or_cmp_ (dst, src1, src2, sr
511  }  }
512    
513    
514    /* DST = (SRC1 | SRC2) & SRC3.  */
515    void
516    bitset_or_and_ (dst, src1, src2, src3)
517         bitset dst;
518         bitset src1;
519         bitset src2;
520         bitset src3;
521    {
522      bitset_or_and_cmp_ (dst, src1, src2, src3);
523    }
524    
525    
526  /* DST = (SRC1 | SRC2) & SRC3.  Return non-zero if  /* DST = (SRC1 | SRC2) & SRC3.  Return non-zero if
527     DST != (SRC1 | SRC2) & SRC3.  */     DST != (SRC1 | SRC2) & SRC3.  */
528  int  int

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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