diff options
author | Jens Arnold <amiconn@rockbox.org> | 2009-06-07 21:27:05 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2009-06-07 21:27:05 +0000 |
commit | 1d6df54df27cb41c02226678a2c8f9feddd1a1e0 (patch) | |
tree | 5fdc6dd98ac0208f5c3351b062063af6914cbefb /apps/plugins/alpine_cdc.c | |
parent | c3182ec333982e961d3babfbdb1125fd5bac7fb8 (diff) | |
download | rockbox-1d6df54df27cb41c02226678a2c8f9feddd1a1e0.tar.gz rockbox-1d6df54df27cb41c02226678a2c8f9feddd1a1e0.zip |
Convert a number of places in core and plugins to use the BIT_N() macro instead of 1<<n. Speeds up things on SH1, and also reduces core binsize. Most notable speedups: 1 bit lcd driver: drawpixel +20%, drawline + 27%, hline +5%; jpeg viewer: +8% for 1/8 scaling. Other targets are unaffected.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21205 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/alpine_cdc.c')
-rw-r--r-- | apps/plugins/alpine_cdc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/plugins/alpine_cdc.c b/apps/plugins/alpine_cdc.c index a7aeec306f..494fa17842 100644 --- a/apps/plugins/alpine_cdc.c +++ b/apps/plugins/alpine_cdc.c | |||
@@ -669,16 +669,16 @@ void dump_packet(char* dest, int dst_size, char* src, int n) | |||
669 | 669 | ||
670 | bool bit_test(unsigned char* buf, unsigned bit) | 670 | bool bit_test(unsigned char* buf, unsigned bit) |
671 | { | 671 | { |
672 | return (buf[bit/4] & (0x01 << bit%4)) != 0; | 672 | return (buf[bit>>2] & BIT_N(bit&3)) != 0; |
673 | } | 673 | } |
674 | 674 | ||
675 | 675 | ||
676 | void bit_set(unsigned char* buf, unsigned bit, bool val) | 676 | void bit_set(unsigned char* buf, unsigned bit, bool val) |
677 | { | 677 | { |
678 | if (val) | 678 | if (val) |
679 | buf[bit/4] |= (0x01 << bit%4); | 679 | buf[bit>>2] |= BIT_N(bit&3); |
680 | else | 680 | else |
681 | buf[bit/4] &= ~(0x01 << bit%4); | 681 | buf[bit>>2] &= ~BIT_N(bit&3); |
682 | } | 682 | } |
683 | 683 | ||
684 | 684 | ||