ICU-5966 Fixed some compiler warnings

X-SVN-Rev: 23806
This commit is contained in:
Kedar Rajwade 2008-04-17 20:52:04 +00:00
parent 3c266c752e
commit cbd785db50
8 changed files with 16 additions and 5 deletions

View File

@ -546,7 +546,8 @@ void RBBITableBuilder::buildStateTable() {
return;
}
RBBIStateDescriptor *failState;
RBBIStateDescriptor *initialState;
// Set it to NULL to avoid uninitialized warning
RBBIStateDescriptor *initialState = NULL;
//
// Add a dummy state 0 - the stop state. Not from Aho.
int lastInputSymbol = fRB->fSetBuilder->getNumCharCategories() - 1;

View File

@ -492,6 +492,7 @@ int32_t JapaneseCalendar::handleGetLimit(UCalendarDateFields field, ELimitType l
return 1;
case UCAL_LIMIT_LEAST_MAXIMUM:
return 1;
case UCAL_LIMIT_COUNT: //added to avoid warning
case UCAL_LIMIT_MAXIMUM:
return GregorianCalendar::handleGetLimit(UCAL_YEAR, UCAL_LIMIT_MAXIMUM) - kEraInfo[kCurrentEra].year;
}

View File

@ -938,7 +938,7 @@ SimpleDateFormat::initGMTFormatters(UErrorCode &status) {
fGMTFormatters = (MessageFormat**)uprv_malloc(kNumGMTFormatters * sizeof(MessageFormat*));
if (fGMTFormatters) {
for (int32_t i = 0; i < kNumGMTFormatters; i++) {
const UnicodeString *hourPattern;
const UnicodeString *hourPattern = NULL; //initialized it to avoid warning
switch (i) {
case kGMTNegativeHMS:
hourPattern = &(fSymbols->fGmtHourFormats[DateFormatSymbols::GMT_NEGATIVE_HMS]);

View File

@ -145,9 +145,11 @@ getTimeZoneTranslationType(TimeZoneTranslationTypeIndex typeIdx) {
case ZSIDX_LONG_DAYLIGHT:
type = DAYLIGHT_LONG;
break;
case ZSIDX_COUNT:
case ZSIDX_SHORT_DAYLIGHT:
type = DAYLIGHT_SHORT;
break;
}
return type;
}
@ -213,6 +215,11 @@ CharacterNode::getChildNode(UChar32 c) const {
return result;
}
//----------------------------------------------------------------------------
// Virtual destructor to avoid warning
TextTrieMapSearchResultHandler::~TextTrieMapSearchResultHandler(){
}
// ----------------------------------------------------------------------------
TextTrieMap::TextTrieMap(UBool ignoreCase)
: fIgnoreCase(ignoreCase), fRoot(NULL) {
@ -1012,6 +1019,7 @@ ZoneStringFormat::getString(const UnicodeString &tzid, TimeZoneTranslationTypeIn
break;
case ZSIDX_SHORT_STANDARD:
case ZSIDX_SHORT_DAYLIGHT:
case ZSIDX_COUNT: //added to avoid warning
case ZSIDX_SHORT_GENERIC:
if (!commonlyUsedOnly || zstrings->isShortFormatCommonlyUsed()) {
zstrings->getString(typeIdx, result);
@ -1036,6 +1044,7 @@ ZoneStringFormat::getString(const UnicodeString &tzid, TimeZoneTranslationTypeIn
break;
case ZSIDX_SHORT_STANDARD:
case ZSIDX_SHORT_DAYLIGHT:
case ZSIDX_COUNT: //added to avoid warning
case ZSIDX_SHORT_GENERIC:
if (!commonlyUsedOnly || mzstrings->isShortFormatCommonlyUsed()) {
mzstrings->getString(typeIdx, result);

View File

@ -59,6 +59,7 @@ class TextTrieMapSearchResultHandler : public UMemory {
public:
virtual UBool handleMatch(int32_t matchLength,
const UVector *values, UErrorCode& status) = 0;
virtual ~TextTrieMapSearchResultHandler(); //added to avoid warning
};
/**

View File

@ -1224,7 +1224,7 @@ u_printf_parse(const u_printf_stream_handler *streamHandler,
const UChar *lastAlias;
const UChar *orgAlias = fmt;
/* parsed argument list */
ufmt_args *arglist;
ufmt_args *arglist = NULL; //initialized it to avoid warning
UErrorCode status = U_ZERO_ERROR;
if (!locStringContext || locStringContext->available >= 0) {
/* get the parsed list of argument types */

View File

@ -99,7 +99,6 @@ static void write_tabs(FileStream* os){
static const char* enc ="";
static UConverter* conv = NULL;
static char NUMBER = ZERO;
static int32_t
uCharsToChars( char* target,int32_t targetLen, UChar* source, int32_t sourceLen,UErrorCode* status){

View File

@ -1414,7 +1414,7 @@ MBCSWrite(NewConverter *cnvData, const UConverterStaticData *staticData,
if(mbcsData->omitFromU) {
/* find how much of stage2 can be omitted */
int32_t utf8Limit=(int32_t)mbcsData->utf8Max+1;
uint32_t st2;
uint32_t st2=0; //initialized it to avoid warning
i=utf8Limit>>MBCS_STAGE_1_SHIFT;
if((utf8Limit&((1<<MBCS_STAGE_1_SHIFT)-1))!=0 && (st2=mbcsData->stage1[i])!=0) {