]> granicus.if.org Git - icu/commitdiff
ICU-12992 make the old normlzr.h work with configured UChar=uint16_t, and do not...
authorMarkus Scherer <markus.icu@gmail.com>
Wed, 8 Mar 2017 05:59:25 +0000 (05:59 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Wed, 8 Mar 2017 05:59:25 +0000 (05:59 +0000)
X-SVN-Rev: 39744

icu4c/source/common/unicode/normlzr.h
icu4c/source/i18n/coleitr.cpp
icu4c/source/i18n/unicode/coll.h

index 31af07b7cc1060c0001cc692aba637e3c2d1e074..02ef13f2fd3e40069fbe106c55ae3af576c4762f 100644 (file)
@@ -795,9 +795,15 @@ inline int32_t
 Normalizer::compare(const UnicodeString &s1, const UnicodeString &s2,
                     uint32_t options,
                     UErrorCode &errorCode) {
+  const char16_t *p1 = s1.getBuffer();
+  const char16_t *p2 = s2.getBuffer();
+#ifdef U_ALIASING_BARRIER
+  U_ALIASING_BARRIER(p1);
+  U_ALIASING_BARRIER(p2);
+#endif
   // all argument checking is done in unorm_compare
-  return unorm_compare(s1.getBuffer(), s1.length(),
-                       s2.getBuffer(), s2.length(),
+  return unorm_compare(reinterpret_cast<const UChar *>(p1), s1.length(),
+                       reinterpret_cast<const UChar *>(p2), s2.length(),
                        options,
                        &errorCode);
 }
index 5668097a8cec0bbcacdbf491334c895130b7caf3..64d3ab4d2bfe734842a6896cc775130648ba156b 100644 (file)
@@ -29,6 +29,7 @@
 
 #if !UCONFIG_NO_COLLATION
 
+#include "unicode/chariter.h"
 #include "unicode/coleitr.h"
 #include "unicode/tblcoll.h"
 #include "unicode/ustring.h"
index a53df5deebd0da915c7da5111029d7b31d33ca7e..7e467df80e040997422a286281a39026c7c23258 100644 (file)
@@ -58,7 +58,7 @@
 
 #include "unicode/uobject.h"
 #include "unicode/ucol.h"
-#include "unicode/normlzr.h"
+#include "unicode/unorm.h"
 #include "unicode/locid.h"
 #include "unicode/uniset.h"
 #include "unicode/umisc.h"
@@ -158,7 +158,7 @@ class CollationKey;
 * @see         CollationKey
 * @see         CollationElementIterator
 * @see         Locale
-* @see         Normalizer
+* @see         Normalizer2
 * @version     2.0 11/15/01
 */