From 4b266e2f39a8d3a49b58c861c7fd852911cf7fb0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 1 Jul 2021 00:05:22 -0400 Subject: Use line comments where appropriate --- include/zix/bitset.h | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) (limited to 'include/zix/bitset.h') diff --git a/include/zix/bitset.h b/include/zix/bitset.h index 2abf578..07f133f 100644 --- a/include/zix/bitset.h +++ b/include/zix/bitset.h @@ -31,59 +31,41 @@ @{ */ -/** - A bitset (always referred to by pointer, actually an array). -*/ +/// A bitset (always referred to by pointer, actually an array) typedef unsigned long ZixBitset; -/** - Tally of the number of bits in one ZixBitset element. -*/ +/// Tally of the number of bits in one ZixBitset element typedef uint8_t ZixBitsetTally; -/** - The number of bits per ZixBitset array element. -*/ +/// The number of bits per ZixBitset array element #define ZIX_BITSET_BITS_PER_ELEM (CHAR_BIT * sizeof(ZixBitset)) -/** - The number of bitset elements needed for the given number of bits. -*/ +/// The number of bitset elements needed for the given number of bits #define ZIX_BITSET_ELEMS(n_bits) \ (((n_bits) / ZIX_BITSET_BITS_PER_ELEM) + \ ((n_bits) % ZIX_BITSET_BITS_PER_ELEM ? 1 : 0)) -/** - Clear a Bitset. -*/ +/// Clear a Bitset ZIX_API void zix_bitset_clear(ZixBitset* b, ZixBitsetTally* t, size_t n_bits); -/** - Set bit `i` in `t` to 1. -*/ +/// Set bit `i` in `t` to 1 ZIX_API void zix_bitset_set(ZixBitset* b, ZixBitsetTally* t, size_t i); -/** - Clear bit `i` in `t` (set to 0). -*/ +/// Clear bit `i` in `t` (set to 0) ZIX_API void zix_bitset_reset(ZixBitset* b, ZixBitsetTally* t, size_t i); -/** - Return the `i`th bit in `t`. -*/ +/// Return the `i`th bit in `t` ZIX_PURE_API bool zix_bitset_get(const ZixBitset* b, size_t i); -/** - Return the number of set bits in `b` up to bit `i` (non-inclusive). -*/ +/// Return the number of set bits in `b` up to bit `i` (non-inclusive) ZIX_PURE_API size_t zix_bitset_count_up_to(const ZixBitset* b, const ZixBitsetTally* t, size_t i); -- cgit v1.2.1