mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 08:53:20 +00:00
ICU-5966 Fix some compiler warnings.
X-SVN-Rev: 23540
This commit is contained in:
parent
5eb6fafc8b
commit
d1551dee4e
13 changed files with 50 additions and 50 deletions
icu4c/source
i18n
layout
test/intltest
tools
|
@ -194,7 +194,6 @@ public:
|
|||
PatternMap();
|
||||
virtual ~PatternMap();
|
||||
void add(const UnicodeString& basePattern, const PtnSkeleton& skeleton, const UnicodeString& value, UErrorCode& status);
|
||||
UErrorCode status;
|
||||
const UnicodeString* getPatternFromBasePattern(UnicodeString& basePattern);
|
||||
const UnicodeString* getPatternFromSkeleton(PtnSkeleton& skeleton);
|
||||
void copyFrom(const PatternMap& other, UErrorCode& status);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
**********************************************************************
|
||||
* Copyright (C) 2001-2007, International Business Machines
|
||||
* Copyright (C) 2001-2008, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
**********************************************************************
|
||||
* Date Name Description
|
||||
|
@ -66,7 +66,8 @@ NameUnicodeTransliterator::NameUnicodeTransliterator(UnicodeFilter* adoptedFilte
|
|||
_set_add,
|
||||
NULL, // Don't need _set_addRange
|
||||
NULL, // Don't need _set_addString
|
||||
NULL // Don't need remove()
|
||||
NULL, // Don't need remove()
|
||||
NULL
|
||||
};
|
||||
uprv_getCharNameCharacters(&sa);
|
||||
}
|
||||
|
|
|
@ -44,28 +44,28 @@ PluralFormat::PluralFormat(const PluralRules& rules, UErrorCode& status) {
|
|||
init(&rules, Locale::getDefault(), status);
|
||||
}
|
||||
|
||||
PluralFormat::PluralFormat(const Locale& locale, const PluralRules& rules, UErrorCode& status) {
|
||||
init(&rules, locale, status);
|
||||
PluralFormat::PluralFormat(const Locale& loc, const PluralRules& rules, UErrorCode& status) {
|
||||
init(&rules, loc, status);
|
||||
}
|
||||
|
||||
PluralFormat::PluralFormat(const UnicodeString& pattern, UErrorCode& status) {
|
||||
PluralFormat::PluralFormat(const UnicodeString& pat, UErrorCode& status) {
|
||||
init(NULL, Locale::getDefault(), status);
|
||||
applyPattern(pattern, status);
|
||||
applyPattern(pat, status);
|
||||
}
|
||||
|
||||
PluralFormat::PluralFormat(const Locale& locale, const UnicodeString& pattern, UErrorCode& status) {
|
||||
init(NULL, locale, status);
|
||||
applyPattern(pattern, status);
|
||||
PluralFormat::PluralFormat(const Locale& loc, const UnicodeString& pat, UErrorCode& status) {
|
||||
init(NULL, loc, status);
|
||||
applyPattern(pat, status);
|
||||
}
|
||||
|
||||
PluralFormat::PluralFormat(const PluralRules& rules, const UnicodeString& pattern, UErrorCode& status) {
|
||||
init(&rules, locale, status);
|
||||
applyPattern(pattern, status);
|
||||
PluralFormat::PluralFormat(const PluralRules& rules, const UnicodeString& pat, UErrorCode& status) {
|
||||
init(&rules, Locale::getDefault(), status);
|
||||
applyPattern(pat, status);
|
||||
}
|
||||
|
||||
PluralFormat::PluralFormat(const Locale& locale, const PluralRules& rules, const UnicodeString& pattern, UErrorCode& status) {
|
||||
init(&rules, locale, status);
|
||||
applyPattern(pattern, status);
|
||||
PluralFormat::PluralFormat(const Locale& loc, const PluralRules& rules, const UnicodeString& pat, UErrorCode& status) {
|
||||
init(&rules, loc, status);
|
||||
applyPattern(pat, status);
|
||||
}
|
||||
|
||||
PluralFormat::PluralFormat(const PluralFormat& other) : Format(other) {
|
||||
|
@ -323,7 +323,7 @@ PluralFormat::checkSufficientDefinition() {
|
|||
}
|
||||
|
||||
void
|
||||
PluralFormat::setLocale(const Locale& locale, UErrorCode& status) {
|
||||
PluralFormat::setLocale(const Locale& loc, UErrorCode& status) {
|
||||
if (pluralRules!=NULL) {
|
||||
delete pluralRules;
|
||||
pluralRules=NULL;
|
||||
|
@ -337,7 +337,7 @@ PluralFormat::setLocale(const Locale& locale, UErrorCode& status) {
|
|||
numberFormat = NULL;
|
||||
replacedNumberFormat=NULL;
|
||||
}
|
||||
init(NULL, locale, status);
|
||||
init(NULL, loc, status);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -833,13 +833,13 @@ RuleChain::getKeywords(int32_t capacityOfKeywords, UnicodeString* keywords, int3
|
|||
}
|
||||
|
||||
UBool
|
||||
RuleChain::isKeyword(const UnicodeString& keyword) const {
|
||||
if ( this->keyword == keyword ) {
|
||||
RuleChain::isKeyword(const UnicodeString& keywordParam) const {
|
||||
if ( keyword == keywordParam ) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if ( next != NULL ) {
|
||||
return next->isKeyword(keyword);
|
||||
return next->isKeyword(keywordParam);
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
|
|
|
@ -662,7 +662,7 @@ void TransliteratorRegistry::put(const UnicodeString& ID,
|
|||
const UnicodeString& alias,
|
||||
UBool readonlyAliasAlias,
|
||||
UBool visible,
|
||||
UErrorCode& ec) {
|
||||
UErrorCode& /*ec*/) {
|
||||
Entry *entry = new Entry();
|
||||
// Null pointer check
|
||||
if (entry != NULL) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*
|
||||
* (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved
|
||||
* (C) Copyright IBM Corp. 1998-2008 - All Rights Reserved
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -409,7 +409,7 @@ le_bool GlyphIterator::hasFeatureTag(le_bool matchGroup) const
|
|||
LEErrorCode success = LE_NO_ERROR;
|
||||
FeatureMask fm = glyphStorage.getAuxData(position, success);
|
||||
|
||||
return ((fm & featureMask) == featureMask) && (!matchGroup || (fm & LE_GLYPH_GROUP_MASK) == glyphGroup);
|
||||
return ((fm & featureMask) == featureMask) && (!matchGroup || (le_int32)(fm & LE_GLYPH_GROUP_MASK) == glyphGroup);
|
||||
}
|
||||
|
||||
le_bool GlyphIterator::findFeatureTag()
|
||||
|
|
|
@ -398,7 +398,6 @@ void IntlTestDateTimePatternGeneratorAPI::testAPI(/*char *par*/)
|
|||
pattern = UnicodeString("hmv");
|
||||
UnicodeString expR = UnicodeString("h:m a v");
|
||||
Locale loc("en");
|
||||
UDate testDate1= LocaleTest::date(99, 0, 13, 23, 58, 59);
|
||||
DateTimePatternGenerator *patGen=DateTimePatternGenerator::createInstance(loc, status);
|
||||
if(U_FAILURE(status)) {
|
||||
dataerrln("ERROR: Could not create DateTimePatternGenerator");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 2007, International Business Machines Corporation and
|
||||
* Copyright (C) 2007-2008, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
********************************************************************************
|
||||
|
||||
|
@ -208,7 +208,6 @@ UBool testEquality(PluralRules *test) {
|
|||
UBool ret=TRUE;
|
||||
for (int32_t i=0; i<MAX_EQ_ROW; ++i) {
|
||||
PluralRules* rules[MAX_EQ_COL];
|
||||
UnicodeString result[MAX_EQ_COL];
|
||||
|
||||
for (int32_t j=0; j<MAX_EQ_COL; ++j) {
|
||||
rules[j]=NULL;
|
||||
|
|
|
@ -558,7 +558,6 @@ void TestMessageFormat::testMsgFormatPlural(/* char* par */)
|
|||
logln(UnicodeString("The results of argumentName and argumentIndex are not the same."));
|
||||
}
|
||||
err = U_ZERO_ERROR;
|
||||
int32_t fmtsCnt=0;
|
||||
|
||||
delete mfNum;
|
||||
delete mfAlpha;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/********************************************************************
|
||||
* COPYRIGHT:
|
||||
* Copyright (c) 1997-2007, International Business Machines Corporation and
|
||||
* Copyright (c) 1997-2008, International Business Machines Corporation and
|
||||
* others. All Rights Reserved.
|
||||
********************************************************************/
|
||||
|
||||
|
@ -1723,7 +1723,8 @@ BasicNormalizerTest::TestSkippable() {
|
|||
_set_add,
|
||||
_set_addRange,
|
||||
_set_addString,
|
||||
NULL // don't need remove()
|
||||
NULL, // don't need remove()
|
||||
NULL
|
||||
};
|
||||
unorm_addPropertyStarts(&sa, &status);
|
||||
if(U_FAILURE(status)) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1999-2007, International Business Machines
|
||||
* Copyright (C) 1999-2008, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
|
@ -464,7 +464,7 @@ static void U_CALLCONV
|
|||
lineFn(void *context,
|
||||
char *fields[][2], int32_t fieldCount,
|
||||
UErrorCode *pErrorCode) {
|
||||
Options *options=(Options *)context;
|
||||
Options *storeOptions=(Options *)context;
|
||||
char *names[3];
|
||||
int16_t lengths[3]={ 0, 0, 0 };
|
||||
static uint32_t prevCode=0;
|
||||
|
@ -477,7 +477,7 @@ lineFn(void *context,
|
|||
code=uprv_strtoul(fields[0][0], NULL, 16);
|
||||
|
||||
/* get the character name */
|
||||
if(options->storeNames) {
|
||||
if(storeOptions->storeNames) {
|
||||
names[0]=fields[1][0];
|
||||
lengths[0]=getName(names+0, fields[1][1]);
|
||||
if(names[0][0]=='<') {
|
||||
|
@ -488,7 +488,7 @@ lineFn(void *context,
|
|||
|
||||
/* store 1.0 names */
|
||||
/* get the second character name, the one from Unicode 1.0 */
|
||||
if(options->store10Names) {
|
||||
if(storeOptions->store10Names) {
|
||||
names[1]=fields[10][0];
|
||||
lengths[1]=getName(names+1, fields[10][1]);
|
||||
if(names[1][0]=='<') {
|
||||
|
@ -498,7 +498,7 @@ lineFn(void *context,
|
|||
}
|
||||
|
||||
/* get the ISO 10646 comment */
|
||||
if(options->storeISOComments) {
|
||||
if(storeOptions->storeISOComments) {
|
||||
names[2]=fields[11][0];
|
||||
lengths[2]=getName(names+2, fields[11][1]);
|
||||
}
|
||||
|
@ -536,8 +536,8 @@ lineFn(void *context,
|
|||
*
|
||||
* addLine() will ignore empty trailing names
|
||||
*/
|
||||
if(options->storeNames) {
|
||||
/* store names and comments as parsed according to options */
|
||||
if(storeOptions->storeNames) {
|
||||
/* store names and comments as parsed according to storeOptions */
|
||||
addLine(code, names, lengths, 3);
|
||||
} else {
|
||||
/* store only ISO 10646 comments */
|
||||
|
@ -546,11 +546,11 @@ lineFn(void *context,
|
|||
}
|
||||
|
||||
static void
|
||||
parseDB(const char *filename, Options *options) {
|
||||
parseDB(const char *filename, Options *storeOptions) {
|
||||
char *fields[15][2];
|
||||
UErrorCode errorCode=U_ZERO_ERROR;
|
||||
|
||||
u_parseDelimitedFile(filename, ';', fields, 15, lineFn, options, &errorCode);
|
||||
u_parseDelimitedFile(filename, ';', fields, 15, lineFn, storeOptions, &errorCode);
|
||||
if(U_FAILURE(errorCode)) {
|
||||
fprintf(stderr, "gennames parse error: %s\n", u_errorName(errorCode));
|
||||
exit(errorCode);
|
||||
|
@ -917,7 +917,7 @@ compareWords(const void *context, const void *word1, const void *word2) {
|
|||
/* generate output data ----------------------------------------------------- */
|
||||
|
||||
static void
|
||||
generateData(const char *dataDir, Options *options) {
|
||||
generateData(const char *dataDir, Options *storeOptions) {
|
||||
UNewDataMemory *pData;
|
||||
UErrorCode errorCode=U_ZERO_ERROR;
|
||||
uint16_t groupWords[3];
|
||||
|
@ -927,7 +927,7 @@ generateData(const char *dataDir, Options *options) {
|
|||
int16_t token;
|
||||
|
||||
pData=udata_create(dataDir,
|
||||
DATA_TYPE, options->storeNames ? DATA_NAME : ISO_DATA_NAME,
|
||||
DATA_TYPE, storeOptions->storeNames ? DATA_NAME : ISO_DATA_NAME,
|
||||
&dataInfo,
|
||||
haveCopyright ? U_COPYRIGHT_STRING : NULL, &errorCode);
|
||||
if(U_FAILURE(errorCode)) {
|
||||
|
@ -1003,7 +1003,7 @@ generateData(const char *dataDir, Options *options) {
|
|||
groupStringOffset=groupsOffset+2+6*lineCount;
|
||||
algNamesOffset=(groupStringOffset+(groupTop-groupBottom)+3)&~3;
|
||||
|
||||
offset=generateAlgorithmicData(NULL, options);
|
||||
offset=generateAlgorithmicData(NULL, storeOptions);
|
||||
size=algNamesOffset+offset;
|
||||
|
||||
if(!beQuiet) {
|
||||
|
@ -1050,7 +1050,7 @@ generateData(const char *dataDir, Options *options) {
|
|||
/* 4-align the algorithmic names data */
|
||||
udata_writePadding(pData, algNamesOffset-(groupStringOffset+(groupTop-groupBottom)));
|
||||
|
||||
generateAlgorithmicData(pData, options);
|
||||
generateAlgorithmicData(pData, storeOptions);
|
||||
|
||||
/* finish up */
|
||||
dataLength=udata_finish(pData, &errorCode);
|
||||
|
@ -1074,7 +1074,7 @@ typedef struct AlgorithmicRange {
|
|||
} AlgorithmicRange;
|
||||
|
||||
static uint32_t
|
||||
generateAlgorithmicData(UNewDataMemory *pData, Options *options) {
|
||||
generateAlgorithmicData(UNewDataMemory *pData, Options *storeOptions) {
|
||||
static char prefix[] = "CJK UNIFIED IDEOGRAPH-";
|
||||
# define PREFIX_LENGTH 23
|
||||
# define PREFIX_LENGTH_4 24
|
||||
|
@ -1133,7 +1133,7 @@ generateAlgorithmicData(UNewDataMemory *pData, Options *options) {
|
|||
}
|
||||
|
||||
/* number of ranges of algorithmic names */
|
||||
if(!options->storeNames) {
|
||||
if(!storeOptions->storeNames) {
|
||||
countAlgRanges=0;
|
||||
} else if(ucdVersion>=UNI_3_1) {
|
||||
/* Unicode 3.1 and up has 4 ranges including CJK Extension B */
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2000-2007, International Business Machines
|
||||
* Copyright (C) 2000-2008, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
|
@ -1431,8 +1431,10 @@ MBCSWrite(NewConverter *cnvData, const UConverterStaticData *staticData,
|
|||
stage2Length-=stage2Start;
|
||||
if(VERBOSE) {
|
||||
printf("+ omitting %lu out of %lu stage2 entries and %lu fromUBytes\n",
|
||||
stage2Start, mbcsData->stage2Top, mbcsData->stage3Top);
|
||||
printf("+ total size savings: %lu bytes\n", stage2Start*4+mbcsData->stage3Top);
|
||||
(unsigned long)stage2Start,
|
||||
(unsigned long)mbcsData->stage2Top,
|
||||
(unsigned long)mbcsData->stage3Top);
|
||||
printf("+ total size savings: %lu bytes\n", (unsigned long)stage2Start*4+mbcsData->stage3Top);
|
||||
}
|
||||
} else {
|
||||
stage2Start=0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
*
|
||||
* Copyright (C) 2000-2007, International Business Machines
|
||||
* Copyright (C) 2000-2008, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
*******************************************************************************
|
||||
|
@ -110,7 +110,7 @@ typedef struct MBCSData MBCSData;
|
|||
* Assume maxCharLength>1.
|
||||
*/
|
||||
U_CFUNC const MBCSData *
|
||||
MBCSGetDummy();
|
||||
MBCSGetDummy(void);
|
||||
|
||||
/* Test if a 1:1 mapping fits into the MBCS base table's fromUnicode structure. */
|
||||
U_CFUNC UBool
|
||||
|
|
Loading…
Add table
Reference in a new issue