Clang Format Blinds (#253)

* Quick cleanup on bitset docs

* Clang format blind.h/c

* Replace `_` with `s_` for functions

* Fix newline size for macros.

* Fix format for ci

* Add macro for "unused" attribute
This commit is contained in:
Rickey
2025-11-25 13:47:44 -08:00
committed by GitHub
parent 2c32ff69e3
commit 09dd996181
10 changed files with 96 additions and 77 deletions
+15 -11
View File
@@ -110,10 +110,14 @@ void bitset_set_idx(Bitset* bitset, int idx, bool on);
*/
bool bitset_get_idx(Bitset* bitset, int idx);
// Get the next free (set to 0) index in the bitset.
// It also sets the bit which it maybe should do... It really shouldn't do two things
// But it's such a fast operation idk. // TODO: decide what you wanna do
int bitset_allocate_idx(Bitset* bitset);
/**
* @brief Set the next free index in the bitset and return the index value
*
* @param bitset A @ref Bitset to operate on
*
* @return The index of the bit that was set
*/
int bitset_set_next_free_idx(Bitset* bitset);
/**
* @brief Clear the bitset, all to 0
@@ -190,13 +194,13 @@ int bitset_itr_next(BitsetItr* itr);
* @param name the name of the bitset
* @param capacity the capacity of the bitset
*/
#define BITSET_DEFINE(name, capacity) \
static uint32_t name##_w[BITSET_ARRAY_SIZE] = {0}; \
static Bitset name = { \
.w = name##_w, \
.nbits = BITSET_BITS_PER_WORD, \
.nwords = BITSET_ARRAY_SIZE, \
.cap = capacity, \
#define BITSET_DEFINE(name, capacity) \
static uint32_t name##_w[BITSET_ARRAY_SIZE] = {0}; \
static Bitset name = { \
.w = name##_w, \
.nbits = BITSET_BITS_PER_WORD, \
.nwords = BITSET_ARRAY_SIZE, \
.cap = capacity, \
};
#endif // BITSET_H