diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-23 03:16:08 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-23 03:16:08 +0200 |
| commit | f2cbb03a378aa48f2e08b64877d54da3fab4ea6a (patch) | |
| tree | 35ff7449ba394e4e0a84a19a70eafa7b181d8d71 /coreutils | |
| parent | 7b4cd6f7b07b816c4b36d686fe47c5cfec7f5abf (diff) | |
| download | busybox-w32-f2cbb03a378aa48f2e08b64877d54da3fab4ea6a.tar.gz busybox-w32-f2cbb03a378aa48f2e08b64877d54da3fab4ea6a.tar.bz2 busybox-w32-f2cbb03a378aa48f2e08b64877d54da3fab4ea6a.zip | |
*: optimize most of isXXXXX() macros
text data bss dec hex filename
824164 453 6812 831429 cafc5 busybox_old
823730 453 6812 830995 cae13 busybox_unstripped
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
| -rw-r--r-- | coreutils/od.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/coreutils/od.c b/coreutils/od.c index e4179a36d..228db19ac 100644 --- a/coreutils/od.c +++ b/coreutils/od.c | |||
| @@ -20,9 +20,6 @@ | |||
| 20 | 20 | ||
| 21 | #include "dump.h" | 21 | #include "dump.h" |
| 22 | 22 | ||
| 23 | #define isdecdigit(c) isdigit(c) | ||
| 24 | #define ishexdigit(c) (isxdigit)(c) | ||
| 25 | |||
| 26 | static void | 23 | static void |
| 27 | odoffset(dumper_t *dumper, int argc, char ***argvp) | 24 | odoffset(dumper_t *dumper, int argc, char ***argvp) |
| 28 | { | 25 | { |
| @@ -51,8 +48,8 @@ odoffset(dumper_t *dumper, int argc, char ***argvp) | |||
| 51 | 48 | ||
| 52 | if ((*p != '+') | 49 | if ((*p != '+') |
| 53 | && (argc < 2 | 50 | && (argc < 2 |
| 54 | || (!isdecdigit(p[0]) | 51 | || (!isdigit(p[0]) |
| 55 | && ((p[0] != 'x') || !ishexdigit(p[1]))))) | 52 | && ((p[0] != 'x') || !isxdigit(p[1]))))) |
| 56 | return; | 53 | return; |
| 57 | 54 | ||
| 58 | base = 0; | 55 | base = 0; |
| @@ -62,7 +59,7 @@ odoffset(dumper_t *dumper, int argc, char ***argvp) | |||
| 62 | */ | 59 | */ |
| 63 | if (p[0] == '+') | 60 | if (p[0] == '+') |
| 64 | ++p; | 61 | ++p; |
| 65 | if (p[0] == 'x' && ishexdigit(p[1])) { | 62 | if (p[0] == 'x' && isxdigit(p[1])) { |
| 66 | ++p; | 63 | ++p; |
| 67 | base = 16; | 64 | base = 16; |
| 68 | } else if (p[0] == '0' && p[1] == 'x') { | 65 | } else if (p[0] == '0' && p[1] == 'x') { |
| @@ -72,10 +69,10 @@ odoffset(dumper_t *dumper, int argc, char ***argvp) | |||
| 72 | 69 | ||
| 73 | /* skip over the number */ | 70 | /* skip over the number */ |
| 74 | if (base == 16) | 71 | if (base == 16) |
| 75 | for (num = p; ishexdigit(*p); ++p) | 72 | for (num = p; isxdigit(*p); ++p) |
| 76 | continue; | 73 | continue; |
| 77 | else | 74 | else |
| 78 | for (num = p; isdecdigit(*p); ++p) | 75 | for (num = p; isdigit(*p); ++p) |
| 79 | continue; | 76 | continue; |
| 80 | 77 | ||
| 81 | /* check for no number */ | 78 | /* check for no number */ |
