MCPcopy Create free account
hub / github.com/F-Stack/f-stack / bit_nset

Function bit_nset

freebsd/sys/bitstring.h:159–175  ·  view source on GitHub ↗

Set bits start ... stop inclusive in bit string. */

Source from the content-addressed store, hash-verified

157
158/* Set bits start ... stop inclusive in bit string. */
159static inline void
160bit_nset(bitstr_t *_bitstr, int _start, int _stop)
161{
162 bitstr_t *_stopbitstr;
163
164 _stopbitstr = _bitstr + _bit_idx(_stop);
165 _bitstr += _bit_idx(_start);
166
167 if (_bitstr == _stopbitstr) {
168 *_bitstr |= _bit_make_mask(_start, _stop);
169 } else {
170 *_bitstr |= _bit_make_mask(_start, _BITSTR_BITS - 1);
171 while (++_bitstr < _stopbitstr)
172 *_bitstr = _BITSTR_MASK;
173 *_stopbitstr |= _bit_make_mask(0, _stop);
174 }
175}
176
177/* Clear bits start ... stop inclusive in bit string. */
178static inline void

Callers 1

optimize_unrFunction · 0.85

Calls 2

_bit_idxFunction · 0.85
_bit_make_maskFunction · 0.85

Tested by

no test coverage detected