ICU-3905 Fix some compiler warnings.

X-SVN-Rev: 16648
This commit is contained in:
George Rhoten 2004-10-27 23:40:36 +00:00
parent 039e695ba1
commit 85c0552e8f
5 changed files with 10 additions and 11 deletions

View file

@ -661,7 +661,7 @@ ICUResourceBundleFactory::handleCreate(const Locale& loc, int32_t /* kind */, co
char pkg[20];
int32_t length;
length=_bundleName.extract(0, INT32_MAX, pkg, (int32_t)sizeof(pkg), US_INV);
if(length>=sizeof(pkg)) {
if(length>=(int32_t)sizeof(pkg)) {
return NULL;
}
return new ResourceBundle(pkg, loc, status);

View file

@ -1061,13 +1061,15 @@ void RBBIRuleScanner::parse() {
// printNodeStack for debugging...
//
//---------------------------------------------------------------------------------
void RBBIRuleScanner::printNodeStack(const char *title) {
#ifdef RBBI_DEBUG
void RBBIRuleScanner::printNodeStack(const char *) {}
#else
void RBBIRuleScanner::printNodeStack(const char *title) {
int i;
RBBIDebugPrintf("%s. Dumping node stack...\n", title);
for (i=fNodeStackPtr; i>0; i--) {fNodeStack[i]->printTree(TRUE);}
#endif
}
#endif

View file

@ -208,14 +208,12 @@ DecimalFormatSymbols::initialize(const UChar** numberElements, int32_t *numberEl
{kPlusSignSymbol, 11},
{kMonetarySeparatorSymbol, 0}
};
static const int32_t TYPE_MAPPING_LEN = (int32_t)(sizeof(TYPE_MAPPING)/sizeof(TYPE_MAPPING[0]));
int32_t idx;
if (numberElementsLength > TYPE_MAPPING_LEN) {
numberElementsLength = TYPE_MAPPING_LEN;
}
for (idx = 0; idx < numberElementsLength; idx++) {
fSymbols[TYPE_MAPPING[idx][0]].setTo(TRUE, numberElements[TYPE_MAPPING[idx][1]], numberElementsStrLen[TYPE_MAPPING[idx][1]]);
for (idx = 0; idx < (int32_t)(sizeof(TYPE_MAPPING)/sizeof(TYPE_MAPPING[0])); idx++) {
if (TYPE_MAPPING[idx][1] < numberElementsLength) {
fSymbols[TYPE_MAPPING[idx][0]].setTo(TRUE, numberElements[TYPE_MAPPING[idx][1]], numberElementsStrLen[TYPE_MAPPING[idx][1]]);
}
}
// Default values until it's set later on.

View file

@ -900,7 +900,7 @@ RuleBasedNumberFormat::getRuleSetDisplayNameLocale(int32_t index, UErrorCode& st
if (cap > 64) {
bp = new char[cap];
}
int32_t len = name.extract(0, name.length(), bp, cap, UnicodeString::kInvariant);
name.extract(0, name.length(), bp, cap, UnicodeString::kInvariant);
Locale retLocale(bp);
if (bp != buffer) {
delete[] bp;

View file

@ -652,7 +652,6 @@ void TransliteratorIDParser::registerSpecialInverse(const UnicodeString& target,
umtx_init(&LOCK);
Mutex lock(&LOCK);
UErrorCode ec = U_ZERO_ERROR;
SPECIAL_INVERSES->put(target, new UnicodeString(inverseTarget), status);
if (bidirectional) {
SPECIAL_INVERSES->put(inverseTarget, new UnicodeString(target), status);