]> granicus.if.org Git - icu/commitdiff
ICU-8601 second try to fix build on platforms where UChar != uint16_t
authorMarkus Scherer <markus.icu@gmail.com>
Fri, 27 May 2011 17:54:37 +0000 (17:54 +0000)
committerMarkus Scherer <markus.icu@gmail.com>
Fri, 27 May 2011 17:54:37 +0000 (17:54 +0000)
X-SVN-Rev: 30154

icu4c/source/common/ucase.cpp

index 2cf88c4e0f43334d55aaaa36c5932821b8dc202b..c6ea6f57c643d035def30d60634adfc52e3eeab7 100644 (file)
@@ -335,7 +335,6 @@ strcmpMax(const UChar *s, int32_t length, const UChar *t, int32_t max) {
 
 U_CFUNC UBool U_EXPORT2
 ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length, const USetAdder *sa) {
-    const UChar *unfold, *p;
     int32_t i, start, limit, result, unfoldRows, unfoldRowWidth, unfoldStringWidth;
 
     if(csp->unfold==NULL || s==NULL) {
@@ -352,7 +351,7 @@ ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length
         return FALSE;
     }
 
-    unfold=csp->unfold;
+    const uint16_t *unfold=csp->unfold;
     unfoldRows=unfold[UCASE_UNFOLD_ROWS];
     unfoldRowWidth=unfold[UCASE_UNFOLD_ROW_WIDTH];
     unfoldStringWidth=unfold[UCASE_UNFOLD_STRING_WIDTH];
@@ -368,7 +367,7 @@ ucase_addStringCaseClosure(const UCaseProps *csp, const UChar *s, int32_t length
     limit=unfoldRows;
     while(start<limit) {
         i=(start+limit)/2;
-        p=unfold+(i*unfoldRowWidth);
+        const UChar *p=reinterpret_cast<const UChar *>(unfold+(i*unfoldRowWidth));
         result=strcmpMax(s, length, p, unfoldStringWidth);
 
         if(result==0) {