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/misc.h | |
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/misc.h')
-rw-r--r-- | apps/misc.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/misc.h b/apps/misc.h index 1ac63da773..7e71101ba1 100644 --- a/apps/misc.h +++ b/apps/misc.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <stdbool.h> | 24 | #include <stdbool.h> |
25 | #include <inttypes.h> | 25 | #include <inttypes.h> |
26 | #include "config.h" | 26 | #include "config.h" |
27 | #include "system.h" | ||
27 | 28 | ||
28 | /* Format a large-range value for output, using the appropriate unit so that | 29 | /* Format a large-range value for output, using the appropriate unit so that |
29 | * the displayed value is in the range 1 <= display < 1000 (1024 for "binary" | 30 | * the displayed value is in the range 1 <= display < 1000 (1024 for "binary" |
@@ -103,7 +104,7 @@ char *strip_extension(char* buffer, int buffer_size, const char *filename); | |||
103 | * - position: 0-based number of the value | 104 | * - position: 0-based number of the value |
104 | * - valid_vals: value after the call to 'parse_list' | 105 | * - valid_vals: value after the call to 'parse_list' |
105 | */ | 106 | */ |
106 | #define LIST_VALUE_PARSED(setvals, position) ((setvals)&(1<<(position))) | 107 | #define LIST_VALUE_PARSED(setvals, position) ((setvals) & BIT_N(position)) |
107 | const char* parse_list(const char *fmt, uint32_t *set_vals, | 108 | const char* parse_list(const char *fmt, uint32_t *set_vals, |
108 | const char sep, const char* str, ...); | 109 | const char sep, const char* str, ...); |
109 | 110 | ||