From af5ea0f59923fa1d9199f07fe67a9b070c672beb Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 14 Nov 2020 16:04:10 +0100 Subject: [PATCH] bitset: comment changes * lib/bitset.c: Move some documenting comments to... * lib/bitset.h: here. * lib/bitset/array.c: Fix some comments. --- ChangeLog | 7 +++++++ lib/bitset.c | 4 ---- lib/bitset.h | 20 ++++++++++++-------- lib/bitset/array.c | 6 +++--- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4abbcd385f..f25a948ebf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2020-11-15 Akim Demaille + + bitset: comment changes + * lib/bitset.c: Move some documenting comments to... + * lib/bitset.h: here. + * lib/bitset/array.c: Fix some comments. + 2020-11-14 Paul Eggert careadlinkat: warn better about GCC bug 93644 diff --git a/lib/bitset.c b/lib/bitset.c index 70752b621b..06a47ad640 100644 --- a/lib/bitset.c +++ b/lib/bitset.c @@ -207,8 +207,6 @@ bitset_type_name_get (bitset bset) } -/* Find next bit set in SRC starting from and including BITNO. - Return BITSET_BINDEX_MAX if SRC empty. */ bitset_bindex bitset_next (bitset src, bitset_bindex bitno) { @@ -228,8 +226,6 @@ bitset_compatible_p (bitset bset1, bitset bset2) } -/* Find previous bit set in SRC starting from and including BITNO. - Return BITSET_BINDEX_MAX if SRC empty. */ bitset_bindex bitset_prev (bitset src, bitset_bindex bitno) { diff --git a/lib/bitset.h b/lib/bitset.h index a13b8d4d16..172b2c575f 100644 --- a/lib/bitset.h +++ b/lib/bitset.h @@ -282,17 +282,21 @@ bitset_test (bitset bset, bitset_bindex bitno) /* Return true if both bitsets are of the same type and size. */ bool bitset_compatible_p (bitset bset1, bitset bset2); -/* Find next set bit from the given bit index. */ -bitset_bindex bitset_next (bitset, bitset_bindex); +/* Find next bit set in SRC starting from and including BITNO. + Return BITSET_BINDEX_MAX if SRC empty. */ +bitset_bindex bitset_next (bitset src, bitset_bindex bitno); -/* Find previous set bit from the given bit index. */ -bitset_bindex bitset_prev (bitset, bitset_bindex); +/* Find previous bit set in SRC starting from and including BITNO. + Return BITSET_BINDEX_MAX if SRC empty. */ +bitset_bindex bitset_prev (bitset src, bitset_bindex bitno); -/* Find first set bit. */ -bitset_bindex bitset_first (bitset); +/* Find first set bit. + Return BITSET_BINDEX_MAX if SRC empty. */ +bitset_bindex bitset_first (bitset src); -/* Find last set bit. */ -bitset_bindex bitset_last (bitset); +/* Find last set bit. + Return BITSET_BINDEX_MAX if SRC empty. */ +bitset_bindex bitset_last (bitset src); /* Return nonzero if this is the only set bit. */ bool bitset_only_set_p (bitset, bitset_bindex); diff --git a/lib/bitset/array.c b/lib/bitset/array.c index f350b53eb4..1db5838914 100644 --- a/lib/bitset/array.c +++ b/lib/bitset/array.c @@ -42,7 +42,7 @@ abitset_resize (bitset src, bitset_bindex size) return size; } -/* Find list of up to NUM bits set in BSET starting from and including +/* Find list of up to NUM bits set in SRC starting from and including *NEXT and store in array LIST. Return with actual number of bits found and with *NEXT indicating where search stopped. */ static bitset_bindex @@ -130,7 +130,7 @@ abitset_test (bitset src MAYBE_UNUSED, } -/* Find list of up to NUM bits set in BSET in reverse order, starting +/* Find list of up to NUM bits set in SRC in reverse order, starting from and including NEXT and store in array LIST. Return with actual number of bits found and with *NEXT indicating where search stopped. */ @@ -182,7 +182,7 @@ abitset_list_reverse (bitset src, bitset_bindex *list, } -/* Find list of up to NUM bits set in BSET starting from and including +/* Find list of up to NUM bits set in SRC starting from and including *NEXT and store in array LIST. Return with actual number of bits found and with *NEXT indicating where search stopped. */ static bitset_bindex -- 2.39.5