# HG changeset patch # User michael # Date 1230299400 0 # Node ID 5b63a9da46f42e8f9a78fede21eb0eca4b077b7e # Parent 75328d3e788e7e012de9e14900170e48be8fbddc Avoid negation in put_line(). diff -r 75328d3e788e -r 5b63a9da46f4 faxcompr.c --- a/faxcompr.c Fri Dec 26 13:48:09 2008 +0000 +++ b/faxcompr.c Fri Dec 26 13:50:00 2008 +0000 @@ -232,19 +232,19 @@ static void put_line(uint8_t *dst, int size, int width, const int *runs) { PutBitContext pb; - int run, mode = 1, pix_left = width, run_idx = 0; + int run, mode = ~0, pix_left = width, run_idx = 0; init_put_bits(&pb, dst, size*8); while(pix_left > 0){ run = runs[run_idx++]; - mode = !mode; + mode = ~mode; if(!run){ continue; } pix_left -= run; for(; run > 16; run -= 16) - put_sbits(&pb, 16, -mode); - put_sbits(&pb, run, -mode); + put_sbits(&pb, 16, mode); + put_sbits(&pb, run, mode); } }