summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-13 07:07:39 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-13 07:07:39 +0000
commitb4974e71dcb32d430d7d686c5de247218991ec6c (patch)
tree8a2416811576cb5d2d48626f1512394f272e1882 /util.c
parentf5219fee6307461c7ead4358290958679d9d0d38 (diff)
downloadruby-b4974e71dcb32d430d7d686c5de247218991ec6c.tar.gz
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
Diffstat (limited to 'util.c')
-rw-r--r--util.c5
1 files changed, 3 insertions, 2 deletions
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;