ICU-7273 minor error checking and visibility cleanup

X-SVN-Rev: 27408
This commit is contained in:
Markus Scherer 2010-01-26 04:24:20 +00:00
parent d80b144c19
commit bdfe251e8c
4 changed files with 15 additions and 8 deletions

View File

@ -52,7 +52,11 @@ class NoopNormalizer2 : public Normalizer2 {
const UnicodeString &second,
UErrorCode &errorCode) const {
if(U_SUCCESS(errorCode)) {
first.append(second);
if(&first!=&second) {
first.append(second);
} else {
errorCode=U_ILLEGAL_ARGUMENT_ERROR;
}
}
return first;
}
@ -210,6 +214,7 @@ class DecomposeNormalizer2 : public Normalizer2WithImpl {
public:
DecomposeNormalizer2(const Normalizer2Impl &ni) : Normalizer2WithImpl(ni) {}
private:
virtual void
normalize(const UChar *src, const UChar *limit,
ReorderingBuffer &buffer, UErrorCode &errorCode) const {
@ -239,6 +244,7 @@ public:
ComposeNormalizer2(const Normalizer2Impl &ni, UBool fcc) :
Normalizer2WithImpl(ni), onlyContiguous(fcc) {}
private:
virtual void
normalize(const UChar *src, const UChar *limit,
ReorderingBuffer &buffer, UErrorCode &errorCode) const {
@ -299,14 +305,15 @@ public:
virtual UBool isInert(UChar32 c) const {
return impl.hasCompBoundaryAfter(c, onlyContiguous, TRUE);
}
private:
UBool onlyContiguous;
const UBool onlyContiguous;
};
class FCDNormalizer2 : public Normalizer2WithImpl {
public:
FCDNormalizer2(const Normalizer2Impl &ni) : Normalizer2WithImpl(ni) {}
private:
virtual void
normalize(const UChar *src, const UChar *limit,
ReorderingBuffer &buffer, UErrorCode &errorCode) const {

View File

@ -359,9 +359,9 @@ private:
// UBool isCompYesOrMaybe(uint16_t norm16) const {
// return norm16<minNoNo || minMaybeYes<=norm16;
// }
UBool hasZeroCCFromDecompYes(uint16_t norm16) {
return norm16<=MIN_NORMAL_MAYBE_YES || norm16==JAMO_VT;
}
// UBool hasZeroCCFromDecompYes(uint16_t norm16) const {
// return norm16<=MIN_NORMAL_MAYBE_YES || norm16==JAMO_VT;
// }
UBool isDecompYesAndZeroCC(uint16_t norm16) const {
return norm16<minYesNo ||
norm16==JAMO_VT ||

View File

@ -219,7 +219,7 @@ u_hasBinaryProperty(UChar32 c, UProperty which) {
// needs to release dest's buffer before we look at its contents.
ReorderingBuffer buffer(*kcf, dest);
// Small destCapacity for NFKC_CF(c).
if(U_SUCCESS(errorCode) && buffer.init(5, errorCode)) {
if(buffer.init(5, errorCode)) {
const UChar *srcArray=src.getBuffer();
kcf->compose(srcArray, srcArray+src.length(), FALSE,
TRUE, buffer, errorCode);

View File

@ -204,7 +204,7 @@ static IntlTest *createLocalPointerTest() {
return new LocalPointerTest();
}
void LocalPointerTest::runIndexedTest(int32_t index, UBool exec, const char *&name, char */*par*/) {
void LocalPointerTest::runIndexedTest(int32_t index, UBool exec, const char *&name, char * /*par*/) {
if(exec) {
logln("TestSuite LocalPointerTest: ");
}