ICU-3905 Fix some compiler warnings.
X-SVN-Rev: 16748
This commit is contained in:
parent
b43d5d4272
commit
17d109bdce
@ -593,18 +593,18 @@ Hashtable *CanonicalIterator::extract(UChar32 comp, const UChar *segment, int32_
|
||||
UChar temp[bufSize];
|
||||
|
||||
int32_t inputLen = 0, decompLen;
|
||||
UChar buffer[4];
|
||||
UChar stackBuffer[4];
|
||||
const UChar *decomp;
|
||||
|
||||
U16_APPEND_UNSAFE(temp, inputLen, comp);
|
||||
decomp = unorm_getCanonicalDecomposition(comp, buffer, &decompLen);
|
||||
decomp = unorm_getCanonicalDecomposition(comp, stackBuffer, &decompLen);
|
||||
if(decomp == NULL) {
|
||||
/* copy temp */
|
||||
buffer[0] = temp[0];
|
||||
stackBuffer[0] = temp[0];
|
||||
if(inputLen > 1) {
|
||||
buffer[1] = temp[1];
|
||||
stackBuffer[1] = temp[1];
|
||||
}
|
||||
decomp = buffer;
|
||||
decomp = stackBuffer;
|
||||
decompLen = inputLen;
|
||||
}
|
||||
|
||||
|
@ -1190,7 +1190,7 @@ RuleBasedNumberFormat::initDefaultRuleSet()
|
||||
|
||||
|
||||
void
|
||||
RuleBasedNumberFormat::init(const UnicodeString& rules, LocalizationInfo* localizations,
|
||||
RuleBasedNumberFormat::init(const UnicodeString& rules, LocalizationInfo* localizationInfos,
|
||||
UParseError& /* pErr */, UErrorCode& status)
|
||||
{
|
||||
// TODO: implement UParseError
|
||||
@ -1199,7 +1199,7 @@ RuleBasedNumberFormat::init(const UnicodeString& rules, LocalizationInfo* locali
|
||||
return;
|
||||
}
|
||||
|
||||
this->localizations = localizations == NULL ? NULL : localizations->ref();
|
||||
this->localizations = localizationInfos == NULL ? NULL : localizationInfos->ref();
|
||||
|
||||
UnicodeString description(rules);
|
||||
if (!description.length()) {
|
||||
@ -1343,17 +1343,17 @@ RuleBasedNumberFormat::init(const UnicodeString& rules, LocalizationInfo* locali
|
||||
// a separate array of the public rule set names, so we have less work
|
||||
// to do here-- but we still need to check the names.
|
||||
|
||||
if (localizations) {
|
||||
if (localizationInfos) {
|
||||
// confirm the names, if any aren't in the rules, that's an error
|
||||
// it is ok if the rules contain public rule sets that are not in this list
|
||||
for (int32_t i = 0; i < localizations->getNumberOfRuleSets(); ++i) {
|
||||
UnicodeString name(TRUE, localizations->getRuleSetName(i), -1);
|
||||
for (int32_t i = 0; i < localizationInfos->getNumberOfRuleSets(); ++i) {
|
||||
UnicodeString name(TRUE, localizationInfos->getRuleSetName(i), -1);
|
||||
NFRuleSet* rs = findRuleSet(name, status);
|
||||
if (rs == NULL) {
|
||||
break; // error
|
||||
break; // error
|
||||
}
|
||||
if (i == 0) {
|
||||
defaultRuleSet = rs;
|
||||
defaultRuleSet = rs;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -36,9 +36,8 @@ log_err("Test Failure at file %s, line %d\n", __FILE__, __LINE__);}}
|
||||
|
||||
#define TEST_ASSERT_STRING(expected, actual, nulTerm) { \
|
||||
char buf_inside_macro[120]; \
|
||||
int32_t len; \
|
||||
int32_t len = (int32_t)strlen(expected); \
|
||||
UBool success; \
|
||||
len = strlen(expected); \
|
||||
if (nulTerm) { \
|
||||
u_austrncpy(buf_inside_macro, (actual), len+1); \
|
||||
success = (strcmp((expected), buf_inside_macro) == 0); \
|
||||
@ -912,8 +911,6 @@ static void TestRegexCAPI(void) {
|
||||
uregex_close(re);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif /* !UCONFIG_NO_REGULAR_EXPRESSIONS */
|
||||
|
Loading…
Reference in New Issue
Block a user