Simplify left rotation to help the compiler
This commit is contained in:
parent
c60c2dea30
commit
ac97642962
13
main/text.c
13
main/text.c
|
@ -42,17 +42,10 @@ void free_text()
|
||||||
}
|
}
|
||||||
|
|
||||||
// rotates a byte left one bit, preserving the bit falling off the right
|
// rotates a byte left one bit, preserving the bit falling off the right
|
||||||
void
|
static void encode_rotate_left(char *c)
|
||||||
encode_rotate_left(char *c)
|
|
||||||
{
|
{
|
||||||
int found;
|
unsigned char v = *c;
|
||||||
|
*c = (v >> 7) | (v << 1);
|
||||||
found = 0;
|
|
||||||
if (*c & 0x80)
|
|
||||||
found = 1;
|
|
||||||
*c = *c << 1;
|
|
||||||
if (found)
|
|
||||||
*c |= 0x01;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define BITMAP_TBL_XOR 0xD3
|
#define BITMAP_TBL_XOR 0xD3
|
||||||
|
|
Loading…
Reference in a new issue