FreeCalypso > hg > themwi-system-sw
view libutil/bitfunc.c @ 269:ff1ed366c84d
doc/Number-database: first draft written
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 26 Nov 2023 14:51:22 -0800 (19 months ago) |
parents | 05d01e810217 |
children |
line wrap: on
line source
/* * Some bit manipulation functions. */ #include <stdint.h> #include "osmo_bits.h" void uint16_to_bits(uint16_t word, ubit_t *out, unsigned nbits) { unsigned n; for (n = 0; n < nbits; n++) out[n] = (word >> (nbits-n-1)) & 1; }