I want to inflate an unsigned char to an uint64_t by repeating each bit 8 times. E.g.
unsigned char
uint64_t
char -> uint64_t 0x00 -> 0x00 0x01 ->
If you're looking for efficiency use a lookup table: a static array of 256 entries, each already holding the required result. You can use your code above to generate it.