mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 17:01:16 +00:00
ICU-13093 porting fixes (AIX)
X-SVN-Rev: 40406
This commit is contained in:
parent
8ba4e85fa9
commit
84bec69426
7 changed files with 66 additions and 62 deletions
icu4c/source
common
tools/gennorm2
|
@ -226,14 +226,14 @@ public:
|
|||
private:
|
||||
virtual void
|
||||
normalize(const UChar *src, const UChar *limit,
|
||||
ReorderingBuffer &buffer, UErrorCode &errorCode) const override {
|
||||
ReorderingBuffer &buffer, UErrorCode &errorCode) const U_OVERRIDE {
|
||||
impl.compose(src, limit, onlyContiguous, TRUE, buffer, errorCode);
|
||||
}
|
||||
using Normalizer2WithImpl::normalize; // Avoid warning about hiding base class function.
|
||||
|
||||
void
|
||||
normalizeUTF8(uint32_t options, StringPiece src, ByteSink &sink,
|
||||
Edits *edits, UErrorCode &errorCode) const override {
|
||||
Edits *edits, UErrorCode &errorCode) const U_OVERRIDE {
|
||||
if (U_FAILURE(errorCode)) {
|
||||
return;
|
||||
}
|
||||
|
@ -249,12 +249,12 @@ private:
|
|||
virtual void
|
||||
normalizeAndAppend(const UChar *src, const UChar *limit, UBool doNormalize,
|
||||
UnicodeString &safeMiddle,
|
||||
ReorderingBuffer &buffer, UErrorCode &errorCode) const override {
|
||||
ReorderingBuffer &buffer, UErrorCode &errorCode) const U_OVERRIDE {
|
||||
impl.composeAndAppend(src, limit, doNormalize, onlyContiguous, safeMiddle, buffer, errorCode);
|
||||
}
|
||||
|
||||
virtual UBool
|
||||
isNormalized(const UnicodeString &s, UErrorCode &errorCode) const override {
|
||||
isNormalized(const UnicodeString &s, UErrorCode &errorCode) const U_OVERRIDE {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ private:
|
|||
return impl.compose(sArray, sArray+s.length(), onlyContiguous, FALSE, buffer, errorCode);
|
||||
}
|
||||
virtual UBool
|
||||
isNormalizedUTF8(StringPiece sp, UErrorCode &errorCode) const override {
|
||||
isNormalizedUTF8(StringPiece sp, UErrorCode &errorCode) const U_OVERRIDE {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ private:
|
|||
return impl.composeUTF8(0, onlyContiguous, s, s + sp.length(), nullptr, nullptr, errorCode);
|
||||
}
|
||||
virtual UNormalizationCheckResult
|
||||
quickCheck(const UnicodeString &s, UErrorCode &errorCode) const override {
|
||||
quickCheck(const UnicodeString &s, UErrorCode &errorCode) const U_OVERRIDE {
|
||||
if(U_FAILURE(errorCode)) {
|
||||
return UNORM_MAYBE;
|
||||
}
|
||||
|
@ -293,20 +293,20 @@ private:
|
|||
return qcResult;
|
||||
}
|
||||
virtual const UChar *
|
||||
spanQuickCheckYes(const UChar *src, const UChar *limit, UErrorCode &) const override {
|
||||
spanQuickCheckYes(const UChar *src, const UChar *limit, UErrorCode &) const U_OVERRIDE {
|
||||
return impl.composeQuickCheck(src, limit, onlyContiguous, NULL);
|
||||
}
|
||||
using Normalizer2WithImpl::spanQuickCheckYes; // Avoid warning about hiding base class function.
|
||||
virtual UNormalizationCheckResult getQuickCheck(UChar32 c) const override {
|
||||
virtual UNormalizationCheckResult getQuickCheck(UChar32 c) const U_OVERRIDE {
|
||||
return impl.getCompQuickCheck(impl.getNorm16(c));
|
||||
}
|
||||
virtual UBool hasBoundaryBefore(UChar32 c) const override {
|
||||
virtual UBool hasBoundaryBefore(UChar32 c) const U_OVERRIDE {
|
||||
return impl.hasCompBoundaryBefore(c);
|
||||
}
|
||||
virtual UBool hasBoundaryAfter(UChar32 c) const override {
|
||||
virtual UBool hasBoundaryAfter(UChar32 c) const U_OVERRIDE {
|
||||
return impl.hasCompBoundaryAfter(c, onlyContiguous);
|
||||
}
|
||||
virtual UBool isInert(UChar32 c) const override {
|
||||
virtual UBool isInert(UChar32 c) const U_OVERRIDE {
|
||||
return impl.isCompInert(c, onlyContiguous);
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ class NoopNormalizer2 : public Normalizer2 {
|
|||
virtual UnicodeString &
|
||||
normalize(const UnicodeString &src,
|
||||
UnicodeString &dest,
|
||||
UErrorCode &errorCode) const override {
|
||||
UErrorCode &errorCode) const U_OVERRIDE {
|
||||
if(U_SUCCESS(errorCode)) {
|
||||
if(&dest!=&src) {
|
||||
dest=src;
|
||||
|
@ -97,7 +97,7 @@ class NoopNormalizer2 : public Normalizer2 {
|
|||
}
|
||||
virtual void
|
||||
normalizeUTF8(uint32_t options, StringPiece src, ByteSink &sink,
|
||||
Edits *edits, UErrorCode &errorCode) const override {
|
||||
Edits *edits, UErrorCode &errorCode) const U_OVERRIDE {
|
||||
if(U_SUCCESS(errorCode)) {
|
||||
if (edits != nullptr) {
|
||||
if ((options & U_EDITS_NO_RESET) == 0) {
|
||||
|
@ -115,7 +115,7 @@ class NoopNormalizer2 : public Normalizer2 {
|
|||
virtual UnicodeString &
|
||||
normalizeSecondAndAppend(UnicodeString &first,
|
||||
const UnicodeString &second,
|
||||
UErrorCode &errorCode) const override {
|
||||
UErrorCode &errorCode) const U_OVERRIDE {
|
||||
if(U_SUCCESS(errorCode)) {
|
||||
if(&first!=&second) {
|
||||
first.append(second);
|
||||
|
@ -128,7 +128,7 @@ class NoopNormalizer2 : public Normalizer2 {
|
|||
virtual UnicodeString &
|
||||
append(UnicodeString &first,
|
||||
const UnicodeString &second,
|
||||
UErrorCode &errorCode) const override {
|
||||
UErrorCode &errorCode) const U_OVERRIDE {
|
||||
if(U_SUCCESS(errorCode)) {
|
||||
if(&first!=&second) {
|
||||
first.append(second);
|
||||
|
@ -139,29 +139,29 @@ class NoopNormalizer2 : public Normalizer2 {
|
|||
return first;
|
||||
}
|
||||
virtual UBool
|
||||
getDecomposition(UChar32, UnicodeString &) const override {
|
||||
getDecomposition(UChar32, UnicodeString &) const U_OVERRIDE {
|
||||
return FALSE;
|
||||
}
|
||||
// No need to override the default getRawDecomposition().
|
||||
// No need to U_OVERRIDE the default getRawDecomposition().
|
||||
virtual UBool
|
||||
isNormalized(const UnicodeString &, UErrorCode &errorCode) const override {
|
||||
isNormalized(const UnicodeString &, UErrorCode &errorCode) const U_OVERRIDE {
|
||||
return U_SUCCESS(errorCode);
|
||||
}
|
||||
virtual UBool
|
||||
isNormalizedUTF8(StringPiece, UErrorCode &errorCode) const override {
|
||||
isNormalizedUTF8(StringPiece, UErrorCode &errorCode) const U_OVERRIDE {
|
||||
return U_SUCCESS(errorCode);
|
||||
}
|
||||
virtual UNormalizationCheckResult
|
||||
quickCheck(const UnicodeString &, UErrorCode &) const override {
|
||||
quickCheck(const UnicodeString &, UErrorCode &) const U_OVERRIDE {
|
||||
return UNORM_YES;
|
||||
}
|
||||
virtual int32_t
|
||||
spanQuickCheckYes(const UnicodeString &s, UErrorCode &) const override {
|
||||
spanQuickCheckYes(const UnicodeString &s, UErrorCode &) const U_OVERRIDE {
|
||||
return s.length();
|
||||
}
|
||||
virtual UBool hasBoundaryBefore(UChar32) const override { return TRUE; }
|
||||
virtual UBool hasBoundaryAfter(UChar32) const override { return TRUE; }
|
||||
virtual UBool isInert(UChar32) const override { return TRUE; }
|
||||
virtual UBool hasBoundaryBefore(UChar32) const U_OVERRIDE { return TRUE; }
|
||||
virtual UBool hasBoundaryAfter(UChar32) const U_OVERRIDE { return TRUE; }
|
||||
virtual UBool isInert(UChar32) const U_OVERRIDE { return TRUE; }
|
||||
};
|
||||
|
||||
NoopNormalizer2::~NoopNormalizer2() {}
|
||||
|
|
|
@ -535,7 +535,7 @@ public:
|
|||
virtual UnicodeString &
|
||||
normalize(const UnicodeString &src,
|
||||
UnicodeString &dest,
|
||||
UErrorCode &errorCode) const override;
|
||||
UErrorCode &errorCode) const U_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Normalizes a UTF-8 string and optionally records how source substrings
|
||||
|
@ -563,7 +563,7 @@ public:
|
|||
*/
|
||||
virtual void
|
||||
normalizeUTF8(uint32_t options, StringPiece src, ByteSink &sink,
|
||||
Edits *edits, UErrorCode &errorCode) const override;
|
||||
Edits *edits, UErrorCode &errorCode) const U_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Appends the normalized form of the second string to the first string
|
||||
|
@ -582,7 +582,7 @@ public:
|
|||
virtual UnicodeString &
|
||||
normalizeSecondAndAppend(UnicodeString &first,
|
||||
const UnicodeString &second,
|
||||
UErrorCode &errorCode) const override;
|
||||
UErrorCode &errorCode) const U_OVERRIDE;
|
||||
/**
|
||||
* Appends the second string to the first string
|
||||
* (merging them at the boundary) and returns the first string.
|
||||
|
@ -600,7 +600,7 @@ public:
|
|||
virtual UnicodeString &
|
||||
append(UnicodeString &first,
|
||||
const UnicodeString &second,
|
||||
UErrorCode &errorCode) const override;
|
||||
UErrorCode &errorCode) const U_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Gets the decomposition mapping of c.
|
||||
|
@ -614,7 +614,7 @@ public:
|
|||
* @stable ICU 4.6
|
||||
*/
|
||||
virtual UBool
|
||||
getDecomposition(UChar32 c, UnicodeString &decomposition) const override;
|
||||
getDecomposition(UChar32 c, UnicodeString &decomposition) const U_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Gets the raw decomposition mapping of c.
|
||||
|
@ -628,7 +628,7 @@ public:
|
|||
* @stable ICU 49
|
||||
*/
|
||||
virtual UBool
|
||||
getRawDecomposition(UChar32 c, UnicodeString &decomposition) const override;
|
||||
getRawDecomposition(UChar32 c, UnicodeString &decomposition) const U_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Performs pairwise composition of a & b and returns the composite if there is one.
|
||||
|
@ -641,7 +641,7 @@ public:
|
|||
* @stable ICU 49
|
||||
*/
|
||||
virtual UChar32
|
||||
composePair(UChar32 a, UChar32 b) const override;
|
||||
composePair(UChar32 a, UChar32 b) const U_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Gets the combining class of c.
|
||||
|
@ -652,7 +652,7 @@ public:
|
|||
* @stable ICU 49
|
||||
*/
|
||||
virtual uint8_t
|
||||
getCombiningClass(UChar32 c) const override;
|
||||
getCombiningClass(UChar32 c) const U_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Tests if the string is normalized.
|
||||
|
@ -666,7 +666,7 @@ public:
|
|||
* @stable ICU 4.4
|
||||
*/
|
||||
virtual UBool
|
||||
isNormalized(const UnicodeString &s, UErrorCode &errorCode) const override;
|
||||
isNormalized(const UnicodeString &s, UErrorCode &errorCode) const U_OVERRIDE;
|
||||
/**
|
||||
* Tests if the UTF-8 string is normalized.
|
||||
* Internally, in cases where the quickCheck() method would return "maybe"
|
||||
|
@ -689,7 +689,7 @@ public:
|
|||
* @draft ICU 60
|
||||
*/
|
||||
virtual UBool
|
||||
isNormalizedUTF8(StringPiece s, UErrorCode &errorCode) const override;
|
||||
isNormalizedUTF8(StringPiece s, UErrorCode &errorCode) const U_OVERRIDE;
|
||||
/**
|
||||
* Tests if the string is normalized.
|
||||
* For details see the Normalizer2 base class documentation.
|
||||
|
@ -702,7 +702,7 @@ public:
|
|||
* @stable ICU 4.4
|
||||
*/
|
||||
virtual UNormalizationCheckResult
|
||||
quickCheck(const UnicodeString &s, UErrorCode &errorCode) const override;
|
||||
quickCheck(const UnicodeString &s, UErrorCode &errorCode) const U_OVERRIDE;
|
||||
/**
|
||||
* Returns the end of the normalized substring of the input string.
|
||||
* For details see the Normalizer2 base class documentation.
|
||||
|
@ -715,7 +715,7 @@ public:
|
|||
* @stable ICU 4.4
|
||||
*/
|
||||
virtual int32_t
|
||||
spanQuickCheckYes(const UnicodeString &s, UErrorCode &errorCode) const override;
|
||||
spanQuickCheckYes(const UnicodeString &s, UErrorCode &errorCode) const U_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Tests if the character always has a normalization boundary before it,
|
||||
|
@ -725,7 +725,7 @@ public:
|
|||
* @return TRUE if c has a normalization boundary before it
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
virtual UBool hasBoundaryBefore(UChar32 c) const override;
|
||||
virtual UBool hasBoundaryBefore(UChar32 c) const U_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Tests if the character always has a normalization boundary after it,
|
||||
|
@ -735,7 +735,7 @@ public:
|
|||
* @return TRUE if c has a normalization boundary after it
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
virtual UBool hasBoundaryAfter(UChar32 c) const override;
|
||||
virtual UBool hasBoundaryAfter(UChar32 c) const U_OVERRIDE;
|
||||
|
||||
/**
|
||||
* Tests if the character is normalization-inert.
|
||||
|
@ -744,7 +744,7 @@ public:
|
|||
* @return TRUE if c is normalization-inert
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
virtual UBool isInert(UChar32 c) const override;
|
||||
virtual UBool isInert(UChar32 c) const U_OVERRIDE;
|
||||
private:
|
||||
UnicodeString &
|
||||
normalize(const UnicodeString &src,
|
||||
|
|
|
@ -43,28 +43,28 @@ U_NAMESPACE_BEGIN
|
|||
class WholeStringBreakIterator : public BreakIterator {
|
||||
public:
|
||||
WholeStringBreakIterator() : BreakIterator(), length(0) {}
|
||||
~WholeStringBreakIterator() override;
|
||||
UBool operator==(const BreakIterator&) const override;
|
||||
BreakIterator *clone() const override;
|
||||
~WholeStringBreakIterator() U_OVERRIDE;
|
||||
UBool operator==(const BreakIterator&) const U_OVERRIDE;
|
||||
BreakIterator *clone() const U_OVERRIDE;
|
||||
static UClassID U_EXPORT2 getStaticClassID();
|
||||
UClassID getDynamicClassID() const override;
|
||||
CharacterIterator &getText() const override;
|
||||
UText *getUText(UText *fillIn, UErrorCode &errorCode) const override;
|
||||
void setText(const UnicodeString &text) override;
|
||||
void setText(UText *text, UErrorCode &errorCode) override;
|
||||
void adoptText(CharacterIterator* it) override;
|
||||
int32_t first() override;
|
||||
int32_t last() override;
|
||||
int32_t previous() override;
|
||||
int32_t next() override;
|
||||
int32_t current() const override;
|
||||
int32_t following(int32_t offset) override;
|
||||
int32_t preceding(int32_t offset) override;
|
||||
UBool isBoundary(int32_t offset) override;
|
||||
int32_t next(int32_t n) override;
|
||||
UClassID getDynamicClassID() const U_OVERRIDE;
|
||||
CharacterIterator &getText() const U_OVERRIDE;
|
||||
UText *getUText(UText *fillIn, UErrorCode &errorCode) const U_OVERRIDE;
|
||||
void setText(const UnicodeString &text) U_OVERRIDE;
|
||||
void setText(UText *text, UErrorCode &errorCode) U_OVERRIDE;
|
||||
void adoptText(CharacterIterator* it) U_OVERRIDE;
|
||||
int32_t first() U_OVERRIDE;
|
||||
int32_t last() U_OVERRIDE;
|
||||
int32_t previous() U_OVERRIDE;
|
||||
int32_t next() U_OVERRIDE;
|
||||
int32_t current() const U_OVERRIDE;
|
||||
int32_t following(int32_t offset) U_OVERRIDE;
|
||||
int32_t preceding(int32_t offset) U_OVERRIDE;
|
||||
UBool isBoundary(int32_t offset) U_OVERRIDE;
|
||||
int32_t next(int32_t n) U_OVERRIDE;
|
||||
BreakIterator *createBufferClone(void *stackBuffer, int32_t &BufferSize,
|
||||
UErrorCode &errorCode) override;
|
||||
BreakIterator &refreshInputText(UText *input, UErrorCode &errorCode) override;
|
||||
UErrorCode &errorCode) U_OVERRIDE;
|
||||
BreakIterator &refreshInputText(UText *input, UErrorCode &errorCode) U_OVERRIDE;
|
||||
|
||||
private:
|
||||
int32_t length;
|
||||
|
|
|
@ -30,7 +30,7 @@ class ExtraData : public Norms::Enumerator {
|
|||
public:
|
||||
ExtraData(Norms &n, UBool fast);
|
||||
|
||||
void rangeHandler(UChar32 start, UChar32 end, Norm &norm) override;
|
||||
void rangeHandler(UChar32 start, UChar32 end, Norm &norm) U_OVERRIDE;
|
||||
|
||||
UnicodeString maybeYesCompositions;
|
||||
UnicodeString yesYesCompositions;
|
||||
|
|
|
@ -235,7 +235,11 @@ void parseFile(std::ifstream &f, Normalizer2DataBuilder &builder) {
|
|||
std::string lineString;
|
||||
uint32_t startCP, endCP;
|
||||
while(std::getline(f, lineString)) {
|
||||
#if (U_CPLUSPLUS_VERSION >= 11)
|
||||
char *line = &lineString.front();
|
||||
#else
|
||||
char *line = &lineString.at(0);
|
||||
#endif
|
||||
char *comment=(char *)strchr(line, '#');
|
||||
if(comment!=NULL) {
|
||||
*comment=0;
|
||||
|
|
|
@ -199,14 +199,14 @@ class CompositionBuilder : public Norms::Enumerator {
|
|||
public:
|
||||
CompositionBuilder(Norms &n) : Norms::Enumerator(n) {}
|
||||
/** Adds a composition mapping for the first character in a round-trip mapping. */
|
||||
void rangeHandler(UChar32 start, UChar32 end, Norm &norm) override;
|
||||
void rangeHandler(UChar32 start, UChar32 end, Norm &norm) U_OVERRIDE;
|
||||
};
|
||||
|
||||
class Decomposer : public Norms::Enumerator {
|
||||
public:
|
||||
Decomposer(Norms &n) : Norms::Enumerator(n), didDecompose(FALSE) {}
|
||||
/** Decomposes each character of the current mapping. Sets didDecompose if any. */
|
||||
void rangeHandler(UChar32 start, UChar32 end, Norm &norm) override;
|
||||
void rangeHandler(UChar32 start, UChar32 end, Norm &norm) U_OVERRIDE;
|
||||
UBool didDecompose;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue