ICU-13051 Fix some compiler warnings when building with gcc.

X-SVN-Rev: 40287
This commit is contained in:
Jeff Genovy 2017-07-26 21:13:50 +00:00
parent 9a3a03c417
commit 3893b1a1b7
3 changed files with 4 additions and 3 deletions

View File

@ -1382,8 +1382,8 @@ DecimalFormatImpl::toNumberPattern(
DigitInterval maxInterval;
// Only for significant digits
int32_t sigMin;
int32_t sigMax;
int32_t sigMin = 0; /* initialize to avoid compiler warning */
int32_t sigMax = 0; /* initialize to avoid compiler warning */
// These are all the digits to be displayed. For significant digits,
// this interval always starts at the 1's place an extends left.

View File

@ -177,7 +177,7 @@ UnicodeString &DigitFormatter::format(
int32_t digitsLeftOfDecimal = interval.getMostSignificantExclusive();
int32_t lastDigitPos = interval.getLeastSignificantInclusive();
int32_t intBegin = appendTo.length();
int32_t fracBegin;
int32_t fracBegin = 0; /* initialize to avoid compiler warning */
// Emit "0" instead of empty string.
if (digitsLeftOfDecimal == 0 && lastDigitPos == 0) {

View File

@ -396,6 +396,7 @@ void ConfusabledataBuilder::outputData(UErrorCode &status) {
for (i=0; i<numKeys; i++) {
int32_t key = fKeyVec->elementAti(i);
UChar32 codePoint = ConfusableDataUtils::keyToCodePoint(key);
(void)previousCodePoint; // Suppress unused variable warning.
// strictly greater because there can be only one entry per code point
U_ASSERT(codePoint > previousCodePoint);
keys[i] = key;