# HG changeset patch # User Akim Demaille # Date 1552548714 -3600 # Node ID e60e51dd1612e6b77767e7298e336fc868d91a18 # Parent 3ac749aa0041f27879b1d3fa7305e959cc2ccd7b bitset: style changes * lib/bitset/table.c: Use NULL, not 0, for pointers. Formatting changes. (tbitset_list): Reduce scopes. diff -r 3ac749aa0041 -r e60e51dd1612 ChangeLog --- a/ChangeLog Sat Mar 16 22:56:21 2019 +0100 +++ b/ChangeLog Thu Mar 14 08:31:54 2019 +0100 @@ -1,3 +1,10 @@ +2019-03-14 Akim Demaille + + bitset: style changes. + * lib/bitset/table.c: Use NULL, not 0, for pointers. + Formatting changes. + (tbitset_list): Reduce scopes. + 2019-03-16 Bruno Haible fatal-signal: Pass the signal number to the action. diff -r 3ac749aa0041 -r e60e51dd1612 lib/bitset/table.c --- a/lib/bitset/table.c Sat Mar 16 22:56:21 2019 +0100 +++ b/lib/bitset/table.c Thu Mar 14 08:31:54 2019 +0100 @@ -300,7 +300,7 @@ abort (); case EBITSET_FIND: - return 0; + return NULL; case EBITSET_CREATE: if (eindex >= size) @@ -588,8 +588,8 @@ /* Find list of up to NUM bits set in BSET starting from and including - *NEXT and store in array LIST. Return with actual number of bits - found and with *NEXT indicating where search stopped. */ + *NEXT and store in array LIST. Return with actual number of bits + found and with *NEXT indicating where search stopped. */ static bitset_bindex tbitset_list (bitset bset, bitset_bindex *list, bitset_bindex num, bitset_bindex *next) @@ -607,17 +607,14 @@ if (bitno % EBITSET_ELT_BITS) { /* We need to start within an element. This is not very common. */ - tbitset_elt *elt = elts[eindex]; if (elt) { - bitset_windex woffset; bitset_word *srcp = EBITSET_WORDS (elt); + bitset_windex woffset = eindex * EBITSET_ELT_WORDS; - bitset_windex windex = bitno / BITSET_WORD_BITS; - woffset = eindex * EBITSET_ELT_WORDS; - - for (; (windex - woffset) < EBITSET_ELT_WORDS; windex++) + for (bitset_windex windex = bitno / BITSET_WORD_BITS; + (windex - woffset) < EBITSET_ELT_WORDS; windex++) { bitset_word word = srcp[windex - woffset] >> (bitno % BITSET_WORD_BITS);