From b4974e71dcb32d430d7d686c5de247218991ec6c Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 13 Feb 2015 07:07:39 +0000 Subject: util.c: hexdigit * util.c (hexdigit): extract identical constants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index 3d476a8d75..807f43f29e 100644 --- a/util.c +++ b/util.c @@ -23,6 +23,9 @@ #include "ruby/util.h" +const char ruby_hexdigits[] = "0123456789abcdef0123456789ABCDEF"; +#define hexdigit ruby_hexdigits + unsigned long ruby_scan_oct(const char *start, size_t len, size_t *retlen) { @@ -40,7 +43,6 @@ ruby_scan_oct(const char *start, size_t len, size_t *retlen) unsigned long ruby_scan_hex(const char *start, size_t len, size_t *retlen) { - static const char hexdigit[] = "0123456789abcdef0123456789ABCDEF"; register const char *s = start; register unsigned long retval = 0; const char *tmp; @@ -1993,7 +1995,6 @@ ruby_strtod(const char *s00, char **se) break2: if (*s == '0') { if (s[1] == 'x' || s[1] == 'X') { - static const char hexdigit[] = "0123456789abcdef0123456789ABCDEF"; s0 = ++s; adj = 0; aadj = 1.0; -- cgit v1.2.1