X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..a01113dcd0f39d5da295ef82785beff9ed86fe38:/icuSources/i18n/quant.cpp?ds=sidebyside diff --git a/icuSources/i18n/quant.cpp b/icuSources/i18n/quant.cpp index 9a5606da..acf579e1 100644 --- a/icuSources/i18n/quant.cpp +++ b/icuSources/i18n/quant.cpp @@ -1,5 +1,9 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* -* Copyright (C) 2001-2003, International Business Machines Corporation and others. All Rights Reserved. +********************************************************************** +* Copyright (C) 2001-2012, International Business Machines +* Corporation and others. All Rights Reserved. ********************************************************************** * Date Name Description * 07/26/01 aliu Creation. @@ -52,7 +56,10 @@ UnicodeFunctor* Quantifier::clone() const { * and return the pointer. */ UnicodeMatcher* Quantifier::toMatcher() const { - return (UnicodeMatcher*) this; + Quantifier *nonconst_this = const_cast(this); + UnicodeMatcher *nonconst_base = static_cast(nonconst_this); + + return nonconst_base; } UMatchDegree Quantifier::matches(const Replaceable& text, @@ -92,7 +99,7 @@ UMatchDegree Quantifier::matches(const Replaceable& text, */ UnicodeString& Quantifier::toPattern(UnicodeString& result, UBool escapeUnprintable) const { - result.truncate(0); + result.truncate(0); matcher->toMatcher()->toPattern(result, escapeUnprintable); if (minCount == 0) { if (maxCount == 1) { @@ -126,7 +133,7 @@ UBool Quantifier::matchesIndexValue(uint8_t v) const { */ void Quantifier::addMatchSetTo(UnicodeSet& toUnionTo) const { if (maxCount > 0) { - matcher->toMatcher()->addMatchSetTo(toUnionTo); + matcher->toMatcher()->addMatchSetTo(toUnionTo); } } @@ -134,7 +141,7 @@ void Quantifier::addMatchSetTo(UnicodeSet& toUnionTo) const { * Implement UnicodeFunctor */ void Quantifier::setData(const TransliterationRuleData* d) { - matcher->setData(d); + matcher->setData(d); } U_NAMESPACE_END