Mon, 18 Aug 2003 09:59:41 +0000
added big-endian support
bitblt_table_gen.c | file | annotate | diff | revisions |
1.1 --- a/bitblt_table_gen.c Thu Apr 10 09:02:12 2003 +0000 1.2 +++ b/bitblt_table_gen.c Mon Aug 18 09:59:41 2003 +0000 1.3 @@ -2,7 +2,7 @@ 1.4 * tumble: build a PDF file from image files 1.5 * 1.6 * bitblt table generator 1.7 - * $Id: bitblt_table_gen.c,v 1.7 2003/03/13 00:57:05 eric Exp $ 1.8 + * $Id: bitblt_table_gen.c,v 1.8 2003/08/18 01:59:41 eric Exp $ 1.9 * Copyright 2003 Eric Smith <eric@brouhaha.com> 1.10 * 1.11 * This program is free software; you can redistribute it and/or modify 1.12 @@ -71,6 +71,16 @@ 1.13 int count = 0; 1.14 int i; 1.15 1.16 +#ifdef WORDS_BIGENDIAN 1.17 + for (i = 7 - start_bit; i >= 0; i--) 1.18 + { 1.19 + int bit = (byte >> i) & 1; 1.20 + if (bit == desired_val) 1.21 + count++; 1.22 + else 1.23 + break; 1.24 + } 1.25 +#else 1.26 for (i = start_bit; i < 8; i++) 1.27 { 1.28 int bit = (byte >> i) & 1; 1.29 @@ -79,6 +89,8 @@ 1.30 else 1.31 break; 1.32 } 1.33 +#endif 1.34 + 1.35 return (count); 1.36 } 1.37