diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-30 22:32:05 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-04-30 22:32:05 +0000 |
commit | 0f0121fe1a626080424f86e97159feeb9404bac7 (patch) | |
tree | bf2bb47ce27e83ecbedec9ab753bfbe4d87e119b /string.c | |
parent | aa2395b8878be3273aa863cdcf27f119e8133b2a (diff) | |
download | ruby-0f0121fe1a626080424f86e97159feeb9404bac7.tar.gz |
* string.c (search_nonascii): use nlz on big endian environments.
* internal.h (nlz_intpr): defined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -449,7 +449,11 @@ search_nonascii(const char *p, const char *e) const uintptr_t *t = (const uintptr_t *)(e - (SIZEOF_VOIDP-1)); for (;s < t; s++) { if (*s & NONASCII_MASK) { +#if BYTE_ORDER == LITTLE_ENDIAN return (const char *)s + (ntz_intptr(*s&NONASCII_MASK)>>3); +#else + return (const char *)s + (nlz_intptr(*s&NONASCII_MASK)>>3); +#endif } } p = (const char *)s; |