| 259 | } |
| 260 | |
| 261 | UArray *UArray_asBits(const UArray *self) { |
| 262 | UArray *out = UArray_new(); |
| 263 | size_t i, max = UArray_sizeInBytes(self); |
| 264 | uint8_t *data = self->data; |
| 265 | |
| 266 | for (i = 0; i < max; i++) { |
| 267 | uint8_t b = data[i]; |
| 268 | int j; |
| 269 | |
| 270 | for (j = 0; j < 8; j++) { |
| 271 | int v = (b >> j) & 0x1; |
| 272 | UArray_appendCString_(out, v ? "1" : "0"); |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | return out; |
| 277 | } |
| 278 | |
| 279 | size_t UArray_bitCount(UArray *self) { |
| 280 | const unsigned char map[] = { |
nothing calls this directly
no test coverage detected