diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-07 20:45:08 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-07 20:45:08 +0000 |
commit | 7ee606dd508cedf07c79f4871911dbbbeb2e9440 (patch) | |
tree | fe58c0e358d54ef7912f1d998493dc0e40326547 /gcc/sbitmap.h | |
parent | 3f95e81d60a3b19e0b124d134ca130e42827c447 (diff) | |
download | gcc-7ee606dd508cedf07c79f4871911dbbbeb2e9440.tar.gz |
* sbitmap.h (sbitmap_iter_init): Consistently treat bit_num as
the current bit index with no modulo.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100720 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sbitmap.h')
-rw-r--r-- | gcc/sbitmap.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/sbitmap.h b/gcc/sbitmap.h index fe23cbf91fa..7f40d8ae43c 100644 --- a/gcc/sbitmap.h +++ b/gcc/sbitmap.h @@ -66,7 +66,7 @@ typedef struct { /* The current word index. */ unsigned int word_num; - /* The current bit index. */ + /* The current bit index (not modulo SBITMAP_ELT_BITS). */ unsigned int bit_num; /* The words currently visited. */ @@ -80,14 +80,15 @@ static inline void sbitmap_iter_init (sbitmap_iterator *i, sbitmap bmp, unsigned int min) { i->word_num = min / (unsigned int) SBITMAP_ELT_BITS; - i->bit_num = min % (unsigned int) SBITMAP_ELT_BITS; + i->bit_num = min; i->size = bmp->size; i->ptr = bmp->elms; if (i->word_num >= i->size) i->word = 0; else - i->word = i->ptr[i->word_num] >> i->bit_num; + i->word = (i->ptr[i->word_num] + >> (i->bit_num % (unsigned int) SBITMAP_ELT_BITS)); } /* Return true if we have more bits to visit, in which case *N is set |