Skip to content

Commit d832b58

Browse files
committed
Add missing comments to Flecs headers (#2010)
Summary: Pull Request resolved: #2010 TSIA Differential Revision: D96177556
1 parent 9dfb8c0 commit d832b58

File tree

143 files changed

+13853
-8332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+13853
-8332
lines changed

distr/flecs.c

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,59 +49,97 @@
4949
extern "C" {
5050
#endif
5151

52+
/** A bitset data structure for compact boolean storage. */
5253
typedef struct ecs_bitset_t {
53-
uint64_t *data;
54-
int32_t count;
55-
ecs_size_t size;
54+
uint64_t *data; /**< Array of 64-bit words storing the bits. */
55+
int32_t count; /**< Number of bits in the bitset. */
56+
ecs_size_t size; /**< Allocated capacity in 64-bit words. */
5657
} ecs_bitset_t;
5758

58-
/** Initialize bitset. */
59+
/** Initialize a bitset.
60+
*
61+
* @param bs The bitset to initialize.
62+
*/
5963
FLECS_DBG_API
6064
void flecs_bitset_init(
6165
ecs_bitset_t *bs);
6266

63-
/** Deinitialize bitset. */
67+
/** Deinitialize a bitset.
68+
*
69+
* @param bs The bitset to deinitialize.
70+
*/
6471
FLECS_DBG_API
6572
void flecs_bitset_fini(
6673
ecs_bitset_t *bs);
6774

68-
/** Add n elements to bitset. */
75+
/** Add n elements to a bitset.
76+
*
77+
* @param bs The bitset to add to.
78+
* @param count Number of bits to add.
79+
*/
6980
FLECS_DBG_API
7081
void flecs_bitset_addn(
7182
ecs_bitset_t *bs,
7283
int32_t count);
7384

74-
/** Ensure element exists. */
85+
/** Ensure an element exists.
86+
*
87+
* @param bs The bitset to ensure capacity for.
88+
* @param count Minimum number of bits the bitset must hold.
89+
*/
7590
FLECS_DBG_API
7691
void flecs_bitset_ensure(
7792
ecs_bitset_t *bs,
7893
int32_t count);
7994

80-
/** Set element. */
95+
/** Set an element.
96+
*
97+
* @param bs The bitset to modify.
98+
* @param elem Index of the bit to set.
99+
* @param value The boolean value to set.
100+
*/
81101
FLECS_DBG_API
82102
void flecs_bitset_set(
83103
ecs_bitset_t *bs,
84104
int32_t elem,
85105
bool value);
86106

87-
/** Get element. */
107+
/** Get an element.
108+
*
109+
* @param bs The bitset to read from.
110+
* @param elem Index of the bit to get.
111+
* @return The boolean value of the bit.
112+
*/
88113
FLECS_DBG_API
89114
bool flecs_bitset_get(
90115
const ecs_bitset_t *bs,
91116
int32_t elem);
92117

93-
/** Return number of elements. */
118+
/** Return the number of elements.
119+
*
120+
* @param bs The bitset.
121+
* @return The number of bits in the bitset.
122+
*/
94123
FLECS_DBG_API
95124
int32_t flecs_bitset_count(
96125
const ecs_bitset_t *bs);
97126

98-
/** Remove from bitset. */
127+
/** Remove from a bitset.
128+
*
129+
* @param bs The bitset to remove from.
130+
* @param elem Index of the bit to remove.
131+
*/
99132
FLECS_DBG_API
100133
void flecs_bitset_remove(
101134
ecs_bitset_t *bs,
102135
int32_t elem);
103136

104-
/** Swap values in bitset. */
137+
/** Swap values in a bitset.
138+
*
139+
* @param bs The bitset.
140+
* @param elem_a Index of the first bit to swap.
141+
* @param elem_b Index of the second bit to swap.
142+
*/
105143
FLECS_DBG_API
106144
void flecs_bitset_swap(
107145
ecs_bitset_t *bs,

0 commit comments

Comments
 (0)