ICU-3905 Fix some compiler warnings.

X-SVN-Rev: 16647
This commit is contained in:
George Rhoten 2004-10-27 22:55:57 +00:00
parent 811ebbee0f
commit 039e695ba1
6 changed files with 14 additions and 6 deletions

View File

@ -58,6 +58,7 @@
#include "unicode/utypes.h"
#include "unicode/putil.h"
#include "unicode/ustring.h"
#include "putilimp.h"
#include "uassert.h"
#include "umutex.h"
#include "cmemory.h"
@ -1897,7 +1898,6 @@ int_getDefaultCodepage()
char *name = NULL;
char *euro = NULL;
const char *localeName = NULL;
const char *defaultTable = NULL;
uprv_memset(codesetName, 0, sizeof(codesetName));

View File

@ -44,7 +44,7 @@ ResourceBundle::constructForLocale(const UnicodeString& path,
{
char name[300];
if(path.length() >= sizeof(name)) {
if(path.length() >= (int32_t)sizeof(name)) {
fResource = NULL;
error = U_ILLEGAL_ARGUMENT_ERROR;
} else if(!path.isEmpty()) {

View File

@ -24,6 +24,7 @@
#include "cstring.h"
#include "ucln_cmn.h"
#include "udataswp.h"
#include "uprops.h"
/* prototypes ------------------------------------------------------------- */

View File

@ -144,7 +144,9 @@ void CaseMapTransliterator::handleTransliterate(Replaceable& text,
return;
}
UCaseContext csc={ &text };
UCaseContext csc;
uprv_memset(&csc, 0, sizeof(csc));
csc.p = &text;
csc.start = offsets.contextStart;
csc.limit = offsets.contextLimit;

View File

@ -154,7 +154,6 @@ DecimalFormatSymbols::initialize(const Locale& loc, UErrorCode& status,
int32_t numberElementsStrLen[kFormatSymbolCount];
int32_t i = 0;
for(i = 0; i<numberElementsLength; i++) {
int32_t len = 0;
numberElements[i] = ures_getStringByIndex(numberElementsRes, i, &numberElementsStrLen[i], &status);
}
@ -209,9 +208,13 @@ 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 < (int32_t)(sizeof(TYPE_MAPPING)/sizeof(TYPE_MAPPING[0])); idx++) {
for (idx = 0; idx < numberElementsLength; idx++) {
fSymbols[TYPE_MAPPING[idx][0]].setTo(TRUE, numberElements[TYPE_MAPPING[idx][1]], numberElementsStrLen[TYPE_MAPPING[idx][1]]);
}

View File

@ -107,7 +107,9 @@ void TitlecaseTransliterator::handleTransliterate(
// Convert things after a cased character toLower; things
// after an uncased, non-case-ignorable character toTitle. Case-ignorable
// characters are copied directly and do not change the mode.
UCaseContext csc={ &text };
UCaseContext csc;
uprv_memset(&csc, 0, sizeof(csc));
csc.p = &text;
csc.start = offsets.contextStart;
csc.limit = offsets.contextLimit;