From: Akim Demaille Date: Thu, 14 Mar 2019 07:31:54 +0000 (+0100) Subject: bitset: style changes X-Git-Tag: v1.0~5024 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=3817922f8ace7348dbfccf299f91bd64a98d1409;p=gnulib.git bitset: style changes * lib/bitset/table.c: Use NULL, not 0, for pointers. Formatting changes. (tbitset_list): Reduce scopes. --- diff --git a/ChangeLog b/ChangeLog index ee12ff17d8..a3fbce6e74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 --git a/lib/bitset/table.c b/lib/bitset/table.c index 8351cf7848..a129c8712a 100644 --- a/lib/bitset/table.c +++ b/lib/bitset/table.c @@ -300,7 +300,7 @@ tbitset_elt_find (bitset bset, bitset_bindex bindex, abort (); case EBITSET_FIND: - return 0; + return NULL; case EBITSET_CREATE: if (eindex >= size) @@ -588,8 +588,8 @@ tbitset_list_reverse (bitset bset, bitset_bindex *list, /* 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 @@ tbitset_list (bitset bset, bitset_bindex *list, 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);