summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-10-02 21:03:33 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-10-02 21:03:33 +0900
commitf03c23572d4dd106290af5bc17d4798ffca2d31b (patch)
tree356e3729a9b2752800d8096a961048d7d3759f87 /src/string.c
parentc08321ef2328d4c5af6a1c82121f45ae2c4c7410 (diff)
parente77ea4e5f2b823181020bb3a337509ba028b6dc4 (diff)
downloadmruby-f03c23572d4dd106290af5bc17d4798ffca2d31b.tar.gz
mruby-f03c23572d4dd106290af5bc17d4798ffca2d31b.zip
Merge pull request #2602 from Hiroyuki-Matsuzaki/fix_cygwin_gcc_warning
fixed. cygwin-gcc(ver4.8.3) warning in conv_digit()
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/string.c b/src/string.c
index 63c0e4573..5eaed533a 100644
--- a/src/string.c
+++ b/src/string.c
@@ -1854,13 +1854,10 @@ mrb_cstr_to_inum(mrb_state *mrb, const char *str, int base, int badcheck)
unsigned long n = 0;
mrb_int val;
-#undef ISDIGIT
-#define ISDIGIT(c) ('0' <= (c) && (c) <= '9')
#define conv_digit(c) \
- (!ISASCII(c) ? -1 : \
- isdigit(c) ? ((c) - '0') : \
- islower(c) ? ((c) - 'a' + 10) : \
- isupper(c) ? ((c) - 'A' + 10) : \
+ (ISDIGIT(c) ? ((c) - '0') : \
+ ISLOWER(c) ? ((c) - 'a' + 10) : \
+ ISUPPER(c) ? ((c) - 'A' + 10) : \
-1)
if (!str) {