[libcxx] r214442 - Make Android's ctype_base::mask unsigned.

Dan Albert danalbert at google.com
Thu Jul 31 14:04:08 PDT 2014


Author: danalbert
Date: Thu Jul 31 16:04:08 2014
New Revision: 214442

URL: http://llvm.org/viewvc/llvm-project?rev=214442&view=rev
Log:
Make Android's ctype_base::mask unsigned.

Keeping the regex code sane is much easier if we match the other
platforms and use an unsigned mask.


Modified:
    libcxx/trunk/include/__locale
    libcxx/trunk/src/locale.cpp

Modified: libcxx/trunk/include/__locale
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__locale?rev=214442&r1=214441&r2=214442&view=diff
==============================================================================
--- libcxx/trunk/include/__locale (original)
+++ libcxx/trunk/include/__locale Thu Jul 31 16:04:08 2014
@@ -356,7 +356,7 @@ public:
 #elif defined(__EMSCRIPTEN__) ||  defined(__NetBSD__)
     typedef unsigned short mask;
 #elif defined(__ANDROID__)
-    typedef char mask;
+    typedef unsigned char mask;
 #endif
     static const mask space  = _CTYPE_S;
     static const mask print  = _CTYPE_R;

Modified: libcxx/trunk/src/locale.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/locale.cpp?rev=214442&r1=214441&r2=214442&view=diff
==============================================================================
--- libcxx/trunk/src/locale.cpp (original)
+++ libcxx/trunk/src/locale.cpp Thu Jul 31 16:04:08 2014
@@ -1038,7 +1038,7 @@ ctype<char>::classic_table()  _NOEXCEPT
 #elif defined(_AIX)
     return (const unsigned int *)__lc_ctype_ptr->obj->mask;
 #elif defined(__ANDROID__)
-    return _ctype_ + 1;
+    return reinterpret_cast<const unsigned char*>(_ctype_) + 1;
 #else
     // Platform not supported: abort so the person doing the port knows what to
     // fix





More information about the cfe-commits mailing list