ICU-9711 OS/400 fixes

X-SVN-Rev: 32742
This commit is contained in:
Steven R. Loomis 2012-11-02 19:41:57 +00:00
parent c96a2a678d
commit f2306f2577
5 changed files with 20 additions and 20 deletions

View File

@ -35,7 +35,7 @@ int32_t UCharsDictionaryMatcher::getType() const {
return DictionaryData::TRIE_TYPE_UCHARS;
}
int32_t UCharsDictionaryMatcher::matches(UText *text, int32_t maxLength, int *lengths, int &count, int limit, int32_t *values) const {
int32_t UCharsDictionaryMatcher::matches(UText *text, int32_t maxLength, int32_t *lengths, int32_t &count, int32_t limit, int32_t *values) const {
UCharsTrie uct(characters);
UChar32 c = utext_next32(text);
if (c < 0) {
@ -99,7 +99,7 @@ int32_t BytesDictionaryMatcher::getType() const {
return DictionaryData::TRIE_TYPE_BYTES;
}
int32_t BytesDictionaryMatcher::matches(UText *text, int32_t maxLength, int *lengths, int &count, int limit, int32_t *values) const {
int32_t BytesDictionaryMatcher::matches(UText *text, int32_t maxLength, int32_t *lengths, int32_t &count, int32_t limit, int32_t *values) const {
BytesTrie bt(characters);
UChar32 c = utext_next32(text);
if (c < 0) {

View File

@ -68,8 +68,8 @@ class U_COMMON_API DictionaryMatcher : public UMemory {
public:
virtual ~DictionaryMatcher();
// this should emulate CompactTrieDictionary::matches()
virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count,
int limit, int32_t *values = NULL) const = 0;
virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int32_t &count,
int32_t limit, int32_t *values = NULL) const = 0;
/** @return DictionaryData::TRIE_TYPE_XYZ */
virtual int32_t getType() const = 0;
};
@ -81,8 +81,8 @@ public:
// The UDataMemory * will be closed on this object's destruction.
UCharsDictionaryMatcher(const UChar *c, UDataMemory *f) : characters(c), file(f) { }
virtual ~UCharsDictionaryMatcher();
virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count,
int limit, int32_t *values = NULL) const;
virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int32_t &count,
int32_t limit, int32_t *values = NULL) const;
virtual int32_t getType() const;
private:
const UChar *characters;
@ -98,8 +98,8 @@ public:
BytesDictionaryMatcher(const char *c, int32_t t, UDataMemory *f)
: characters(c), transformConstant(t), file(f) { }
virtual ~BytesDictionaryMatcher();
virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int &count,
int limit, int32_t *values = NULL) const;
virtual int32_t matches(UText *text, int32_t maxLength, int32_t *lengths, int32_t &count,
int32_t limit, int32_t *values = NULL) const;
virtual int32_t getType() const;
private:
UChar32 transform(UChar32 c) const;

View File

@ -1146,7 +1146,7 @@ DecimalFormat::_format(int64_t number,
int32_t intBegin = appendTo.length();
while((prependZero--)>0) {
appendTo.append(0x0030); // '0'
appendTo.append((UChar)0x0030); // '0'
}
appendTo.append(outputStr+destIdx+

View File

@ -2057,7 +2057,7 @@ TimeZoneFormat::expandOffsetPattern(const UnicodeString& offsetHM, UnicodeString
}
UnicodeString sep;
int32_t idx_H = offsetHM.tempSubString(0, idx_mm).lastIndexOf(0x0048 /* H */);
int32_t idx_H = offsetHM.tempSubString(0, idx_mm).lastIndexOf((UChar)0x0048 /* H */);
if (idx_H >= 0) {
sep = offsetHM.tempSubString(idx_H + 1, idx_mm - (idx_H + 1));
}

View File

@ -871,20 +871,20 @@ ZoneMeta::formatCustomID(uint8_t hour, uint8_t min, uint8_t sec, UBool negative,
id.setTo(gCustomTzPrefix, -1);
if (hour != 0 || min != 0) {
if (negative) {
id.append(0x2D); // '-'
id.append((UChar)0x2D); // '-'
} else {
id.append(0x2B); // '+'
id.append((UChar)0x2B); // '+'
}
// Always use US-ASCII digits
id.append(0x30 + (hour%100)/10);
id.append(0x30 + (hour%10));
id.append(0x3A); // ':'
id.append(0x30 + (min%100)/10);
id.append(0x30 + (min%10));
id.append((UChar)0x30 + (hour%100)/10);
id.append((UChar)0x30 + (hour%10));
id.append((UChar)0x3A); // ':'
id.append((UChar)(0x30 + (min%100)/10));
id.append((UChar)(0x30 + (min%10)));
if (sec != 0) {
id.append(0x3A); // ':'
id.append(0x30 + (sec%100)/10);
id.append(0x30 + (sec%10));
id.append((UChar)0x3A); // ':'
id.append((UChar)(0x30 + (sec%100)/10));
id.append((UChar)(0x30 + (sec%10)));
}
}
return id;