diff options
author | David Robillard <d@drobilla.net> | 2021-07-01 00:05:22 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-07-17 19:58:17 -0400 |
commit | 4b266e2f39a8d3a49b58c861c7fd852911cf7fb0 (patch) | |
tree | dc12d618dc52b640b82e522917b238e38af033b3 /include/zix/bitset.h | |
parent | 46f9327b06e866e3180c1924a0afa0afd8b0b5c5 (diff) | |
download | zix-4b266e2f39a8d3a49b58c861c7fd852911cf7fb0.tar.gz zix-4b266e2f39a8d3a49b58c861c7fd852911cf7fb0.tar.bz2 zix-4b266e2f39a8d3a49b58c861c7fd852911cf7fb0.zip |
Use line comments where appropriate
Diffstat (limited to 'include/zix/bitset.h')
-rw-r--r-- | include/zix/bitset.h | 36 |
1 files changed, 9 insertions, 27 deletions
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); |