summaryrefslogtreecommitdiff
path: root/apps/plugins/sudoku/generator.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/plugins/sudoku/generator.c
parentc3182ec333982e961d3babfbdb1125fd5bac7fb8 (diff)
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/sudoku/generator.c')
-rw-r--r--apps/plugins/sudoku/generator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/plugins/sudoku/generator.c b/apps/plugins/sudoku/generator.c
index 3d37bde22a..59bb9066cc 100644
--- a/apps/plugins/sudoku/generator.c
+++ b/apps/plugins/sudoku/generator.c
@@ -54,7 +54,7 @@
#define STATE_MASK 0x0000ff80
#define STATE_SHIFT (7-1) /* digits 1..9 */
-#define DIGIT_STATE(digit) (1<<(STATE_SHIFT+(digit)))
+#define DIGIT_STATE(digit) BIT_N(STATE_SHIFT+(digit))
#define DIGIT_MASK 0x000f0000
#define DIGIT_SHIFT 16
@@ -266,7 +266,7 @@ numset( int mask )
{
int i, n = 0;
for( i = STATE_SHIFT + 1 ; i <= STATE_SHIFT + 9 ; ++i )
- if( mask & (1<<i) )
+ if( mask & BIT_N(i) )
++n;
else
++counts[ i - STATE_SHIFT - 1 ];