Backport of upstream revision 56345 (2010-03-22 Darin Adler ) to webkit-gtk-1.1.15.4 TextBreakIteratorICU.cpp is incompatible with new UBreakIterator type in ICU 4.4 https://bugs.webkit.org/show_bug.cgi?id=36381 platform/text/TextBreakIteratorICU.cpp, platform/text/TextBoundariesICU.cpp: Use reinterpret_cast instead of static_cast or relying on conversion to void*. diff -ru webkit-1.1.15.4-orig//WebCore/platform/text/TextBoundariesICU.cpp webkit-1.1.15.4/WebCore/platform/text/TextBoundariesICU.cpp --- webkit-1.1.15.4-orig//WebCore/platform/text/TextBoundariesICU.cpp 2009-09-22 11:29:21.000000000 -0400 +++ webkit-1.1.15.4/WebCore/platform/text/TextBoundariesICU.cpp 2010-03-26 03:19:14.852055685 -0400 @@ -36,7 +36,7 @@ int findNextWordFromIndex(const UChar* chars, int len, int position, bool forward) { - UBreakIterator* it = wordBreakIterator(chars, len); + UBreakIterator* it = reinterpret_cast(wordBreakIterator(chars, len)); if (forward) { position = ubrk_following(it, position); @@ -67,7 +67,7 @@ void findWordBoundary(const UChar* chars, int len, int position, int* start, int* end) { - UBreakIterator* it = wordBreakIterator(chars, len); + UBreakIterator* it = reinterpret_cast(wordBreakIterator(chars, len)); *end = ubrk_following(it, position); if (*end < 0) *end = ubrk_last(it); diff -ru webkit-1.1.15.4-orig//WebCore/platform/text/TextBreakIteratorICU.cpp webkit-1.1.15.4/WebCore/platform/text/TextBreakIteratorICU.cpp --- webkit-1.1.15.4-orig//WebCore/platform/text/TextBreakIteratorICU.cpp 2009-09-22 11:29:21.000000000 -0400 +++ webkit-1.1.15.4/WebCore/platform/text/TextBreakIteratorICU.cpp 2010-03-26 02:44:51.934479159 -0400 @@ -38,7 +38,7 @@ if (!createdIterator) { UErrorCode openStatus = U_ZERO_ERROR; - iterator = static_cast(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &openStatus)); + iterator = reinterpret_cast(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &openStatus)); createdIterator = true; ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus); } @@ -46,7 +46,7 @@ return 0; UErrorCode setTextStatus = U_ZERO_ERROR; - ubrk_setText(iterator, string, length, &setTextStatus); + ubrk_setText(reinterpret_cast(iterator), string, length, &setTextStatus); if (U_FAILURE(setTextStatus)) return 0; @@ -85,34 +85,34 @@ staticSentenceBreakIterator, UBRK_SENTENCE, string, length); } -int textBreakFirst(TextBreakIterator* bi) +int textBreakFirst(TextBreakIterator* iterator) { - return ubrk_first(bi); + return ubrk_first(reinterpret_cast(iterator)); } -int textBreakNext(TextBreakIterator* bi) +int textBreakNext(TextBreakIterator* iterator) { - return ubrk_next(bi); + return ubrk_next(reinterpret_cast(iterator)); } -int textBreakPreceding(TextBreakIterator* bi, int pos) +int textBreakPreceding(TextBreakIterator* iterator, int pos) { - return ubrk_preceding(bi, pos); + return ubrk_preceding(reinterpret_cast(iterator), pos); } -int textBreakFollowing(TextBreakIterator* bi, int pos) +int textBreakFollowing(TextBreakIterator* iterator, int pos) { - return ubrk_following(bi, pos); + return ubrk_following(reinterpret_cast(iterator), pos); } -int textBreakCurrent(TextBreakIterator* bi) +int textBreakCurrent(TextBreakIterator* iterator) { - return ubrk_current(bi); + return ubrk_current(reinterpret_cast(iterator)); } -bool isTextBreak(TextBreakIterator* bi, int pos) +bool isTextBreak(TextBreakIterator* iterator, int position) { - return ubrk_isBoundary(bi, pos); + return ubrk_isBoundary(reinterpret_cast(iterator), position); } #ifndef BUILDING_ON_TIGER @@ -126,7 +126,7 @@ UParseError parseStatus; UErrorCode openStatus = U_ZERO_ERROR; String rules(breakRules); - iterator = static_cast(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &parseStatus, &openStatus)); + iterator = reinterpret_cast(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &parseStatus, &openStatus)); createdIterator = true; ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus); } @@ -134,7 +134,7 @@ return 0; UErrorCode setTextStatus = U_ZERO_ERROR; - ubrk_setText(iterator, string, length, &setTextStatus); + ubrk_setText(reinterpret_cast(iterator), string, length, &setTextStatus); if (U_FAILURE(setTextStatus)) return 0;