From 2134fb7aac5972a6e0bb58e0a5dd299364dd2034 Mon Sep 17 00:00:00 2001 From: Andy Heninger Date: Wed, 26 Apr 2006 04:01:00 +0000 Subject: [PATCH] ICU-5170 compiler warning cleanup X-SVN-Rev: 19596 --- icu4c/source/common/ubrk.cpp | 4 ++++ icu4c/source/common/unicode/brkiter.h | 2 +- icu4c/source/common/unicode/rbbi.h | 7 ++++++- icu4c/source/test/intltest/rbbitst.cpp | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/icu4c/source/common/ubrk.cpp b/icu4c/source/common/ubrk.cpp index 8f0e46c91a4..27195be3da6 100644 --- a/icu4c/source/common/ubrk.cpp +++ b/icu4c/source/common/ubrk.cpp @@ -17,6 +17,7 @@ #include "unicode/uchriter.h" #include "unicode/rbbi.h" #include "rbbirb.h" +#include "uassert.h" U_NAMESPACE_USE @@ -59,6 +60,9 @@ ubrk_open(UBreakIteratorType type, case UBRK_TITLE: result = BreakIterator::createTitleInstance(Locale(locale), *status); break; + + default: + U_ASSERT(FALSE); } // check for allocation error diff --git a/icu4c/source/common/unicode/brkiter.h b/icu4c/source/common/unicode/brkiter.h index 489fed5b612..ba65650b5f3 100644 --- a/icu4c/source/common/unicode/brkiter.h +++ b/icu4c/source/common/unicode/brkiter.h @@ -146,7 +146,7 @@ public: * Return a CharacterIterator over the text being analyzed. * @stable ICU 2.0 */ - virtual const CharacterIterator& getText(void) const = 0; + virtual CharacterIterator& getText(void) const = 0; /** diff --git a/icu4c/source/common/unicode/rbbi.h b/icu4c/source/common/unicode/rbbi.h index a07708531b1..83fa2675e0a 100644 --- a/icu4c/source/common/unicode/rbbi.h +++ b/icu4c/source/common/unicode/rbbi.h @@ -301,7 +301,12 @@ public: * rules for thread safety in ICU, which are that const functions are * thread safe. *

- * The function getUText() provides similar functionality, and is more efficient. + * When the break iterator is operating on text supplied via a UText, + * this function will fail. Lacking any way to signal failures, it + * returns an CharacterIterator containing no text in this case. + * The function getUText() provides similar functionality, + * is reliable, and is more efficient. + * * TODO: deprecate this function? * * @return An iterator over the text being analyzed. diff --git a/icu4c/source/test/intltest/rbbitst.cpp b/icu4c/source/test/intltest/rbbitst.cpp index 124e5ade966..fa69b4b5bdf 100644 --- a/icu4c/source/test/intltest/rbbitst.cpp +++ b/icu4c/source/test/intltest/rbbitst.cpp @@ -1344,7 +1344,7 @@ void RBBITest::executeTest(TestParams *t) { if (rs != expectedTagVal) { errln("Incorrect status for reverse break. Pos=%4d File line,col= %4d,%4d.\n" " Actual, Expected status = %4d, %4d", - bp, t->srcLine->elementAti(bp), t->srcCol->elementAti(bp), rs, expectedTagVal); + bp, line, t->srcCol->elementAti(bp), rs, expectedTagVal); } }