- Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
+
+ Copyright (C) 2002-2003, 2006, 2009-2013 Free Software Foundation,
+ Inc.
+
(at your option) any later version.
This program is distributed in the hope that it will be useful,
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*/
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
found and with *NEXT indicating where search stopped. */
static bitset_bindex
abitset_small_list (bitset src, bitset_bindex *list,
found and with *NEXT indicating where search stopped. */
static bitset_bindex
abitset_small_list (bitset src, bitset_bindex *list,
/* Reset bit BITNO in bitset DST. */
static void
abitset_reset (bitset dst ATTRIBUTE_UNUSED,
/* Reset bit BITNO in bitset DST. */
static void
abitset_reset (bitset dst 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
{
/* This should never occur for abitsets since we should always hit
the cache. It is likely someone is trying to access outside the
/* Test bit BITNO in bitset SRC. */
static bool
abitset_test (bitset src ATTRIBUTE_UNUSED,
/* Test bit BITNO in bitset SRC. */
static bool
abitset_test (bitset src ATTRIBUTE_UNUSED,
found and with *NEXT indicating where search stopped. */
static bitset_bindex
abitset_list (bitset src, bitset_bindex *list,
found and with *NEXT indicating where search stopped. */
static bitset_bindex
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++)
{
/* Many bitsets are zero, so make this common case fast. */
for (windex = 0; windex < size && !srcp[windex]; 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++;
- }
+ {
+ /* 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]))
bitoff = windex * BITSET_WORD_BITS;
}
for (; windex < size; windex++, bitoff += BITSET_WORD_BITS)
{
if (!(word = srcp[windex]))
for (i = 0; i < size; i++, dstp++, srcp++)
if (*dstp != (*srcp | *dstp))
for (i = 0; i < size; i++, dstp++, srcp++)
if (*dstp != (*srcp | *dstp))