summaryrefslogtreecommitdiff
path: root/apps/replaygain.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2009-06-07 21:27:05 +0000
committerJens Arnold <amiconn@rockbox.org>2009-06-07 21:27:05 +0000
commit1d6df54df27cb41c02226678a2c8f9feddd1a1e0 (patch)
tree5fdc6dd98ac0208f5c3351b062063af6914cbefb /apps/replaygain.c
parentc3182ec333982e961d3babfbdb1125fd5bac7fb8 (diff)
downloadrockbox-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/replaygain.c')
-rw-r--r--apps/replaygain.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/replaygain.c b/apps/replaygain.c
index 8f6fe4c738..90944f91d0 100644
--- a/apps/replaygain.c
+++ b/apps/replaygain.c
@@ -134,12 +134,12 @@ static long fp_div(long x, long y)
134 y = -y; 134 y = -y;
135 } 135 }
136 136
137 while ((x & (1 << (30 - msb))) == 0) 137 while ((x & BIT_N(30 - msb)) == 0)
138 { 138 {
139 msb++; 139 msb++;
140 } 140 }
141 141
142 while ((y & (1 << lsb)) == 0) 142 while ((y & BIT_N(lsb)) == 0)
143 { 143 {
144 lsb++; 144 lsb++;
145 } 145 }
@@ -216,7 +216,7 @@ static long fp_exp10(long x)
216static long fp_atof(const char* s, int precision) 216static long fp_atof(const char* s, int precision)
217{ 217{
218 long int_part = 0; 218 long int_part = 0;
219 long int_one = 1 << precision; 219 long int_one = BIT_N(precision);
220 long frac_part = 0; 220 long frac_part = 0;
221 long frac_count = 0; 221 long frac_count = 0;
222 long frac_max = ((precision * 4) + 12) / 13; 222 long frac_max = ((precision * 4) + 12) / 13;