From ac97642962d1032f56105b933c046a8fad16a024 Mon Sep 17 00:00:00 2001 From: Kp Date: Sun, 9 Jun 2013 19:23:16 +0000 Subject: [PATCH] Simplify left rotation to help the compiler --- main/text.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/main/text.c b/main/text.c index 8b22b4aef..ac2eb1fa4 100644 --- a/main/text.c +++ b/main/text.c @@ -42,17 +42,10 @@ void free_text() } // rotates a byte left one bit, preserving the bit falling off the right -void -encode_rotate_left(char *c) +static void encode_rotate_left(char *c) { - int found; - - found = 0; - if (*c & 0x80) - found = 1; - *c = *c << 1; - if (found) - *c |= 0x01; + unsigned char v = *c; + *c = (v >> 7) | (v << 1); } #define BITMAP_TBL_XOR 0xD3