Yes, but looking at the results further,
it doesn't look like the original function carries the bit that drops off the left,
and feeds it into the right of the array, so it's not exactly what I'm after.
If you rotate it enough, the array will end up all zeros.
EDIT,,
this is the big rotate I really wanted (shift left though), but I didn't do it.
Code:
void shiftl(void *object, size_t size) {
unsigned char *byte;
byte = object; // NEW
unsigned char leftbit = byte[1] & (1 << (CHAR_BIT - 1)) ? 1 : 0; // NEW
for ( byte = object; size--; ++byte ) {
unsigned char bit = 0;
if ( size ) {
bit = byte[1] & (1 << (CHAR_BIT - 1)) ? 1 : 0;
}
else {
bit = leftbit; // NEW
} // NEW
*byte <<= 1;
*byte |= bit;
}
}