summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2009-10-23 02:22:03 +0200
committerDenys Vlasenko2009-10-23 02:22:03 +0200
commit7b4cd6f7b07b816c4b36d686fe47c5cfec7f5abf (patch)
treea31cc5ba7ff0f4a46f72a4318b64765744242ad1
parentc1947f18f539b3e2e1972ec0c9a78c4651cf328b (diff)
downloadbusybox-7b4cd6f7b07b816c4b36d686fe47c5cfec7f5abf.zip
busybox-7b4cd6f7b07b816c4b36d686fe47c5cfec7f5abf.tar.gz
libbb: smaller isdigit. -95 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--include/libbb.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/libbb.h b/include/libbb.h
index fb7296f..ad0d59d 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1579,9 +1579,10 @@ extern const char bb_default_login_shell[];
#undef isupper
#undef isxdigit
-/* This one is more efficient - we save ~400 bytes */
+/* This one is more efficient - we save ~500 bytes.
+ * BTW, x86 likes (unsigned char) cast more than (unsigned). */
#undef isdigit
-#define isdigit(a) ((unsigned)((a) - '0') <= 9)
+#define isdigit(a) ((unsigned char)((a) - '0') <= 9)
/* This one is more efficient too! ~200 bytes */
/* In POSIX/C locale (the only locale we care about: do we REALLY want