summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoel E. Denny <joeldenny@joeldenny.org>2011-07-24 17:50:37 -0400
committerJoel E. Denny <joeldenny@joeldenny.org>2011-07-24 18:13:05 -0400
commite9690142325711b320ef444768fdd40a087d02f7 (patch)
tree28c5cb5ed1b642dcae974e6ab3f927ab2157932a /lib
parentc12aa01f82a03db044985513a878497e5ab58377 (diff)
downloadbison-e9690142325711b320ef444768fdd40a087d02f7.tar.gz
global: remove unnecessary horizontal tabs.
This change was made by applying emacs' untabify function to nearly all files in Bison's repository. Required tabs in make files, ChangeLog, regexps, and test code were manually skipped. Other notable exceptions and changes are listed below. * bootstrap: Skip because we sync this with gnulib. * data/m4sugar/foreach.m4 * data/m4sugar/m4sugar.m4: Skip because we sync these with Autoconf. * djgpp: Skip because I don't know how to test djgpp properly, and this code appears to be unmaintained anyway. * README-hacking (Hacking): Specify that tabs should be avoided where not required.
Diffstat (limited to 'lib')
-rw-r--r--lib/abitset.c232
-rw-r--r--lib/bbitset.h28
-rw-r--r--lib/bitset.c10
-rw-r--r--lib/bitset.h58
-rw-r--r--lib/bitset_stats.c100
-rw-r--r--lib/bitsetv-print.c2
-rw-r--r--lib/bitsetv.c6
-rw-r--r--lib/ebitset.c654
-rw-r--r--lib/lbitset.c754
-rw-r--r--lib/timevar.c40
-rw-r--r--lib/vbitset.c312
11 files changed, 1098 insertions, 1098 deletions
diff --git a/lib/abitset.c b/lib/abitset.c
index a4a2fa8e..5f19d0a0 100644
--- a/lib/abitset.c
+++ b/lib/abitset.c
@@ -47,7 +47,7 @@ abitset_resize (bitset src, bitset_bindex size)
found and with *NEXT indicating where search stopped. */
static bitset_bindex
abitset_small_list (bitset src, bitset_bindex *list,
- bitset_bindex num, bitset_bindex *next)
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_bindex count;
@@ -73,27 +73,27 @@ abitset_small_list (bitset src, bitset_bindex *list,
if (num >= BITSET_WORD_BITS)
{
for (count = 0; word; bitno++)
- {
- if (word & 1)
- list[count++] = bitno;
- word >>= 1;
- }
+ {
+ if (word & 1)
+ list[count++] = bitno;
+ word >>= 1;
+ }
}
else
{
for (count = 0; word; bitno++)
- {
- if (word & 1)
- {
- list[count++] = bitno;
- if (count >= num)
- {
- bitno++;
- break;
- }
- }
- word >>= 1;
- }
+ {
+ if (word & 1)
+ {
+ list[count++] = bitno;
+ if (count >= num)
+ {
+ bitno++;
+ break;
+ }
+ }
+ word >>= 1;
+ }
}
*next = bitno;
@@ -115,7 +115,7 @@ abitset_set (bitset dst ATTRIBUTE_UNUSED, bitset_bindex bitno ATTRIBUTE_UNUSED)
/* Reset bit BITNO in bitset DST. */
static void
abitset_reset (bitset dst ATTRIBUTE_UNUSED,
- bitset_bindex bitno ATTRIBUTE_UNUSED)
+ bitset_bindex bitno ATTRIBUTE_UNUSED)
{
/* This should never occur for abitsets since we should always hit
the cache. It is likely someone is trying to access outside the
@@ -126,7 +126,7 @@ abitset_reset (bitset dst ATTRIBUTE_UNUSED,
/* Test bit BITNO in bitset SRC. */
static bool
abitset_test (bitset src ATTRIBUTE_UNUSED,
- bitset_bindex bitno ATTRIBUTE_UNUSED)
+ bitset_bindex bitno ATTRIBUTE_UNUSED)
{
/* This should never occur for abitsets since we should always
hit the cache. */
@@ -140,7 +140,7 @@ abitset_test (bitset src ATTRIBUTE_UNUSED,
stopped. */
static bitset_bindex
abitset_list_reverse (bitset src, bitset_bindex *list,
- bitset_bindex num, bitset_bindex *next)
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_bindex rbitno;
@@ -173,18 +173,18 @@ abitset_list_reverse (bitset src, bitset_bindex *list,
word = srcp[windex] << (BITSET_WORD_BITS - 1 - bitcnt);
for (; word; bitcnt--)
- {
- if (word & BITSET_MSB)
- {
- list[count++] = bitoff + bitcnt;
- if (count >= num)
- {
- *next = n_bits - (bitoff + bitcnt);
- return count;
- }
- }
- word <<= 1;
- }
+ {
+ if (word & BITSET_MSB)
+ {
+ list[count++] = bitoff + bitcnt;
+ if (count >= num)
+ {
+ *next = n_bits - (bitoff + bitcnt);
+ return count;
+ }
+ }
+ word <<= 1;
+ }
bitoff -= BITSET_WORD_BITS;
bitcnt = BITSET_WORD_BITS - 1;
}
@@ -200,7 +200,7 @@ abitset_list_reverse (bitset src, bitset_bindex *list,
found and with *NEXT indicating where search stopped. */
static bitset_bindex
abitset_list (bitset src, bitset_bindex *list,
- bitset_bindex num, bitset_bindex *next)
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_bindex count;
@@ -217,80 +217,80 @@ abitset_list (bitset src, bitset_bindex *list,
{
/* Many bitsets are zero, so make this common case fast. */
for (windex = 0; windex < size && !srcp[windex]; windex++)
- continue;
+ continue;
if (windex >= size)
- return 0;
+ return 0;
/* If num is 1, we could speed things up with a binary search
- of the current word. */
+ of the current word. */
bitoff = windex * BITSET_WORD_BITS;
}
else
{
if (bitno >= BITSET_SIZE_ (src))
- return 0;
+ return 0;
windex = bitno / BITSET_WORD_BITS;
bitno = bitno % BITSET_WORD_BITS;
if (bitno)
- {
- /* Handle the case where we start within a word.
- Most often, this is executed with large bitsets
- with many set bits where we filled the array
- on the previous call to this function. */
-
- bitoff = windex * BITSET_WORD_BITS;
- word = srcp[windex] >> bitno;
- for (bitno = bitoff + bitno; word; bitno++)
- {
- if (word & 1)
- {
- list[count++] = bitno;
- if (count >= num)
- {
- *next = bitno + 1;
- return count;
- }
- }
- word >>= 1;
- }
- windex++;
- }
+ {
+ /* Handle the case where we start within a word.
+ Most often, this is executed with large bitsets
+ with many set bits where we filled the array
+ on the previous call to this function. */
+
+ bitoff = windex * BITSET_WORD_BITS;
+ word = srcp[windex] >> bitno;
+ for (bitno = bitoff + bitno; word; bitno++)
+ {
+ if (word & 1)
+ {
+ list[count++] = bitno;
+ if (count >= num)
+ {
+ *next = bitno + 1;
+ return count;
+ }
+ }
+ word >>= 1;
+ }
+ windex++;
+ }
bitoff = windex * BITSET_WORD_BITS;
}
for (; windex < size; windex++, bitoff += BITSET_WORD_BITS)
{
if (!(word = srcp[windex]))
- continue;
+ continue;
if ((count + BITSET_WORD_BITS) < num)
- {
- for (bitno = bitoff; word; bitno++)
- {
- if (word & 1)
- list[count++] = bitno;
- word >>= 1;
- }
- }
+ {
+ for (bitno = bitoff; word; bitno++)
+ {
+ if (word & 1)
+ list[count++] = bitno;
+ word >>= 1;
+ }
+ }
else
- {
- for (bitno = bitoff; word; bitno++)
- {
- if (word & 1)
- {
- list[count++] = bitno;
- if (count >= num)
- {
- *next = bitno + 1;
- return count;
- }
- }
- word >>= 1;
- }
- }
+ {
+ for (bitno = bitoff; word; bitno++)
+ {
+ if (word & 1)
+ {
+ list[count++] = bitno;
+ if (count >= num)
+ {
+ *next = bitno + 1;
+ return count;
+ }
+ }
+ word >>= 1;
+ }
+ }
}
*next = bitoff;
@@ -387,7 +387,7 @@ abitset_equal_p (bitset dst, bitset src)
for (i = 0; i < size; i++)
if (*srcp++ != *dstp++)
- return false;
+ return false;
return true;
}
@@ -402,7 +402,7 @@ abitset_subset_p (bitset dst, bitset src)
for (i = 0; i < size; i++, dstp++, srcp++)
if (*dstp != (*srcp | *dstp))
- return false;
+ return false;
return true;
}
@@ -417,7 +417,7 @@ abitset_disjoint_p (bitset dst, bitset src)
for (i = 0; i < size; i++)
if (*srcp++ & *dstp++)
- return false;
+ return false;
return true;
}
@@ -452,10 +452,10 @@ abitset_and_cmp (bitset dst, bitset src1, bitset src2)
bitset_word tmp = *src1p++ & *src2p++;
if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
+ {
+ changed = true;
+ *dstp = tmp;
+ }
}
return changed;
}
@@ -490,10 +490,10 @@ abitset_andn_cmp (bitset dst, bitset src1, bitset src2)
bitset_word tmp = *src1p++ & ~(*src2p++);
if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
+ {
+ changed = true;
+ *dstp = tmp;
+ }
}
return changed;
}
@@ -528,10 +528,10 @@ abitset_or_cmp (bitset dst, bitset src1, bitset src2)
bitset_word tmp = *src1p++ | *src2p++;
if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
+ {
+ changed = true;
+ *dstp = tmp;
+ }
}
return changed;
}
@@ -566,10 +566,10 @@ abitset_xor_cmp (bitset dst, bitset src1, bitset src2)
bitset_word tmp = *src1p++ ^ *src2p++;
if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
+ {
+ changed = true;
+ *dstp = tmp;
+ }
}
return changed;
}
@@ -606,10 +606,10 @@ abitset_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
bitset_word tmp = (*src1p++ & *src2p++) | *src3p++;
if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
+ {
+ changed = true;
+ *dstp = tmp;
+ }
}
return changed;
}
@@ -646,10 +646,10 @@ abitset_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
bitset_word tmp = (*src1p++ & ~(*src2p++)) | *src3p++;
if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
+ {
+ changed = true;
+ *dstp = tmp;
+ }
}
return changed;
}
@@ -686,10 +686,10 @@ abitset_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
bitset_word tmp = (*src1p++ | *src2p++) & *src3p++;
if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
+ {
+ changed = true;
+ *dstp = tmp;
+ }
}
return changed;
}
diff --git a/lib/bbitset.h b/lib/bbitset.h
index 3389c911..54167dd4 100644
--- a/lib/bbitset.h
+++ b/lib/bbitset.h
@@ -32,9 +32,9 @@
Memory for bit array and bitset structure allocated
contiguously.
BITSET_LIST: Linked list of arrays of bits (variable size, least storage
- for large very sparse sets).
+ for large very sparse sets).
BITSET_TABLE: Expandable table of pointers to arrays of bits
- (variable size, less storage for large sparse sets).
+ (variable size, less storage for large sparse sets).
Faster than BITSET_LIST for random access.
BITSET_VARRAY: Variable array of bits (variable size, fast for
dense bitsets).
@@ -42,7 +42,7 @@
statistics and/or better run-time checking.
*/
enum bitset_type {BITSET_ARRAY, BITSET_LIST, BITSET_TABLE, BITSET_VARRAY,
- BITSET_TYPE_NUM, BITSET_STATS};
+ BITSET_TYPE_NUM, BITSET_STATS};
#define BITSET_TYPE_NAMES {"abitset", "lbitset", "ebitset", "vbitset"}
extern const char * const bitset_type_names[];
@@ -78,19 +78,19 @@ typedef size_t bitset_windex;
#define BITSET_LIST_SIZE 1024
enum bitset_ops {BITSET_OP_ZERO, BITSET_OP_ONES,
- BITSET_OP_COPY, BITSET_OP_NOT,
- BITSET_OP_EMPTY_P, BITSET_OP_EQUAL_P,
- BITSET_OP_SUBSET_P, BITSET_OP_DISJOINT_P,
- BITSET_OP_AND, BITSET_OP_OR, BITSET_OP_XOR, BITSET_OP_ANDN,
- BITSET_OP_OR_AND, BITSET_OP_AND_OR, BITSET_OP_ANDN_OR};
+ BITSET_OP_COPY, BITSET_OP_NOT,
+ BITSET_OP_EMPTY_P, BITSET_OP_EQUAL_P,
+ BITSET_OP_SUBSET_P, BITSET_OP_DISJOINT_P,
+ BITSET_OP_AND, BITSET_OP_OR, BITSET_OP_XOR, BITSET_OP_ANDN,
+ BITSET_OP_OR_AND, BITSET_OP_AND_OR, BITSET_OP_ANDN_OR};
struct bbitset_struct
{
const struct bitset_vtable *vtable;
- bitset_windex cindex; /* Cache word index. */
- bitset_windex csize; /* Cache size in words. */
- bitset_word *cdata; /* Cache data pointer. */
- bitset_bindex n_bits; /* Number of bits. */
+ bitset_windex cindex; /* Cache word index. */
+ bitset_windex csize; /* Cache size in words. */
+ bitset_word *cdata; /* Cache data pointer. */
+ bitset_bindex n_bits; /* Number of bits. */
/* Perhaps we could sacrifice another word to indicate
that the bitset is known to be zero, that a bit has been set
in the cache, and that a bit has been cleared in the cache.
@@ -148,9 +148,9 @@ struct bitset_vtable
bool (*or_and_cmp) (bitset, bitset, bitset, bitset);
bitset_bindex (*list) (bitset, bitset_bindex *, bitset_bindex,
- bitset_bindex *);
+ bitset_bindex *);
bitset_bindex (*list_reverse) (bitset, bitset_bindex *, bitset_bindex,
- bitset_bindex *);
+ bitset_bindex *);
void (*free) (bitset);
enum bitset_type type;
};
diff --git a/lib/bitset.c b/lib/bitset.c
index 222e3ee7..6f7825a0 100644
--- a/lib/bitset.c
+++ b/lib/bitset.c
@@ -151,7 +151,7 @@ bitset_alloc (bitset_bindex n_bits, enum bitset_type type)
/* Create a bitset of N_BITS of type TYPE. */
bitset
bitset_obstack_alloc (struct obstack *bobstack,
- bitset_bindex n_bits, enum bitset_type type)
+ bitset_bindex n_bits, enum bitset_type type)
{
size_t bytes;
bitset bset;
@@ -296,15 +296,15 @@ bitset_print (FILE *file, bitset bset, bool verbose)
if (verbose)
fprintf (file, "n_bits = %lu, set = {",
- (unsigned long int) bitset_size (bset));
+ (unsigned long int) bitset_size (bset));
pos = 30;
BITSET_FOR_EACH (iter, bset, i, 0)
{
if (pos > 70)
{
- fprintf (file, "\n");
- pos = 0;
+ fprintf (file, "\n");
+ pos = 0;
}
fprintf (file, "%lu ", (unsigned long int) i);
@@ -407,7 +407,7 @@ bitset_copy_ (bitset dst, bitset src)
four operand operations. */
static inline bool
bitset_op4_cmp (bitset dst, bitset src1, bitset src2, bitset src3,
- enum bitset_ops op)
+ enum bitset_ops op)
{
bool changed = false;
bool stats_enabled_save;
diff --git a/lib/bitset.h b/lib/bitset.h
index 98979bb3..fde9adda 100644
--- a/lib/bitset.h
+++ b/lib/bitset.h
@@ -33,11 +33,11 @@
/* Attributes used to select a bitset implementation. */
enum bitset_attr {BITSET_FIXED = 1, /* Bitset size fixed. */
- BITSET_VARIABLE = 2, /* Bitset size variable. */
- BITSET_DENSE = 4, /* Bitset dense. */
- BITSET_SPARSE = 8, /* Bitset sparse. */
- BITSET_FRUGAL = 16, /* Prefer most compact. */
- BITSET_GREEDY = 32}; /* Prefer fastest at memory expense. */
+ BITSET_VARIABLE = 2, /* Bitset size variable. */
+ BITSET_DENSE = 4, /* Bitset dense. */
+ BITSET_SPARSE = 8, /* Bitset sparse. */
+ BITSET_FRUGAL = 16, /* Prefer most compact. */
+ BITSET_GREEDY = 32}; /* Prefer fastest at memory expense. */
typedef unsigned int bitset_attrs;
@@ -49,26 +49,26 @@ union bitset_union
{
/* This must be the first member of every other structure that is a
member of this union. */
- struct bbitset_struct b; /* Base bitset data. */
+ struct bbitset_struct b; /* Base bitset data. */
struct abitset_struct
{
struct bbitset_struct b;
- bitset_word words[1]; /* The array of bits. */
+ bitset_word words[1]; /* The array of bits. */
} a;
struct ebitset_struct
{
struct bbitset_struct b;
- bitset_windex size; /* Number of elements. */
- struct ebitset_elt_struct **elts; /* Expanding array of ptrs to elts. */
+ bitset_windex size; /* Number of elements. */
+ struct ebitset_elt_struct **elts; /* Expanding array of ptrs to elts. */
} e;
struct lbitset_struct
{
struct bbitset_struct b;
- struct lbitset_elt_struct *head; /* First element in linked list. */
- struct lbitset_elt_struct *tail; /* Last element in linked list. */
+ struct lbitset_elt_struct *head; /* First element in linked list. */
+ struct lbitset_elt_struct *tail; /* Last element in linked list. */
} l;
struct bitset_stats_struct
@@ -80,7 +80,7 @@ union bitset_union
struct vbitset_struct
{
struct bbitset_struct b;
- bitset_windex size; /* Allocated size of array. */
+ bitset_windex size; /* Allocated size of array. */
} v;
};
@@ -116,7 +116,7 @@ extern void bitset_free (bitset);
/* Create a bitset of desired type and size using an obstack. The
bitset is zeroed. */
extern bitset bitset_obstack_alloc (struct obstack *bobstack,
- bitset_bindex, enum bitset_type);
+ bitset_bindex, enum bitset_type);
/* Free bitset allocated on obstack. */
extern void bitset_obstack_free (bitset);
@@ -312,14 +312,14 @@ extern void bitset_dump (FILE *, bitset);
printf ("%lu ", (unsigned long int) i);
};
*/
-#define BITSET_FOR_EACH(ITER, BSET, INDEX, MIN) \
- for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE; \
- (ITER.num == BITSET_LIST_SIZE) \
- && (ITER.num = bitset_list (BSET, ITER.list, \
- BITSET_LIST_SIZE, &ITER.next));) \
- for (ITER.i = 0; \
- ITER.i < ITER.num && ((INDEX) = ITER.list[ITER.i], 1); \
- ITER.i++)
+#define BITSET_FOR_EACH(ITER, BSET, INDEX, MIN) \
+ for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE; \
+ (ITER.num == BITSET_LIST_SIZE) \
+ && (ITER.num = bitset_list (BSET, ITER.list, \
+ BITSET_LIST_SIZE, &ITER.next));) \
+ for (ITER.i = 0; \
+ ITER.i < ITER.num && ((INDEX) = ITER.list[ITER.i], 1); \
+ ITER.i++)
/* Loop over all elements of BSET, in reverse order starting with
@@ -334,14 +334,14 @@ extern void bitset_dump (FILE *, bitset);
printf ("%lu ", (unsigned long int) i);
};
*/
-#define BITSET_FOR_EACH_REVERSE(ITER, BSET, INDEX, MIN) \
- for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE; \
- (ITER.num == BITSET_LIST_SIZE) \
- && (ITER.num = bitset_list_reverse (BSET, ITER.list, \
- BITSET_LIST_SIZE, &ITER.next));) \
- for (ITER.i = 0; \
- ITER.i < ITER.num && ((INDEX) = ITER.list[ITER.i], 1); \
- ITER.i++)
+#define BITSET_FOR_EACH_REVERSE(ITER, BSET, INDEX, MIN) \
+ for (ITER.next = (MIN), ITER.num = BITSET_LIST_SIZE; \
+ (ITER.num == BITSET_LIST_SIZE) \
+ && (ITER.num = bitset_list_reverse (BSET, ITER.list, \
+ BITSET_LIST_SIZE, &ITER.next));) \
+ for (ITER.i = 0; \
+ ITER.i < ITER.num && ((INDEX) = ITER.list[ITER.i], 1); \
+ ITER.i++)
/* Define set operations in terms of logical operations. */
diff --git a/lib/bitset_stats.c b/lib/bitset_stats.c
index 2eb77ff8..216bfd92 100644
--- a/lib/bitset_stats.c
+++ b/lib/bitset_stats.c
@@ -48,29 +48,29 @@
/* Accessor macros. */
-#define BITSET_STATS_ALLOCS_INC(TYPE) \
+#define BITSET_STATS_ALLOCS_INC(TYPE) \
bitset_stats_info->types[(TYPE)].allocs++
-#define BITSET_STATS_FREES_INC(BSET) \
+#define BITSET_STATS_FREES_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].frees++
-#define BITSET_STATS_SETS_INC(BSET) \
+#define BITSET_STATS_SETS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].sets++
-#define BITSET_STATS_CACHE_SETS_INC(BSET) \
+#define BITSET_STATS_CACHE_SETS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_sets++
-#define BITSET_STATS_RESETS_INC(BSET) \
+#define BITSET_STATS_RESETS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].resets++
-#define BITSET_STATS_CACHE_RESETS_INC(BSET) \
+#define BITSET_STATS_CACHE_RESETS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_resets++
-#define BITSET_STATS_TESTS_INC(BSET) \
+#define BITSET_STATS_TESTS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].tests++
-#define BITSET_STATS_CACHE_TESTS_INC(BSET) \
+#define BITSET_STATS_CACHE_TESTS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].cache_tests++
-#define BITSET_STATS_LISTS_INC(BSET) \
+#define BITSET_STATS_LISTS_INC(BSET) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].lists++
-#define BITSET_STATS_LIST_COUNTS_INC(BSET, I) \
+#define BITSET_STATS_LIST_COUNTS_INC(BSET, I) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_counts[(I)]++
-#define BITSET_STATS_LIST_SIZES_INC(BSET, I) \
+#define BITSET_STATS_LIST_SIZES_INC(BSET, I) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_sizes[(I)]++
-#define BITSET_STATS_LIST_DENSITY_INC(BSET, I) \
+#define BITSET_STATS_LIST_DENSITY_INC(BSET, I) \
bitset_stats_info->types[BITSET_TYPE_ (BSET)].list_density[(I)]++
@@ -105,7 +105,7 @@ bool bitset_stats_enabled = false;
/* Print a percentage histogram with message MSG to FILE. */
static void
bitset_percent_histogram_print (FILE *file, const char *name, const char *msg,
- unsigned int n_bins, unsigned int *bins)
+ unsigned int n_bins, unsigned int *bins)
{
unsigned int i;
unsigned int total;
@@ -120,16 +120,16 @@ bitset_percent_histogram_print (FILE *file, const char *name, const char *msg,
fprintf (file, "%s %s", name, msg);
for (i = 0; i < n_bins; i++)
fprintf (file, "%.0f-%.0f%%\t%8u (%5.1f%%)\n",
- i * 100.0 / n_bins,
- (i + 1) * 100.0 / n_bins, bins[i],
- (100.0 * bins[i]) / total);
+ i * 100.0 / n_bins,
+ (i + 1) * 100.0 / n_bins, bins[i],
+ (100.0 * bins[i]) / total);
}
/* Print a log histogram with message MSG to FILE. */
static void
bitset_log_histogram_print (FILE *file, const char *name, const char *msg,
- unsigned int n_bins, unsigned int *bins)
+ unsigned int n_bins, unsigned int *bins)
{
unsigned int i;
unsigned int total;
@@ -153,50 +153,50 @@ bitset_log_histogram_print (FILE *file, const char *name, const char *msg,
fprintf (file, "%s %s", name, msg);
for (i = 0; i < 2; i++)
fprintf (file, "%*d\t%8u (%5.1f%%)\n",
- max_width, i, bins[i], 100.0 * bins[i] / total);
+ max_width, i, bins[i], 100.0 * bins[i] / total);
for (; i < n_bins; i++)
fprintf (file, "%*lu-%lu\t%8u (%5.1f%%)\n",
- max_width - ((unsigned int) (0.30103 * (i) + 0.9999) + 1),
- 1UL << (i - 1),
- (1UL << i) - 1,
- bins[i],
- (100.0 * bins[i]) / total);
+ max_width - ((unsigned int) (0.30103 * (i) + 0.9999) + 1),
+ 1UL << (i - 1),
+ (1UL << i) - 1,
+ bins[i],
+ (100.0 * bins[i]) / total);
}
/* Print bitset statistics to FILE. */
static void
bitset_stats_print_1 (FILE *file, const char *name,
- struct bitset_type_info_struct *stats)
+ struct bitset_type_info_struct *stats)
{
if (!stats)
return;
fprintf (file, "%s:\n", name);
fprintf (file, _("%u bitset_allocs, %u freed (%.2f%%).\n"),
- stats->allocs, stats->frees,
- stats->allocs ? 100.0 * stats->frees / stats->allocs : 0);
+ stats->allocs, stats->frees,
+ stats->allocs ? 100.0 * stats->frees / stats->allocs : 0);
fprintf (file, _("%u bitset_sets, %u cached (%.2f%%)\n"),
- stats->sets, stats->cache_sets,
- stats->sets ? 100.0 * stats->cache_sets / stats->sets : 0);
+ stats->sets, stats->cache_sets,
+ stats->sets ? 100.0 * stats->cache_sets / stats->sets : 0);
fprintf (file, _("%u bitset_resets, %u cached (%.2f%%)\n"),
- stats->resets, stats->cache_resets,
- stats->resets ? 100.0 * stats->cache_resets / stats->resets : 0);
+ stats->resets, stats->cache_resets,
+ stats->resets ? 100.0 * stats->cache_resets / stats->resets : 0);
fprintf (file, _("%u bitset_tests, %u cached (%.2f%%)\n"),
- stats->tests, stats->cache_tests,
- stats->tests ? 100.0 * stats->cache_tests / stats->tests : 0);
+ stats->tests, stats->cache_tests,
+ stats->tests ? 100.0 * stats->cache_tests / stats->tests : 0);
fprintf (file, _("%u bitset_lists\n"), stats->lists);
bitset_log_histogram_print (file, name, _("count log histogram\n"),
- BITSET_LOG_COUNT_BINS, stats->list_counts);
+ BITSET_LOG_COUNT_BINS, stats->list_counts);
bitset_log_histogram_print (file, name, _("size log histogram\n"),
- BITSET_LOG_SIZE_BINS, stats->list_sizes);
+ BITSET_LOG_SIZE_BINS, stats->list_sizes);
bitset_percent_histogram_print (file, name, _("density histogram\n"),
- BITSET_DENSITY_BINS, stats->list_density);
+ BITSET_DENSITY_BINS, stats->list_density);
}
@@ -216,7 +216,7 @@ bitset_stats_print (FILE *file, bool verbose ATTRIBUTE_UNUSED)
for (i = 0; i < BITSET_TYPE_NUM; i++)
bitset_stats_print_1 (file, bitset_type_names[i],
- &bitset_stats_info->types[i]);
+ &bitset_stats_info->types[i]);
}
@@ -253,15 +253,15 @@ bitset_stats_read (const char *file_name)
if (file)
{
if (fread (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
- 1, file) != 1)
- {
- if (ferror (file))
- perror (_("Could not read stats file."));
- else
- fprintf (stderr, _("Bad stats file size.\n"));
- }
+ 1, file) != 1)
+ {
+ if (ferror (file))
+ perror (_("Could not read stats file."));
+ else
+ fprintf (stderr, _("Bad stats file size.\n"));
+ }
if (fclose (file) != 0)
- perror (_("Could not read stats file."));
+ perror (_("Could not read stats file."));
}
bitset_stats_info_data.runs++;
}
@@ -283,10 +283,10 @@ bitset_stats_write (const char *file_name)
if (file)
{
if (fwrite (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
- 1, file) != 1)
- perror (_("Could not write stats file."));
+ 1, file) != 1)
+ perror (_("Could not write stats file."));
if (fclose (file) != 0)
- perror (_("Could not write stats file."));
+ perror (_("Could not write stats file."));
}
else
perror (_("Could not open stats file for writing."));
@@ -340,7 +340,7 @@ bitset_stats_reset (bitset dst, bitset_bindex bitno)
if (offset < bset->b.csize)
{
bset->b.cdata[offset] &=
- ~((bitset_word) 1 << (bitno % BITSET_WORD_BITS));
+ ~((bitset_word) 1 << (bitno % BITSET_WORD_BITS));
BITSET_STATS_CACHE_RESETS_INC (bset);
}
else
@@ -570,7 +570,7 @@ bitset_stats_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
static bitset_bindex
bitset_stats_list (bitset bset, bitset_bindex *list,
- bitset_bindex num, bitset_bindex *next)
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex count;
bitset_bindex tmp;
@@ -609,7 +609,7 @@ bitset_stats_list (bitset bset, bitset_bindex *list,
static bitset_bindex
bitset_stats_list_reverse (bitset bset, bitset_bindex *list,
- bitset_bindex num, bitset_bindex *next)
+ bitset_bindex num, bitset_bindex *next)
{
return BITSET_LIST_REVERSE_ (bset->s.bset, list, num, next);
}
diff --git a/lib/bitsetv-print.c b/lib/bitsetv-print.c
index e797556b..6ca1d09a 100644
--- a/lib/bitsetv-print.c
+++ b/lib/bitsetv-print.c
@@ -56,7 +56,7 @@ bitsetv_matrix_dump (FILE * out, const char *title, bitsetv bset)
{
fprintf (out, "%2lu|", (unsigned long int) i);
for (j = 0; j < hsize; ++j)
- fputs (bitset_test (bset[i], j) ? "1" : " ", out);
+ fputs (bitset_test (bset[i], j) ? "1" : " ", out);
fputs ("|\n", out);
}
diff --git a/lib/bitsetv.c b/lib/bitsetv.c
index 3495ab2d..25b77ddb 100644
--- a/lib/bitsetv.c
+++ b/lib/bitsetv.c
@@ -27,7 +27,7 @@
type TYPE. */
bitset *
bitsetv_alloc (bitset_bindex n_vecs, bitset_bindex n_bits,
- enum bitset_type type)
+ enum bitset_type type)
{
size_t vector_bytes;
size_t bytes;
@@ -116,7 +116,7 @@ bitsetv_transitive_closure (bitsetv bsetv)
for (i = 0; bsetv[i]; i++)
for (j = 0; bsetv[j]; j++)
if (bitset_test (bsetv[j], i))
- bitset_or (bsetv[j], bsetv[j], bsetv[i]);
+ bitset_or (bsetv[j], bsetv[j], bsetv[i]);
}
@@ -139,7 +139,7 @@ bitsetv_reflexive_transitive_closure (bitsetv bsetv)
FILE. */
void
bitsetv_dump (FILE *file, char const *title, char const *subtitle,
- bitsetv bsetv)
+ bitsetv bsetv)
{
bitset_windex i;
diff --git a/lib/ebitset.c b/lib/ebitset.c
index 2f6960d9..390dd0aa 100644
--- a/lib/ebitset.c
+++ b/lib/ebitset.c
@@ -58,7 +58,7 @@ typedef struct ebitset_elt_struct
{
union
{
- bitset_word words[EBITSET_ELT_WORDS]; /* Bits that are set. */
+ bitset_word words[EBITSET_ELT_WORDS]; /* Bits that are set. */
struct ebitset_elt_struct *next;
}
u;
@@ -84,7 +84,7 @@ static ebitset_elt ebitset_zero_elts[1]; /* Elements of all zero bits. */
/* Obstack to allocate bitset elements from. */
static struct obstack ebitset_obstack;
static bool ebitset_obstack_init = false;
-static ebitset_elt *ebitset_free_list; /* Free list of bitset elements. */
+static ebitset_elt *ebitset_free_list; /* Free list of bitset elements. */
#define EBITSET_N_ELTS(N) (((N) + EBITSET_ELT_BITS - 1) / EBITSET_ELT_BITS)
#define EBITSET_ELTS(BSET) ((BSET)->e.elts)
@@ -96,7 +96,7 @@ static ebitset_elt *ebitset_free_list; /* Free list of bitset elements. */
/* Disable bitset cache and mark BSET as being zero. */
#define EBITSET_ZERO_SET(BSET) ((BSET)->b.cindex = BITSET_WINDEX_MAX, \
- (BSET)->b.cdata = 0)
+ (BSET)->b.cdata = 0)
#define EBITSET_CACHE_DISABLE(BSET) ((BSET)->b.cindex = BITSET_WINDEX_MAX)
@@ -136,37 +136,37 @@ ebitset_resize (bitset src, bitset_bindex n_bits)
bitset_windex size;
/* The bitset needs to grow. If we already have enough memory
- allocated, then just zero what we need. */
+ allocated, then just zero what we need. */
if (newsize > EBITSET_ASIZE (src))
- {
- /* We need to allocate more memory. When oldsize is
- non-zero this means that we are changing the size, so
- grow the bitset 25% larger than requested to reduce
- number of reallocations. */
-
- if (oldsize == 0)
- size = newsize;
- else
- size = newsize + newsize / 4;
-
- EBITSET_ELTS (src)
- = realloc (EBITSET_ELTS (src), size * sizeof (ebitset_elt *));
- EBITSET_ASIZE (src) = size;
- }
+ {
+ /* We need to allocate more memory. When oldsize is
+ non-zero this means that we are changing the size, so
+ grow the bitset 25% larger than requested to reduce
+ number of reallocations. */
+
+ if (oldsize == 0)
+ size = newsize;
+ else
+ size = newsize + newsize / 4;
+
+ EBITSET_ELTS (src)
+ = realloc (EBITSET_ELTS (src), size * sizeof (ebitset_elt *));
+ EBITSET_ASIZE (src) = size;
+ }
memset (EBITSET_ELTS (src) + oldsize, 0,
- (newsize - oldsize) * sizeof (ebitset_elt *));
+ (newsize - oldsize) * sizeof (ebitset_elt *));
}
else
{
/* The bitset needs to shrink. There's no point deallocating
- the memory unless it is shrinking by a reasonable amount. */
+ the memory unless it is shrinking by a reasonable amount. */
if ((oldsize - newsize) >= oldsize / 2)
- {
- EBITSET_ELTS (src)
- = realloc (EBITSET_ELTS (src), newsize * sizeof (ebitset_elt *));
- EBITSET_ASIZE (src) = newsize;
- }
+ {
+ EBITSET_ELTS (src)
+ = realloc (EBITSET_ELTS (src), newsize * sizeof (ebitset_elt *));
+ EBITSET_ASIZE (src) = newsize;
+ }
/* Need to prune any excess bits. FIXME. */
}
@@ -190,16 +190,16 @@ ebitset_elt_alloc (void)
else
{
if (!ebitset_obstack_init)
- {
- ebitset_obstack_init = true;
+ {
+ ebitset_obstack_init = true;
- /* Let particular systems override the size of a chunk. */
+ /* Let particular systems override the size of a chunk. */
#ifndef OBSTACK_CHUNK_SIZE
#define OBSTACK_CHUNK_SIZE 0
#endif
- /* Let them override the alloc and free routines too. */
+ /* Let them override the alloc and free routines too. */
#ifndef OBSTACK_CHUNK_ALLOC
#define OBSTACK_CHUNK_ALLOC xmalloc
@@ -213,16 +213,16 @@ ebitset_elt_alloc (void)
#define __alignof__(type) 0
#endif
- obstack_specify_allocation (&ebitset_obstack, OBSTACK_CHUNK_SIZE,
- __alignof__ (ebitset_elt),
- OBSTACK_CHUNK_ALLOC,
- OBSTACK_CHUNK_FREE);
- }
+ obstack_specify_allocation (&ebitset_obstack, OBSTACK_CHUNK_SIZE,
+ __alignof__ (ebitset_elt),
+ OBSTACK_CHUNK_ALLOC,
+ OBSTACK_CHUNK_FREE);
+ }
/* Perhaps we should add a number of new elements to the free
- list. */
+ list. */
elt = (ebitset_elt *) obstack_alloc (&ebitset_obstack,
- sizeof (ebitset_elt));
+ sizeof (ebitset_elt));
}
return elt;
@@ -293,7 +293,7 @@ ebitset_elt_zero_p (ebitset_elt *elt)
static ebitset_elt *
ebitset_elt_find (bitset bset, bitset_bindex bindex,
- enum ebitset_find_mode mode)
+ enum ebitset_find_mode mode)
{
ebitset_elt *elt;
bitset_windex size;
@@ -308,13 +308,13 @@ ebitset_elt_find (bitset bset, bitset_bindex bindex,
if (eindex < size)
{
if ((elt = elts[eindex]))
- {
- if (EBITSET_WORDS (elt) == bset->b.cdata)
- return elt;
+ {
+ if (EBITSET_WORDS (elt) == bset->b.cdata)
+ return elt;
- EBITSET_CACHE_SET (bset, eindex);
- return elt;
- }
+ EBITSET_CACHE_SET (bset, eindex);
+ return elt;
+ }
}
/* The element could not be found. */
@@ -329,7 +329,7 @@ ebitset_elt_find (bitset bset, bitset_bindex bindex,
case EBITSET_CREATE:
if (eindex >= size)
- ebitset_resize (bset, bindex);
+ ebitset_resize (bset, bindex);
/* Create a new element. */
elt = ebitset_elt_calloc ();
@@ -361,22 +361,22 @@ ebitset_weed (bitset bset)
ebitset_elt *elt = elts[j];
if (elt)
- {
- if (ebitset_elt_zero_p (elt))
- {
- ebitset_elt_remove (bset, j);
- count++;
- }
- }
+ {
+ if (ebitset_elt_zero_p (elt))
+ {
+ ebitset_elt_remove (bset, j);
+ count++;
+ }
+ }
else
- count++;
+ count++;
}
count = j - count;
if (!count)
{
/* All the bits are zero. We could shrink the elts.
- For now just mark BSET as known to be zero. */
+ For now just mark BSET as known to be zero. */
EBITSET_ZERO_SET (bset);
}
else
@@ -402,7 +402,7 @@ ebitset_zero (bitset bset)
ebitset_elt *elt = elts[j];
if (elt)
- ebitset_elt_remove (bset, j);
+ ebitset_elt_remove (bset, j);
}
/* All the bits are zero. We could shrink the elts.
@@ -437,13 +437,13 @@ ebitset_equal_p (bitset dst, bitset src)
ebitset_elt *delt = delts[j];
if (!selt && !delt)
- continue;
+ continue;
if ((selt && !delt) || (!selt && delt))
- return false;
+ return false;
for (i = 0; i < EBITSET_ELT_WORDS; i++)
- if (EBITSET_WORDS (selt)[i] != EBITSET_WORDS (delt)[i])
- return false;
+ if (EBITSET_WORDS (selt)[i] != EBITSET_WORDS (delt)[i])
+ return false;
}
return true;
}
@@ -472,14 +472,14 @@ ebitset_copy_ (bitset dst, bitset src)
ebitset_elt *selt = selts[j];
if (selt)
- {
- ebitset_elt *tmp;
-
- tmp = ebitset_elt_alloc ();
- delts[j] = tmp;
- memcpy (EBITSET_WORDS (tmp), EBITSET_WORDS (selt),
- sizeof (EBITSET_WORDS (selt)));
- }
+ {
+ ebitset_elt *tmp;
+
+ tmp = ebitset_elt_alloc ();
+ delts[j] = tmp;
+ memcpy (EBITSET_WORDS (tmp), EBITSET_WORDS (selt),
+ sizeof (EBITSET_WORDS (selt)));
+ }
}
EBITSET_NONZERO_SET (dst);
}
@@ -545,9 +545,9 @@ ebitset_test (bitset src, bitset_bindex bitno)
bitset_windex windex = bitno / BITSET_WORD_BITS;
return (ebitset_elt_find (src, bitno, EBITSET_FIND)
- && ((src->b.cdata[windex - src->b.cindex]
- >> (bitno % BITSET_WORD_BITS))
- & 1));
+ && ((src->b.cdata[windex - src->b.cindex]
+ >> (bitno % BITSET_WORD_BITS))
+ & 1));
}
@@ -564,7 +564,7 @@ ebitset_free (bitset bset)
found and with *NEXT indicating where search stopped. */
static bitset_bindex
ebitset_list_reverse (bitset bset, bitset_bindex *list,
- bitset_bindex num, bitset_bindex *next)
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex n_bits;
bitset_bindex bitno;
@@ -610,33 +610,33 @@ ebitset_list_reverse (bitset bset, bitset_bindex *list,
elt = elts[eindex];
if (elt)
- {
- srcp = EBITSET_WORDS (elt);
-
- do
- {
- bitset_word word;
-
- word = srcp[woffset] << (BITSET_WORD_BITS - 1 - bcount);
-
- for (; word; bcount--)
- {
- if (word & BITSET_MSB)
- {
- list[count++] = boffset + bcount;
- if (count >= num)
- {
- *next = n_bits - (boffset + bcount);
- return count;
- }
- }
- word <<= 1;
- }
- boffset -= BITSET_WORD_BITS;
- bcount = BITSET_WORD_BITS - 1;
- }
- while (woffset--);
- }
+ {
+ srcp = EBITSET_WORDS (elt);
+
+ do
+ {
+ bitset_word word;
+
+ word = srcp[woffset] << (BITSET_WORD_BITS - 1 - bcount);
+
+ for (; word; bcount--)
+ {
+ if (word & BITSET_MSB)
+ {
+ list[count++] = boffset + bcount;
+ if (count >= num)
+ {
+ *next = n_bits - (boffset + bcount);
+ return count;
+ }
+ }
+ word <<= 1;
+ }
+ boffset -= BITSET_WORD_BITS;
+ bcount = BITSET_WORD_BITS - 1;
+ }
+ while (woffset--);
+ }
woffset = EBITSET_ELT_WORDS - 1;
boffset = eindex * EBITSET_ELT_BITS - BITSET_WORD_BITS;
@@ -653,7 +653,7 @@ ebitset_list_reverse (bitset bset, bitset_bindex *list,
found and with *NEXT indicating where search stopped. */
static bitset_bindex
ebitset_list (bitset bset, bitset_bindex *list,
- bitset_bindex num, bitset_bindex *next)
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_windex windex;
@@ -680,33 +680,33 @@ ebitset_list (bitset bset, bitset_bindex *list,
elt = elts[eindex];
if (elt)
- {
- bitset_windex woffset;
- bitset_word *srcp = EBITSET_WORDS (elt);
-
- windex = bitno / BITSET_WORD_BITS;
- woffset = eindex * EBITSET_ELT_WORDS;
-
- for (; (windex - woffset) < EBITSET_ELT_WORDS; windex++)
- {
- word = srcp[windex - woffset] >> (bitno % BITSET_WORD_BITS);
-
- for (; word; bitno++)
- {
- if (word & 1)
- {
- list[count++] = bitno;
- if (count >= num)
- {
- *next = bitno + 1;
- return count;
- }
- }
- word >>= 1;
- }
- bitno = (windex + 1) * BITSET_WORD_BITS;
- }
- }
+ {
+ bitset_windex woffset;
+ bitset_word *srcp = EBITSET_WORDS (elt);
+
+ windex = bitno / BITSET_WORD_BITS;
+ woffset = eindex * EBITSET_ELT_WORDS;
+
+ for (; (windex - woffset) < EBITSET_ELT_WORDS; windex++)
+ {
+ word = srcp[windex - woffset] >> (bitno % BITSET_WORD_BITS);
+
+ for (; word; bitno++)
+ {
+ if (word & 1)
+ {
+ list[count++] = bitno;
+ if (count >= num)
+ {
+ *next = bitno + 1;
+ return count;
+ }
+ }
+ word >>= 1;
+ }
+ bitno = (windex + 1) * BITSET_WORD_BITS;
+ }
+ }
/* Skip to next element. */
eindex++;
@@ -722,108 +722,108 @@ ebitset_list (bitset bset, bitset_bindex *list,
elt = elts[eindex];
if (!elt)
- continue;
+ continue;
srcp = EBITSET_WORDS (elt);
windex = eindex * EBITSET_ELT_WORDS;
if ((count + EBITSET_ELT_BITS) < num)
- {
- /* The coast is clear, plant boot! */
+ {
+ /* The coast is clear, plant boot! */
#if EBITSET_ELT_WORDS == 2
- word = srcp[0];
- if (word)
- {
- if (!(word & 0xffff))
- {
- word >>= 16;
- bitno += 16;
- }
- if (!(word & 0xff))
- {
- word >>= 8;
- bitno += 8;
- }
- for (; word; bitno++)
- {
- if (word & 1)
- list[count++] = bitno;
- word >>= 1;
- }
- }
- windex++;
- bitno = windex * BITSET_WORD_BITS;
-
- word = srcp[1];
- if (word)
- {
- if (!(word & 0xffff))
- {
- word >>= 16;
- bitno += 16;
- }
- for (; word; bitno++)
- {
- if (word & 1)
- list[count++] = bitno;
- word >>= 1;
- }
- }
- windex++;
- bitno = windex * BITSET_WORD_BITS;
+ word = srcp[0];
+ if (word)
+ {
+ if (!(word & 0xffff))
+ {
+ word >>= 16;
+ bitno += 16;
+ }
+ if (!(word & 0xff))
+ {
+ word >>= 8;
+ bitno += 8;
+ }
+ for (; word; bitno++)
+ {
+ if (word & 1)
+ list[count++] = bitno;
+ word >>= 1;
+ }
+ }
+ windex++;
+ bitno = windex * BITSET_WORD_BITS;
+
+ word = srcp[1];
+ if (word)
+ {
+ if (!(word & 0xffff))
+ {
+ word >>= 16;
+ bitno += 16;
+ }
+ for (; word; bitno++)
+ {
+ if (word & 1)
+ list[count++] = bitno;
+ word >>= 1;
+ }
+ }
+ windex++;
+ bitno = windex * BITSET_WORD_BITS;
#else
- for (i = 0; i < EBITSET_ELT_WORDS; i++, windex++)
- {
- bitno = windex * BITSET_WORD_BITS;
-
- word = srcp[i];
- if (word)
- {
- if (!(word & 0xffff))
- {
- word >>= 16;
- bitno += 16;
- }
- if (!(word & 0xff))
- {
- word >>= 8;
- bitno += 8;
- }
- for (; word; bitno++)
- {
- if (word & 1)
- list[count++] = bitno;
- word >>= 1;
- }
- }
- }
+ for (i = 0; i < EBITSET_ELT_WORDS; i++, windex++)
+ {
+ bitno = windex * BITSET_WORD_BITS;
+
+ word = srcp[i];
+ if (word)
+ {
+ if (!(word & 0xffff))
+ {
+ word >>= 16;
+ bitno += 16;
+ }
+ if (!(word & 0xff))
+ {
+ word >>= 8;
+ bitno += 8;
+ }
+ for (; word; bitno++)
+ {
+ if (word & 1)
+ list[count++] = bitno;
+ word >>= 1;
+ }
+ }
+ }
#endif
- }
+ }
else
- {
- /* Tread more carefully since we need to check
- if array overflows. */
-
- for (i = 0; i < EBITSET_ELT_WORDS; i++, windex++)
- {
- bitno = windex * BITSET_WORD_BITS;
-
- for (word = srcp[i]; word; bitno++)
- {
- if (word & 1)
- {
- list[count++] = bitno;
- if (count >= num)
- {
- *next = bitno + 1;
- return count;
- }
- }
- word >>= 1;
- }
- }
- }
+ {
+ /* Tread more carefully since we need to check
+ if array overflows. */
+
+ for (i = 0; i < EBITSET_ELT_WORDS; i++, windex++)
+ {
+ bitno = windex * BITSET_WORD_BITS;
+
+ for (word = srcp[i]; word; bitno++)
+ {
+ if (word & 1)
+ {
+ list[count++] = bitno;
+ if (count >= num)
+ {
+ *next = bitno + 1;
+ return count;
+ }
+ }
+ word >>= 1;
+ }
+ }
+ }
}
*next = bitno;
@@ -853,19 +853,19 @@ ebitset_unused_clear (bitset dst)
elt = elts[eindex];
if (elt)
- {
- bitset_windex windex;
- bitset_windex woffset;
- bitset_word *srcp = EBITSET_WORDS (elt);
-
- windex = n_bits / BITSET_WORD_BITS;
- woffset = eindex * EBITSET_ELT_WORDS;
-
- srcp[windex - woffset] &= ((bitset_word) 1 << last_bit) - 1;
- windex++;
- for (; (windex - woffset) < EBITSET_ELT_WORDS; windex++)
- srcp[windex - woffset] = 0;
- }
+ {
+ bitset_windex windex;
+ bitset_windex woffset;
+ bitset_word *srcp = EBITSET_WORDS (elt);
+
+ windex = n_bits / BITSET_WORD_BITS;
+ woffset = eindex * EBITSET_ELT_WORDS;
+
+ srcp[windex - woffset] &= ((bitset_word) 1 << last_bit) - 1;
+ windex++;
+ for (; (windex - woffset) < EBITSET_ELT_WORDS; windex++)
+ srcp[windex - woffset] = 0;
+ }
}
}
@@ -879,9 +879,9 @@ ebitset_ones (bitset dst)
for (j = 0; j < EBITSET_SIZE (dst); j++)
{
/* Create new elements if they cannot be found. Perhaps
- we should just add pointers to a ones element? */
+ we should just add pointers to a ones element? */
elt =
- ebitset_elt_find (dst, j * EBITSET_ELT_BITS, EBITSET_CREATE);
+ ebitset_elt_find (dst, j * EBITSET_ELT_BITS, EBITSET_CREATE);
memset (EBITSET_WORDS (elt), -1, sizeof (EBITSET_WORDS (elt)));
}
EBITSET_NONZERO_SET (dst);
@@ -904,12 +904,12 @@ ebitset_empty_p (bitset dst)
ebitset_elt *elt = elts[j];
if (elt)
- {
- if (!ebitset_elt_zero_p (elt))
- return 0;
- /* Do some weeding as we go. */
- ebitset_elt_remove (dst, j);
- }
+ {
+ if (!ebitset_elt_zero_p (elt))
+ return 0;
+ /* Do some weeding as we go. */
+ ebitset_elt_remove (dst, j);
+ }
}
/* All the bits are zero. We could shrink the elts.
@@ -932,14 +932,14 @@ ebitset_not (bitset dst, bitset src)
for (j = 0; j < EBITSET_SIZE (src); j++)
{
/* Create new elements for dst if they cannot be found
- or substitute zero elements if src elements not found. */
+ or substitute zero elements if src elements not found. */
selt =
- ebitset_elt_find (dst, j * EBITSET_ELT_BITS, EBITSET_SUBST);
+ ebitset_elt_find (dst, j * EBITSET_ELT_BITS, EBITSET_SUBST);
delt =
- ebitset_elt_find (dst, j * EBITSET_ELT_BITS, EBITSET_CREATE);
+ ebitset_elt_find (dst, j * EBITSET_ELT_BITS, EBITSET_CREATE);
for (i = 0; i < EBITSET_ELT_WORDS; i++)
- EBITSET_WORDS (delt)[i] = ~EBITSET_WORDS (selt)[i];
+ EBITSET_WORDS (delt)[i] = ~EBITSET_WORDS (selt)[i];
}
EBITSET_NONZERO_SET (dst);
ebitset_unused_clear (dst);
@@ -972,17 +972,17 @@ ebitset_subset_p (bitset dst, bitset src)
delt = j < dsize ? delts[j] : 0;
if (!selt && !delt)
- continue;
+ continue;
if (!selt)
- selt = &ebitset_zero_elts[0];
+ selt = &ebitset_zero_elts[0];
if (!delt)
- delt = &ebitset_zero_elts[0];
+ delt = &ebitset_zero_elts[0];
for (i = 0; i < EBITSET_ELT_WORDS; i++)
- if (EBITSET_WORDS (delt)[i]
- != (EBITSET_WORDS (selt)[i] | EBITSET_WORDS (delt)[i]))
- return false;
+ if (EBITSET_WORDS (delt)[i]
+ != (EBITSET_WORDS (selt)[i] | EBITSET_WORDS (delt)[i]))
+ return false;
}
return true;
}
@@ -1014,11 +1014,11 @@ ebitset_disjoint_p (bitset dst, bitset src)
delt = j < dsize ? delts[j] : 0;
if (!selt || !delt)
- continue;
+ continue;
for (i = 0; i < EBITSET_ELT_WORDS; i++)
- if ((EBITSET_WORDS (selt)[i] & EBITSET_WORDS (delt)[i]))
- return false;
+ if ((EBITSET_WORDS (selt)[i] & EBITSET_WORDS (delt)[i]))
+ return false;
}
return true;
}
@@ -1066,93 +1066,93 @@ ebitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
delt = j < dsize ? delts[j] : 0;
if (!selt1 && !selt2)
- {
- if (delt)
- {
- changed = true;
- ebitset_elt_remove (dst, j);
- }
- continue;
- }
+ {
+ if (delt)
+ {
+ changed = true;
+ ebitset_elt_remove (dst, j);
+ }
+ continue;
+ }
if (!selt1)
- selt1 = &ebitset_zero_elts[0];
+ selt1 = &ebitset_zero_elts[0];
if (!selt2)
- selt2 = &ebitset_zero_elts[0];
+ selt2 = &ebitset_zero_elts[0];
if (!delt)
- delt = ebitset_elt_calloc ();
+ delt = ebitset_elt_calloc ();
else
- delts[j] = 0;
+ delts[j] = 0;
srcp1 = EBITSET_WORDS (selt1);
srcp2 = EBITSET_WORDS (selt2);
dstp = EBITSET_WORDS (delt);
switch (op)
- {
- default:
- abort ();
-
- case BITSET_OP_OR:
- for (i = 0; i < EBITSET_ELT_WORDS; i++, dstp++)
- {
- bitset_word tmp = *srcp1++ | *srcp2++;
-
- if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
- }
- break;
-
- case BITSET_OP_AND:
- for (i = 0; i < EBITSET_ELT_WORDS; i++, dstp++)
- {
- bitset_word tmp = *srcp1++ & *srcp2++;
-
- if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
- }
- break;
-
- case BITSET_OP_XOR:
- for (i = 0; i < EBITSET_ELT_WORDS; i++, dstp++)
- {
- bitset_word tmp = *srcp1++ ^ *srcp2++;
-
- if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
- }
- break;
-
- case BITSET_OP_ANDN:
- for (i = 0; i < EBITSET_ELT_WORDS; i++, dstp++)
- {
- bitset_word tmp = *srcp1++ & ~(*srcp2++);
-
- if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
- }
- break;
- }
+ {
+ default:
+ abort ();
+
+ case BITSET_OP_OR:
+ for (i = 0; i < EBITSET_ELT_WORDS; i++, dstp++)
+ {
+ bitset_word tmp = *srcp1++ | *srcp2++;
+
+ if (*dstp != tmp)
+ {
+ changed = true;
+ *dstp = tmp;
+ }
+ }
+ break;
+
+ case BITSET_OP_AND:
+ for (i = 0; i < EBITSET_ELT_WORDS; i++, dstp++)
+ {
+ bitset_word tmp = *srcp1++ & *srcp2++;
+
+ if (*dstp != tmp)
+ {
+ changed = true;
+ *dstp = tmp;
+ }
+ }
+ break;
+
+ case BITSET_OP_XOR:
+ for (i = 0; i < EBITSET_ELT_WORDS; i++, dstp++)
+ {
+ bitset_word tmp = *srcp1++ ^ *srcp2++;
+
+ if (*dstp != tmp)
+ {
+ changed = true;
+ *dstp = tmp;
+ }
+ }
+ break;
+
+ case BITSET_OP_ANDN:
+ for (i = 0; i < EBITSET_ELT_WORDS; i++, dstp++)
+ {
+ bitset_word tmp = *srcp1++ & ~(*srcp2++);
+
+ if (*dstp != tmp)
+ {
+ changed = true;
+ *dstp = tmp;
+ }
+ }
+ break;
+ }
if (!ebitset_elt_zero_p (delt))
- {
- ebitset_elt_add (dst, delt, j);
- }
+ {
+ ebitset_elt_add (dst, delt, j);
+ }
else
- {
- ebitset_elt_free (delt);
- }
+ {
+ ebitset_elt_free (delt);
+ }
}
/* If we have elements of DST left over, free them all. */
@@ -1165,7 +1165,7 @@ ebitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
delt = delts[j];
if (delt)
- ebitset_elt_remove (dst, j);
+ ebitset_elt_remove (dst, j);
}
EBITSET_NONZERO_SET (dst);
diff --git a/lib/lbitset.c b/lib/lbitset.c
index fb493add..5922cd20 100644
--- a/lib/lbitset.c
+++ b/lib/lbitset.c
@@ -60,10 +60,10 @@ typedef bitset_word lbitset_word;
These are linked together in a doubly-linked list. */
typedef struct lbitset_elt_struct
{
- struct lbitset_elt_struct *next; /* Next element. */
- struct lbitset_elt_struct *prev; /* Previous element. */
- bitset_windex index; /* bitno / BITSET_WORD_BITS. */
- bitset_word words[LBITSET_ELT_WORDS]; /* Bits that are set. */
+ struct lbitset_elt_struct *next; /* Next element. */
+ struct lbitset_elt_struct *prev; /* Previous element. */
+ bitset_windex index; /* bitno / BITSET_WORD_BITS. */
+ bitset_word words[LBITSET_ELT_WORDS]; /* Bits that are set. */
}
lbitset_elt;
@@ -76,7 +76,7 @@ static lbitset_elt lbitset_zero_elts[3]; /* Elements of all zero bits. */
/* Obstack to allocate bitset elements from. */
static struct obstack lbitset_obstack;
static bool lbitset_obstack_init = false;
-static lbitset_elt *lbitset_free_list; /* Free list of bitset elements. */
+static lbitset_elt *lbitset_free_list; /* Free list of bitset elements. */
extern void debug_lbitset (bitset);
@@ -102,16 +102,16 @@ lbitset_elt_alloc (void)
else
{
if (!lbitset_obstack_init)
- {
- lbitset_obstack_init = true;
+ {
+ lbitset_obstack_init = true;
- /* Let particular systems override the size of a chunk. */
+ /* Let particular systems override the size of a chunk. */
#ifndef OBSTACK_CHUNK_SIZE
#define OBSTACK_CHUNK_SIZE 0
#endif
- /* Let them override the alloc and free routines too. */
+ /* Let them override the alloc and free routines too. */
#ifndef OBSTACK_CHUNK_ALLOC
#define OBSTACK_CHUNK_ALLOC xmalloc
@@ -125,16 +125,16 @@ lbitset_elt_alloc (void)
#define __alignof__(type) 0
#endif
- obstack_specify_allocation (&lbitset_obstack, OBSTACK_CHUNK_SIZE,
- __alignof__ (lbitset_elt),
- OBSTACK_CHUNK_ALLOC,
- OBSTACK_CHUNK_FREE);
- }
+ obstack_specify_allocation (&lbitset_obstack, OBSTACK_CHUNK_SIZE,
+ __alignof__ (lbitset_elt),
+ OBSTACK_CHUNK_ALLOC,
+ OBSTACK_CHUNK_FREE);
+ }
/* Perhaps we should add a number of new elements to the free
- list. */
+ list. */
elt = (lbitset_elt *) obstack_alloc (&lbitset_obstack,
- sizeof (lbitset_elt));
+ sizeof (lbitset_elt));
}
return elt;
@@ -185,20 +185,20 @@ lbitset_elt_unlink (bitset bset, lbitset_elt *elt)
if (LBITSET_CURRENT (bset) == elt)
{
if (next)
- {
- bset->b.cdata = next->words;
- bset->b.cindex = next->index;
- }
+ {
+ bset->b.cdata = next->words;
+ bset->b.cindex = next->index;
+ }
else if (prev)
- {
- bset->b.cdata = prev->words;
- bset->b.cindex = prev->index;
- }
+ {
+ bset->b.cdata = prev->words;
+ bset->b.cindex = prev->index;
+ }
else
- {
- bset->b.csize = 0;
- bset->b.cdata = 0;
- }
+ {
+ bset->b.csize = 0;
+ bset->b.cdata = 0;
+ }
}
lbitset_elt_free (elt);
@@ -278,13 +278,13 @@ lbitset_elt_link (bitset bset, lbitset_elt *elt)
else if (windex < bset->b.cindex)
{
for (ptr = current;
- ptr->prev && ptr->prev->index > windex; ptr = ptr->prev)
- continue;
+ ptr->prev && ptr->prev->index > windex; ptr = ptr->prev)
+ continue;
if (ptr->prev)
- ptr->prev->next = elt;
+ ptr->prev->next = elt;
else
- LBITSET_HEAD (bset) = elt;
+ LBITSET_HEAD (bset) = elt;
elt->prev = ptr->prev;
elt->next = ptr;
@@ -295,13 +295,13 @@ lbitset_elt_link (bitset bset, lbitset_elt *elt)
else
{
for (ptr = current;
- ptr->next && ptr->next->index < windex; ptr = ptr->next)
- continue;
+ ptr->next && ptr->next->index < windex; ptr = ptr->next)
+ continue;
if (ptr->next)
- ptr->next->prev = elt;
+ ptr->next->prev = elt;
else
- LBITSET_TAIL (bset) = elt;
+ LBITSET_TAIL (bset) = elt;
elt->next = ptr->next;
elt->prev = ptr;
@@ -317,7 +317,7 @@ lbitset_elt_link (bitset bset, lbitset_elt *elt)
static lbitset_elt *
lbitset_elt_find (bitset bset, bitset_windex windex,
- enum lbitset_find_mode mode)
+ enum lbitset_find_mode mode)
{
lbitset_elt *elt;
lbitset_elt *current;
@@ -327,7 +327,7 @@ lbitset_elt_find (bitset bset, bitset_windex windex,
current = LBITSET_CURRENT (bset);
/* Check if element is the cached element. */
if ((windex - bset->b.cindex) < bset->b.csize)
- return current;
+ return current;
}
else
{
@@ -337,28 +337,28 @@ lbitset_elt_find (bitset bset, bitset_windex windex,
if (current)
{
if (windex < bset->b.cindex)
- {
- for (elt = current;
- elt->prev && elt->index > windex; elt = elt->prev)
- continue;
- }
+ {
+ for (elt = current;
+ elt->prev && elt->index > windex; elt = elt->prev)
+ continue;
+ }
else
- {
- for (elt = current;
- elt->next && (elt->index + LBITSET_ELT_WORDS - 1) < windex;
- elt = elt->next)
- continue;
- }
+ {
+ for (elt = current;
+ elt->next && (elt->index + LBITSET_ELT_WORDS - 1) < windex;
+ elt = elt->next)
+ continue;
+ }
/* ELT is the nearest to the one we want. If it's not the one
- we want, the one we want does not exist. */
+ we want, the one we want does not exist. */
if (elt && (windex - elt->index) < LBITSET_ELT_WORDS)
- {
- bset->b.cindex = elt->index;
- bset->b.csize = LBITSET_ELT_WORDS;
- bset->b.cdata = elt->words;
- return elt;
- }
+ {
+ bset->b.cindex = elt->index;
+ bset->b.csize = LBITSET_ELT_WORDS;
+ bset->b.cdata = elt->words;
+ return elt;
+ }
}
switch (mode)
@@ -394,7 +394,7 @@ lbitset_weed (bitset bset)
{
next = elt->next;
if (lbitset_elt_zero_p (elt))
- lbitset_elt_unlink (bset, elt);
+ lbitset_elt_unlink (bset, elt);
}
}
@@ -431,11 +431,11 @@ lbitset_equal_p (bitset dst, bitset src)
selt && delt; selt = selt->next, delt = delt->next)
{
if (selt->index != delt->index)
- return false;
+ return false;
for (j = 0; j < LBITSET_ELT_WORDS; j++)
- if (delt->words[j] != selt->words[j])
- return false;
+ if (delt->words[j] != selt->words[j])
+ return false;
}
return !selt && !delt;
}
@@ -467,9 +467,9 @@ lbitset_copy (bitset dst, bitset src)
tmp->prev = prev;
tmp->next = 0;
if (prev)
- prev->next = tmp;
+ prev->next = tmp;
else
- LBITSET_HEAD (dst) = tmp;
+ LBITSET_HEAD (dst) = tmp;
prev = tmp;
memcpy (tmp->words, elt->words, sizeof (elt->words));
@@ -549,9 +549,9 @@ lbitset_test (bitset src, bitset_bindex bitno)
bitset_windex windex = bitno / BITSET_WORD_BITS;
return (lbitset_elt_find (src, windex, LBITSET_FIND)
- && ((src->b.cdata[windex - src->b.cindex]
- >> (bitno % BITSET_WORD_BITS))
- & 1));
+ && ((src->b.cdata[windex - src->b.cindex]
+ >> (bitno % BITSET_WORD_BITS))
+ & 1));
}
@@ -567,7 +567,7 @@ lbitset_free (bitset bset)
found and with *NEXT indicating where search stopped. */
static bitset_bindex
lbitset_list_reverse (bitset bset, bitset_bindex *list,
- bitset_bindex num, bitset_bindex *next)
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex rbitno;
bitset_bindex bitno;
@@ -603,7 +603,7 @@ lbitset_list_reverse (bitset bset, bitset_bindex *list,
if (windex >= elt->index + LBITSET_ELT_WORDS)
{
/* We are trying to start in no-mans land so start
- at end of current elt. */
+ at end of current elt. */
bcount = BITSET_WORD_BITS - 1;
windex = elt->index + LBITSET_ELT_WORDS - 1;
}
@@ -623,33 +623,33 @@ lbitset_list_reverse (bitset bset, bitset_bindex *list,
bitset_word *srcp = elt->words;
for (; (windex - elt->index) < LBITSET_ELT_WORDS;
- windex--, boffset -= BITSET_WORD_BITS,
- bcount = BITSET_WORD_BITS - 1)
- {
- word =
- srcp[windex - elt->index] << (BITSET_WORD_BITS - 1 - bcount);
-
- for (; word; bcount--)
- {
- if (word & BITSET_MSB)
- {
- list[count++] = boffset + bcount;
- if (count >= num)
- {
- *next = n_bits - (boffset + bcount);
- return count;
- }
- }
- word <<= 1;
- }
- }
+ windex--, boffset -= BITSET_WORD_BITS,
+ bcount = BITSET_WORD_BITS - 1)
+ {
+ word =
+ srcp[windex - elt->index] << (BITSET_WORD_BITS - 1 - bcount);
+
+ for (; word; bcount--)
+ {
+ if (word & BITSET_MSB)
+ {
+ list[count++] = boffset + bcount;
+ if (count >= num)
+ {
+ *next = n_bits - (boffset + bcount);
+ return count;
+ }
+ }
+ word <<= 1;
+ }
+ }
elt = elt->prev;
if (elt)
- {
- windex = elt->index + LBITSET_ELT_WORDS - 1;
- boffset = windex * BITSET_WORD_BITS;
- }
+ {
+ windex = elt->index + LBITSET_ELT_WORDS - 1;
+ boffset = windex * BITSET_WORD_BITS;
+ }
}
*next = n_bits - (boffset + 1);
@@ -662,7 +662,7 @@ lbitset_list_reverse (bitset bset, bitset_bindex *list,
found and with *NEXT indicating where search stopped. */
static bitset_bindex
lbitset_list (bitset bset, bitset_bindex *list,
- bitset_bindex num, bitset_bindex *next)
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_windex windex;
@@ -693,51 +693,51 @@ lbitset_list (bitset bset, bitset_bindex *list,
/* Skip to starting element. */
for (elt = head;
- elt && (elt->index + LBITSET_ELT_WORDS - 1) < windex;
- elt = elt->next)
- continue;
+ elt && (elt->index + LBITSET_ELT_WORDS - 1) < windex;
+ elt = elt->next)
+ continue;
if (!elt)
- return 0;
+ return 0;
if (windex < elt->index)
- {
- windex = elt->index;
- bitno = windex * BITSET_WORD_BITS;
- }
+ {
+ windex = elt->index;
+ bitno = windex * BITSET_WORD_BITS;
+ }
else
- {
- bitset_word *srcp = elt->words;
-
- /* We are starting within an element. */
-
- for (; (windex - elt->index) < LBITSET_ELT_WORDS; windex++)
- {
- word = srcp[windex - elt->index] >> (bitno % BITSET_WORD_BITS);
-
- for (; word; bitno++)
- {
- if (word & 1)
- {
- list[count++] = bitno;
- if (count >= num)
- {
- *next = bitno + 1;
- return count;
- }
- }
- word >>= 1;
- }
- bitno = (windex + 1) * BITSET_WORD_BITS;
- }
-
- elt = elt->next;
- if (elt)
- {
- windex = elt->index;
- bitno = windex * BITSET_WORD_BITS;
- }
- }
+ {
+ bitset_word *srcp = elt->words;
+
+ /* We are starting within an element. */
+
+ for (; (windex - elt->index) < LBITSET_ELT_WORDS; windex++)
+ {
+ word = srcp[windex - elt->index] >> (bitno % BITSET_WORD_BITS);
+
+ for (; word; bitno++)
+ {
+ if (word & 1)
+ {
+ list[count++] = bitno;
+ if (count >= num)
+ {
+ *next = bitno + 1;
+ return count;
+ }
+ }
+ word >>= 1;
+ }
+ bitno = (windex + 1) * BITSET_WORD_BITS;
+ }
+
+ elt = elt->next;
+ if (elt)
+ {
+ windex = elt->index;
+ bitno = windex * BITSET_WORD_BITS;
+ }
+ }
}
@@ -750,109 +750,109 @@ lbitset_list (bitset bset, bitset_bindex *list,
bitset_word *srcp = elt->words;
if ((count + LBITSET_ELT_BITS) < num)
- {
- /* The coast is clear, plant boot! */
+ {
+ /* The coast is clear, plant boot! */
#if LBITSET_ELT_WORDS == 2
- word = srcp[0];
- if (word)
- {
- if (!(word & 0xffff))
- {
- word >>= 16;
- bitno += 16;
- }
- if (!(word & 0xff))
- {
- word >>= 8;
- bitno += 8;
- }
- for (; word; bitno++)
- {
- if (word & 1)
- list[count++] = bitno;
- word >>= 1;
- }
- }
- windex++;
- bitno = windex * BITSET_WORD_BITS;
-
- word = srcp[1];
- if (word)
- {
- if (!(word & 0xffff))
- {
- word >>= 16;
- bitno += 16;
- }
- for (; word; bitno++)
- {
- if (word & 1)
- list[count++] = bitno;
- word >>= 1;
- }
- }
- windex++;
- bitno = windex * BITSET_WORD_BITS;
+ word = srcp[0];
+ if (word)
+ {
+ if (!(word & 0xffff))
+ {
+ word >>= 16;
+ bitno += 16;
+ }
+ if (!(word & 0xff))
+ {
+ word >>= 8;
+ bitno += 8;
+ }
+ for (; word; bitno++)
+ {
+ if (word & 1)
+ list[count++] = bitno;
+ word >>= 1;
+ }
+ }
+ windex++;
+ bitno = windex * BITSET_WORD_BITS;
+
+ word = srcp[1];
+ if (word)
+ {
+ if (!(word & 0xffff))
+ {
+ word >>= 16;
+ bitno += 16;
+ }
+ for (; word; bitno++)
+ {
+ if (word & 1)
+ list[count++] = bitno;
+ word >>= 1;
+ }
+ }
+ windex++;
+ bitno = windex * BITSET_WORD_BITS;
#else
- for (i = 0; i < LBITSET_ELT_WORDS; i++)
- {
- word = srcp[i];
- if (word)
- {
- if (!(word & 0xffff))
- {
- word >>= 16;
- bitno += 16;
- }
- if (!(word & 0xff))
- {
- word >>= 8;
- bitno += 8;
- }
- for (; word; bitno++)
- {
- if (word & 1)
- list[count++] = bitno;
- word >>= 1;
- }
- }
- windex++;
- bitno = windex * BITSET_WORD_BITS;
- }
+ for (i = 0; i < LBITSET_ELT_WORDS; i++)
+ {
+ word = srcp[i];
+ if (word)
+ {
+ if (!(word & 0xffff))
+ {
+ word >>= 16;
+ bitno += 16;
+ }
+ if (!(word & 0xff))
+ {
+ word >>= 8;
+ bitno += 8;
+ }
+ for (; word; bitno++)
+ {
+ if (word & 1)
+ list[count++] = bitno;
+ word >>= 1;
+ }
+ }
+ windex++;
+ bitno = windex * BITSET_WORD_BITS;
+ }
#endif
- }
+ }
else
- {
- /* Tread more carefully since we need to check
- if array overflows. */
-
- for (i = 0; i < LBITSET_ELT_WORDS; i++)
- {
- for (word = srcp[i]; word; bitno++)
- {
- if (word & 1)
- {
- list[count++] = bitno;
- if (count >= num)
- {
- *next = bitno + 1;
- return count;
- }
- }
- word >>= 1;
- }
- windex++;
- bitno = windex * BITSET_WORD_BITS;
- }
- }
+ {
+ /* Tread more carefully since we need to check
+ if array overflows. */
+
+ for (i = 0; i < LBITSET_ELT_WORDS; i++)
+ {
+ for (word = srcp[i]; word; bitno++)
+ {
+ if (word & 1)
+ {
+ list[count++] = bitno;
+ if (count >= num)
+ {
+ *next = bitno + 1;
+ return count;
+ }
+ }
+ word >>= 1;
+ }
+ windex++;
+ bitno = windex * BITSET_WORD_BITS;
+ }
+ }
elt = elt->next;
if (elt)
- {
- windex = elt->index;
- bitno = windex * BITSET_WORD_BITS;
- }
+ {
+ windex = elt->index;
+ bitno = windex * BITSET_WORD_BITS;
+ }
}
*next = bitno;
@@ -870,7 +870,7 @@ lbitset_empty_p (bitset dst)
{
next = elt->next;
if (!lbitset_elt_zero_p (elt))
- return 0;
+ return 0;
/* Weed as we go. */
lbitset_elt_unlink (dst, elt);
}
@@ -903,7 +903,7 @@ lbitset_unused_clear (bitset dst)
windex++;
for (; (windex - elt->index) < LBITSET_ELT_WORDS; windex++)
- srcp[windex - elt->index] = 0;
+ srcp[windex - elt->index] = 0;
}
}
@@ -952,12 +952,12 @@ lbitset_not (bitset dst, bitset src)
for (i = 0; i < windex; i += LBITSET_ELT_WORDS)
{
/* Create new elements for dst if they cannot be found
- or substitute zero elements if src elements not found. */
+ or substitute zero elements if src elements not found. */
selt = lbitset_elt_find (src, i, LBITSET_SUBST);
delt = lbitset_elt_find (dst, i, LBITSET_CREATE);
for (j = 0; j < LBITSET_ELT_WORDS; j++)
- delt->words[j] = ~selt->words[j];
+ delt->words[j] = ~selt->words[j];
}
lbitset_unused_clear (dst);
lbitset_weed (dst);
@@ -977,26 +977,26 @@ lbitset_subset_p (bitset dst, bitset src)
selt || delt; selt = selt->next, delt = delt->next)
{
if (!selt)
- selt = &lbitset_zero_elts[0];
+ selt = &lbitset_zero_elts[0];
else if (!delt)
- delt = &lbitset_zero_elts[0];
+ delt = &lbitset_zero_elts[0];
else if (selt->index != delt->index)
- {
- if (selt->index < delt->index)
- {
- lbitset_zero_elts[2].next = delt;
- delt = &lbitset_zero_elts[2];
- }
- else
- {
- lbitset_zero_elts[1].next = selt;
- selt = &lbitset_zero_elts[1];
- }
- }
+ {
+ if (selt->index < delt->index)
+ {
+ lbitset_zero_elts[2].next = delt;
+ delt = &lbitset_zero_elts[2];
+ }
+ else
+ {
+ lbitset_zero_elts[1].next = selt;
+ selt = &lbitset_zero_elts[1];
+ }
+ }
for (j = 0; j < LBITSET_ELT_WORDS; j++)
- if (delt->words[j] != (selt->words[j] | delt->words[j]))
- return false;
+ if (delt->words[j] != (selt->words[j] | delt->words[j]))
+ return false;
}
return true;
}
@@ -1014,25 +1014,25 @@ lbitset_disjoint_p (bitset dst, bitset src)
selt && delt; selt = selt->next, delt = delt->next)
{
if (selt->index != delt->index)
- {
- if (selt->index < delt->index)
- {
- lbitset_zero_elts[2].next = delt;
- delt = &lbitset_zero_elts[2];
- }
- else
- {
- lbitset_zero_elts[1].next = selt;
- selt = &lbitset_zero_elts[1];
- }
- /* Since the elements are different, there is no
- intersection of these elements. */
- continue;
- }
+ {
+ if (selt->index < delt->index)
+ {
+ lbitset_zero_elts[2].next = delt;
+ delt = &lbitset_zero_elts[2];
+ }
+ else
+ {
+ lbitset_zero_elts[1].next = selt;
+ selt = &lbitset_zero_elts[1];
+ }
+ /* Since the elements are different, there is no
+ intersection of these elements. */
+ continue;
+ }
for (j = 0; j < LBITSET_ELT_WORDS; j++)
- if (selt->words[j] & delt->words[j])
- return false;
+ if (selt->words[j] & delt->words[j])
+ return false;
}
return true;
}
@@ -1065,124 +1065,124 @@ lbitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
while (selt1 || selt2)
{
/* Figure out whether we need to substitute zero elements for
- missing links. */
+ missing links. */
if (windex1 == windex2)
- {
- windex = windex1;
- stmp1 = selt1;
- stmp2 = selt2;
- selt1 = selt1->next;
- windex1 = (selt1) ? selt1->index : BITSET_WINDEX_MAX;
- selt2 = selt2->next;
- windex2 = (selt2) ? selt2->index : BITSET_WINDEX_MAX;
- }
+ {
+ windex = windex1;
+ stmp1 = selt1;
+ stmp2 = selt2;
+ selt1 = selt1->next;
+ windex1 = (selt1) ? selt1->index : BITSET_WINDEX_MAX;
+ selt2 = selt2->next;
+ windex2 = (selt2) ? selt2->index : BITSET_WINDEX_MAX;
+ }
else if (windex1 < windex2)
- {
- windex = windex1;
- stmp1 = selt1;
- stmp2 = &lbitset_zero_elts[0];
- selt1 = selt1->next;
- windex1 = (selt1) ? selt1->index : BITSET_WINDEX_MAX;
- }
+ {
+ windex = windex1;
+ stmp1 = selt1;
+ stmp2 = &lbitset_zero_elts[0];
+ selt1 = selt1->next;
+ windex1 = (selt1) ? selt1->index : BITSET_WINDEX_MAX;
+ }
else
- {
- windex = windex2;
- stmp1 = &lbitset_zero_elts[0];
- stmp2 = selt2;
- selt2 = selt2->next;
- windex2 = (selt2) ? selt2->index : BITSET_WINDEX_MAX;
- }
+ {
+ windex = windex2;
+ stmp1 = &lbitset_zero_elts[0];
+ stmp2 = selt2;
+ selt2 = selt2->next;
+ windex2 = (selt2) ? selt2->index : BITSET_WINDEX_MAX;
+ }
/* Find the appropriate element from DST. Begin by discarding
- elements that we've skipped. */
+ elements that we've skipped. */
while (delt && delt->index < windex)
- {
- changed = true;
- dtmp = delt;
- delt = delt->next;
- lbitset_elt_free (dtmp);
- }
+ {
+ changed = true;
+ dtmp = delt;
+ delt = delt->next;
+ lbitset_elt_free (dtmp);
+ }
if (delt && delt->index == windex)
- {
- dtmp = delt;
- delt = delt->next;
- }
+ {
+ dtmp = delt;
+ delt = delt->next;
+ }
else
- dtmp = lbitset_elt_calloc ();
+ dtmp = lbitset_elt_calloc ();
/* Do the operation, and if any bits are set, link it into the
- linked list. */
+ linked list. */
srcp1 = stmp1->words;
srcp2 = stmp2->words;
dstp = dtmp->words;
switch (op)
- {
- default:
- abort ();
-
- case BITSET_OP_OR:
- for (i = 0; i < LBITSET_ELT_WORDS; i++, dstp++)
- {
- bitset_word tmp = *srcp1++ | *srcp2++;
-
- if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
- }
- break;
-
- case BITSET_OP_AND:
- for (i = 0; i < LBITSET_ELT_WORDS; i++, dstp++)
- {
- bitset_word tmp = *srcp1++ & *srcp2++;
-
- if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
- }
- break;
-
- case BITSET_OP_XOR:
- for (i = 0; i < LBITSET_ELT_WORDS; i++, dstp++)
- {
- bitset_word tmp = *srcp1++ ^ *srcp2++;
-
- if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
- }
- break;
-
- case BITSET_OP_ANDN:
- for (i = 0; i < LBITSET_ELT_WORDS; i++, dstp++)
- {
- bitset_word tmp = *srcp1++ & ~(*srcp2++);
-
- if (*dstp != tmp)
- {
- changed = true;
- *dstp = tmp;
- }
- }
- break;
- }
+ {
+ default:
+ abort ();
+
+ case BITSET_OP_OR:
+ for (i = 0; i < LBITSET_ELT_WORDS; i++, dstp++)
+ {
+ bitset_word tmp = *srcp1++ | *srcp2++;
+
+ if (*dstp != tmp)
+ {
+ changed = true;
+ *dstp = tmp;
+ }
+ }
+ break;
+
+ case BITSET_OP_AND:
+ for (i = 0; i < LBITSET_ELT_WORDS; i++, dstp++)
+ {
+ bitset_word tmp = *srcp1++ & *srcp2++;
+
+ if (*dstp != tmp)
+ {
+ changed = true;
+ *dstp = tmp;
+ }
+ }
+ break;
+
+ case BITSET_OP_XOR:
+ for (i = 0; i < LBITSET_ELT_WORDS; i++, dstp++)
+ {
+ bitset_word tmp = *srcp1++ ^ *srcp2++;
+
+ if (*dstp != tmp)
+ {
+ changed = true;
+ *dstp = tmp;
+ }
+ }
+ break;
+
+ case BITSET_OP_ANDN:
+ for (i = 0; i < LBITSET_ELT_WORDS; i++, dstp++)
+ {
+ bitset_word tmp = *srcp1++ & ~(*srcp2++);
+
+ if (*dstp != tmp)
+ {
+ changed = true;
+ *dstp = tmp;
+ }
+ }
+ break;
+ }
if (!lbitset_elt_zero_p (dtmp))
- {
- dtmp->index = windex;
- /* Perhaps this could be optimised... */
- lbitset_elt_link (dst, dtmp);
- }
+ {
+ dtmp->index = windex;
+ /* Perhaps this could be optimised... */
+ lbitset_elt_link (dst, dtmp);
+ }
else
- {
- lbitset_elt_free (dtmp);
- }
+ {
+ lbitset_elt_free (dtmp);
+ }
}
/* If we have elements of DST left over, free them all. */
@@ -1390,17 +1390,17 @@ debug_lbitset (bitset bset)
{
fprintf (stderr, "Elt %lu\n", (unsigned long int) elt->index);
for (i = 0; i < LBITSET_ELT_WORDS; i++)
- {
- unsigned int j;
- bitset_word word;
-
- word = elt->words[i];
-
- fprintf (stderr, " Word %u:", i);
- for (j = 0; j < LBITSET_WORD_BITS; j++)
- if ((word & ((bitset_word) 1 << j)))
- fprintf (stderr, " %u", j);
- fprintf (stderr, "\n");
- }
+ {
+ unsigned int j;
+ bitset_word word;
+
+ word = elt->words[i];
+
+ fprintf (stderr, " Word %u:", i);
+ for (j = 0; j < LBITSET_WORD_BITS; j++)
+ if ((word & ((bitset_word) 1 << j)))
+ fprintf (stderr, " %u", j);
+ fprintf (stderr, "\n");
+ }
}
}
diff --git a/lib/timevar.c b/lib/timevar.c
index 03ec0b65..6ab3c4ff 100644
--- a/lib/timevar.c
+++ b/lib/timevar.c
@@ -189,8 +189,8 @@ static struct timevar_time_def start_time;
static void get_time (struct timevar_time_def *);
static void timevar_accumulate (struct timevar_time_def *,
- struct timevar_time_def *,
- struct timevar_time_def *);
+ struct timevar_time_def *,
+ struct timevar_time_def *);
/* Fill the current times into TIME. The definition of this function
also defines any or all of the HAVE_USER_TIME, HAVE_SYS_TIME, and
@@ -479,20 +479,20 @@ timevar_print (fp)
const float tiny = 5e-3;
/* Don't print the total execution time here; that goes at the
- end. */
+ end. */
if ((timevar_id_t) id == TV_TOTAL)
- continue;
+ continue;
/* Don't print timing variables that were never used. */
if (!tv->used)
- continue;
+ continue;
/* Don't print timing variables if we're going to get a row of
- zeroes. */
+ zeroes. */
if (tv->elapsed.user < tiny
- && tv->elapsed.sys < tiny
- && tv->elapsed.wall < tiny)
- continue;
+ && tv->elapsed.sys < tiny
+ && tv->elapsed.wall < tiny)
+ continue;
/* The timing variable name. */
fprintf (fp, " %-22s:", tv->name);
@@ -500,22 +500,22 @@ timevar_print (fp)
#ifdef HAVE_USER_TIME
/* Print user-mode time for this process. */
fprintf (fp, "%7.2f (%2.0f%%) usr",
- tv->elapsed.user,
- (total->user == 0 ? 0 : tv->elapsed.user / total->user) * 100);
+ tv->elapsed.user,
+ (total->user == 0 ? 0 : tv->elapsed.user / total->user) * 100);
#endif /* HAVE_USER_TIME */
#ifdef HAVE_SYS_TIME
/* Print system-mode time for this process. */
fprintf (fp, "%7.2f (%2.0f%%) sys",
- tv->elapsed.sys,
- (total->sys == 0 ? 0 : tv->elapsed.sys / total->sys) * 100);
+ tv->elapsed.sys,
+ (total->sys == 0 ? 0 : tv->elapsed.sys / total->sys) * 100);
#endif /* HAVE_SYS_TIME */
#ifdef HAVE_WALL_TIME
/* Print wall clock time elapsed. */
fprintf (fp, "%7.2f (%2.0f%%) wall",
- tv->elapsed.wall,
- (total->wall == 0 ? 0 : tv->elapsed.wall / total->wall) * 100);
+ tv->elapsed.wall,
+ (total->wall == 0 ? 0 : tv->elapsed.wall / total->wall) * 100);
#endif /* HAVE_WALL_TIME */
putc ('\n', fp);
@@ -534,7 +534,7 @@ timevar_print (fp)
#endif
#endif /* defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME)
- || defined (HAVE_WALL_TIME) */
+ || defined (HAVE_WALL_TIME) */
}
/* Returns time (user + system) used so far by the compiler process,
@@ -558,8 +558,8 @@ print_time (str, total)
{
long all_time = get_run_time ();
fprintf (stderr,
- _("time in %s: %ld.%06ld (%ld%%)\n"),
- str, total / 1000000, total % 1000000,
- all_time == 0 ? 0
- : (long) (((100.0 * (double) total) / (double) all_time) + .5));
+ _("time in %s: %ld.%06ld (%ld%%)\n"),
+ str, total / 1000000, total % 1000000,
+ all_time == 0 ? 0
+ : (long) (((100.0 * (double) total) / (double) all_time) + .5));
}
diff --git a/lib/vbitset.c b/lib/vbitset.c
index 7d75eacf..dbd33c87 100644
--- a/lib/vbitset.c
+++ b/lib/vbitset.c
@@ -38,9 +38,9 @@ static void vbitset_set (bitset, bitset_bindex);
static void vbitset_reset (bitset, bitset_bindex);
static bool vbitset_test (bitset, bitset_bindex);
static bitset_bindex vbitset_list (bitset, bitset_bindex *,
- bitset_bindex, bitset_bindex *);
+ bitset_bindex, bitset_bindex *);
static bitset_bindex vbitset_list_reverse (bitset, bitset_bindex *,
- bitset_bindex, bitset_bindex *);
+ bitset_bindex, bitset_bindex *);
#define VBITSET_N_WORDS(N) (((N) + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS)
#define VBITSET_WORDS(X) ((X)->b.cdata)
@@ -69,38 +69,38 @@ vbitset_resize (bitset src, bitset_bindex n_bits)
bitset_windex size;
/* The bitset needs to grow. If we already have enough memory
- allocated, then just zero what we need. */
+ allocated, then just zero what we need. */
if (newsize > VBITSET_ASIZE (src))
- {
- /* We need to allocate more memory. When oldsize is
- non-zero this means that we are changing the size, so
- grow the bitset 25% larger than requested to reduce
- number of reallocations. */
-
- if (oldsize == 0)
- size = newsize;
- else
- size = newsize + newsize / 4;
-
- VBITSET_WORDS (src)
- = realloc (VBITSET_WORDS (src), size * sizeof (bitset_word));
- VBITSET_ASIZE (src) = size;
- }
+ {
+ /* We need to allocate more memory. When oldsize is
+ non-zero this means that we are changing the size, so
+ grow the bitset 25% larger than requested to reduce
+ number of reallocations. */
+
+ if (oldsize == 0)
+ size = newsize;
+ else
+ size = newsize + newsize / 4;
+
+ VBITSET_WORDS (src)
+ = realloc (VBITSET_WORDS (src), size * sizeof (bitset_word));
+ VBITSET_ASIZE (src) = size;
+ }
memset (VBITSET_WORDS (src) + oldsize, 0,
- (newsize - oldsize) * sizeof (bitset_word));
+ (newsize - oldsize) * sizeof (bitset_word));
VBITSET_SIZE (src) = newsize;
}
else
{
/* The bitset needs to shrink. There's no point deallocating
- the memory unless it is shrinking by a reasonable amount. */
+ the memory unless it is shrinking by a reasonable amount. */
if ((oldsize - newsize) >= oldsize / 2)
- {
- VBITSET_WORDS (src)
- = realloc (VBITSET_WORDS (src), newsize * sizeof (bitset_word));
- VBITSET_ASIZE (src) = newsize;
- }
+ {
+ VBITSET_WORDS (src)
+ = realloc (VBITSET_WORDS (src), newsize * sizeof (bitset_word));
+ VBITSET_ASIZE (src) = newsize;
+ }
/* Need to prune any excess bits. FIXME. */
@@ -196,18 +196,18 @@ vbitset_list_reverse (src, list, num, next)
word = srcp[windex] << (BITSET_WORD_BITS - 1 - bitcnt);
for (; word; bitcnt--)
- {
- if (word & BITSET_MSB)
- {
- list[count++] = bitoff + bitcnt;
- if (count >= num)
- {
- *next = n_bits - (bitoff + bitcnt);
- return count;
- }
- }
- word <<= 1;
- }
+ {
+ if (word & BITSET_MSB)
+ {
+ list[count++] = bitoff + bitcnt;
+ if (count >= num)
+ {
+ *next = n_bits - (bitoff + bitcnt);
+ return count;
+ }
+ }
+ word <<= 1;
+ }
bitoff -= BITSET_WORD_BITS;
bitcnt = BITSET_WORD_BITS - 1;
}
@@ -243,80 +243,80 @@ vbitset_list (src, list, num, next)
{
/* Many bitsets are zero, so make this common case fast. */
for (windex = 0; windex < size && !srcp[windex]; windex++)
- continue;
+ continue;
if (windex >= size)
- return 0;
+ return 0;
/* If num is 1, we could speed things up with a binary search
- of the current word. */
+ of the current word. */
bitoff = windex * BITSET_WORD_BITS;
}
else
{
if (bitno >= BITSET_SIZE_ (src))
- return 0;
+ return 0;
windex = bitno / BITSET_WORD_BITS;
bitno = bitno % BITSET_WORD_BITS;
if (bitno)
- {
- /* Handle the case where we start within a word.
- Most often, this is executed with large bitsets
- with many set bits where we filled the array
- on the previous call to this function. */
-
- bitoff = windex * BITSET_WORD_BITS;
- word = srcp[windex] >> bitno;
- for (bitno = bitoff + bitno; word; bitno++)
- {
- if (word & 1)
- {
- list[count++] = bitno;
- if (count >= num)
- {
- *next = bitno + 1;
- return count;
- }
- }
- word >>= 1;
- }
- windex++;
- }
+ {
+ /* Handle the case where we start within a word.
+ Most often, this is executed with large bitsets
+ with many set bits where we filled the array
+ on the previous call to this function. */
+
+ bitoff = windex * BITSET_WORD_BITS;
+ word = srcp[windex] >> bitno;
+ for (bitno = bitoff + bitno; word; bitno++)
+ {
+ if (word & 1)
+ {
+ list[count++] = bitno;
+ if (count >= num)
+ {
+ *next = bitno + 1;
+ return count;
+ }
+ }
+ word >>= 1;
+ }
+ windex++;
+ }
bitoff = windex * BITSET_WORD_BITS;
}
for (; windex < size; windex++, bitoff += BITSET_WORD_BITS)
{
if (!(word = srcp[windex]))
- continue;
+ continue;
if ((count + BITSET_WORD_BITS) < num)
- {
- for (bitno = bitoff; word; bitno++)
- {
- if (word & 1)
- list[count++] = bitno;
- word >>= 1;
- }
- }
+ {
+ for (bitno = bitoff; word; bitno++)
+ {
+ if (word & 1)
+ list[count++] = bitno;
+ word >>= 1;
+ }
+ }
else
- {
- for (bitno = bitoff; word; bitno++)
- {
- if (word & 1)
- {
- list[count++] = bitno;
- if (count >= num)
- {
- *next = bitno + 1;
- return count;
- }
- }
- word >>= 1;
- }
- }
+ {
+ for (bitno = bitoff; word; bitno++)
+ {
+ if (word & 1)
+ {
+ list[count++] = bitno;
+ if (count >= num)
+ {
+ *next = bitno + 1;
+ return count;
+ }
+ }
+ word >>= 1;
+ }
+ }
}
*next = bitoff;
@@ -398,7 +398,7 @@ vbitset_copy1 (bitset dst, bitset src)
memcpy (dstp, srcp, sizeof (bitset_word) * ssize);
memset (dstp + sizeof (bitset_word) * ssize, 0,
- sizeof (bitset_word) * (dsize - ssize));
+ sizeof (bitset_word) * (dsize - ssize));
}
@@ -423,7 +423,7 @@ vbitset_not (bitset dst, bitset src)
vbitset_unused_clear (dst);
memset (dstp + sizeof (bitset_word) * ssize, 0,
- sizeof (bitset_word) * (dsize - ssize));
+ sizeof (bitset_word) * (dsize - ssize));
}
@@ -438,19 +438,19 @@ vbitset_equal_p (bitset dst, bitset src)
for (i = 0; i < min (ssize, dsize); i++)
if (*srcp++ != *dstp++)
- return 0;
+ return 0;
if (ssize > dsize)
{
for (; i < ssize; i++)
- if (*srcp++)
- return 0;
+ if (*srcp++)
+ return 0;
}
else
{
for (; i < dsize; i++)
- if (*dstp++)
- return 0;
+ if (*dstp++)
+ return 0;
}
return 1;
@@ -468,13 +468,13 @@ vbitset_subset_p (bitset dst, bitset src)
for (i = 0; i < min (ssize, dsize); i++, dstp++, srcp++)
if (*dstp != (*srcp | *dstp))
- return 0;
+ return 0;
if (ssize > dsize)
{
for (; i < ssize; i++)
- if (*srcp++)
- return 0;
+ if (*srcp++)
+ return 0;
}
return 1;
@@ -492,7 +492,7 @@ vbitset_disjoint_p (bitset dst, bitset src)
for (i = 0; i < min (ssize, dsize); i++)
if (*srcp++ & *dstp++)
- return 0;
+ return 0;
return 1;
}
@@ -551,10 +551,10 @@ vbitset_and_cmp (bitset dst, bitset src1, bitset src2)
bitset_word tmp = *src1p++ & *src2p++;
if (*dstp != tmp)
- {
- changed = 1;
- *dstp = tmp;
- }
+ {
+ changed = 1;
+ *dstp = tmp;
+ }
}
if (ssize2 > ssize1)
@@ -566,10 +566,10 @@ vbitset_and_cmp (bitset dst, bitset src1, bitset src2)
for (; i < ssize1; i++, dstp++)
{
if (*dstp != 0)
- {
- changed = 1;
- *dstp = 0;
- }
+ {
+ changed = 1;
+ *dstp = 0;
+ }
}
memset (dstp, 0, sizeof (bitset_word) * (dsize - ssize1));
@@ -604,14 +604,14 @@ vbitset_andn (bitset dst, bitset src1, bitset src2)
if (ssize2 > ssize1)
{
for (; i < ssize2; i++)
- *dstp++ = 0;
+ *dstp++ = 0;
memset (dstp, 0, sizeof (bitset_word) * (dsize - ssize2));
}
else
{
for (; i < ssize1; i++)
- *dstp++ = *src1p++;
+ *dstp++ = *src1p++;
memset (dstp, 0, sizeof (bitset_word) * (dsize - ssize1));
}
@@ -644,37 +644,37 @@ vbitset_andn_cmp (bitset dst, bitset src1, bitset src2)
bitset_word tmp = *src1p++ & ~(*src2p++);
if (*dstp != tmp)
- {
- changed = 1;
- *dstp = tmp;
- }
+ {
+ changed = 1;
+ *dstp = tmp;
+ }
}
if (ssize2 > ssize1)
{
for (; i < ssize2; i++, dstp++)
- {
- if (*dstp != 0)
- {
- changed = 1;
- *dstp = 0;
- }
- }
+ {
+ if (*dstp != 0)
+ {
+ changed = 1;
+ *dstp = 0;
+ }
+ }
memset (dstp, 0, sizeof (bitset_word) * (dsize - ssize2));
}
else
{
for (; i < ssize1; i++, dstp++)
- {
- bitset_word tmp = *src1p++;
+ {
+ bitset_word tmp = *src1p++;
- if (*dstp != tmp)
- {
- changed = 1;
- *dstp = tmp;
- }
- }
+ if (*dstp != tmp)
+ {
+ changed = 1;
+ *dstp = tmp;
+ }
+ }
memset (dstp, 0, sizeof (bitset_word) * (dsize - ssize1));
}
@@ -745,10 +745,10 @@ vbitset_or_cmp (bitset dst, bitset src1, bitset src2)
bitset_word tmp = *src1p++ | *src2p++;
if (*dstp != tmp)
- {
- changed = 1;
- *dstp = tmp;
- }
+ {
+ changed = 1;
+ *dstp = tmp;
+ }
}
if (ssize2 > ssize1)
@@ -762,10 +762,10 @@ vbitset_or_cmp (bitset dst, bitset src1, bitset src2)
bitset_word tmp = *src1p++;
if (*dstp != tmp)
- {
- changed = 1;
- *dstp = tmp;
- }
+ {
+ changed = 1;
+ *dstp = tmp;
+ }
}
memset (dstp, 0, sizeof (bitset_word) * (dsize - ssize1));
@@ -836,10 +836,10 @@ vbitset_xor_cmp (bitset dst, bitset src1, bitset src2)
bitset_word tmp = *src1p++ ^ *src2p++;
if (*dstp != tmp)
- {
- changed = 1;
- *dstp = tmp;
- }
+ {
+ changed = 1;
+ *dstp = tmp;
+ }
}
if (ssize2 > ssize1)
@@ -853,10 +853,10 @@ vbitset_xor_cmp (bitset dst, bitset src1, bitset src2)
bitset_word tmp = *src1p++;
if (*dstp != tmp)
- {
- changed = 1;
- *dstp = tmp;
- }
+ {
+ changed = 1;
+ *dstp = tmp;
+ }
}
memset (dstp, 0, sizeof (bitset_word) * (dsize - ssize1));
@@ -926,10 +926,10 @@ vbitset_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
bitset_word tmp = (*src1p++ & *src2p++) | *src3p++;
if (*dstp != tmp)
- {
- changed = 1;
- *dstp = tmp;
- }
+ {
+ changed = 1;
+ *dstp = tmp;
+ }
}
return changed;
}
@@ -993,10 +993,10 @@ vbitset_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
bitset_word tmp = (*src1p++ & ~(*src2p++)) | *src3p++;
if (*dstp != tmp)
- {
- changed = 1;
- *dstp = tmp;
- }
+ {
+ changed = 1;
+ *dstp = tmp;
+ }
}
return changed;
}
@@ -1060,10 +1060,10 @@ vbitset_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
bitset_word tmp = (*src1p++ | *src2p++) & *src3p++;
if (*dstp != tmp)
- {
- changed = 1;
- *dstp = tmp;
- }
+ {
+ changed = 1;
+ *dstp = tmp;
+ }
}
return changed;
}