From 657313137120797177702e113dd7379939fcf658 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Fri, 17 Aug 2001 21:50:48 +0000 Subject: [PATCH] ICU-900 Fixed some compiler warnings. X-SVN-Rev: 5525 --- icu4c/source/i18n/choicfmt.cpp | 27 +++++++++++---------------- icu4c/source/i18n/unicode/choicfmt.h | 4 ++-- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/icu4c/source/i18n/choicfmt.cpp b/icu4c/source/i18n/choicfmt.cpp index 0179af39bca..59ded53ceda 100644 --- a/icu4c/source/i18n/choicfmt.cpp +++ b/icu4c/source/i18n/choicfmt.cpp @@ -238,13 +238,12 @@ ChoiceFormat::releaseNumberFormat(NumberFormat *adopt) */ double -ChoiceFormat::stod(const UnicodeString& string, - UErrorCode& status) +ChoiceFormat::stod(const UnicodeString& string) { - - char source[256] = { '\0' }; + char source[256]; char* end; - string.extract(0,string.length(),source,256,""/*default codepage*/); + + string.extract(0, string.length(), source, 256, ""); /* invariant codepage */ return uprv_strtod(source,&end); } @@ -256,11 +255,11 @@ ChoiceFormat::stod(const UnicodeString& string, */ UnicodeString& ChoiceFormat::dtos(double value, - UnicodeString& string, - UErrorCode& status) + UnicodeString& string) { - char temp[256] = {'\0'}; - uprv_dtostr(value,temp,3,TRUE); + char temp[256]; + + uprv_dtostr(value, temp, 3, TRUE); string = UnicodeString(temp); return string; } @@ -417,7 +416,7 @@ ChoiceFormat::applyPattern(const UnicodeString& pattern, UErrorCode& status) { UParseError parseError; - applyPattern(pattern,parseError,status); + applyPattern(pattern, parseError, status); } // ------------------------------------- @@ -501,10 +500,7 @@ ChoiceFormat::applyPattern(const UnicodeString& pattern, } else if (!buf.compare(fgNegativeInfinity, NEGATIVE_INF_STRLEN)) { limit = -uprv_getInfinity(); } else { - limit = stod(buf, status); - if (U_FAILURE(status)) { - goto error; - } + limit = stod(buf); } if (k == count) { @@ -580,7 +576,6 @@ ChoiceFormat::toPattern(UnicodeString& result) const if (i != 0) { result += VERTICAL_BAR; } - UErrorCode status = U_ZERO_ERROR; UnicodeString buf; if (uprv_isPositiveInfinity(fChoiceLimits[i])) { result += INFINITY; @@ -588,7 +583,7 @@ ChoiceFormat::toPattern(UnicodeString& result) const result += MINUS; result += INFINITY; } else { - result += dtos(fChoiceLimits[i], buf, status); + result += dtos(fChoiceLimits[i], buf); } if (fClosures[i]) { result += LESS_THAN; diff --git a/icu4c/source/i18n/unicode/choicfmt.h b/icu4c/source/i18n/unicode/choicfmt.h index 8ff3d4b2de7..5f38068fb04 100644 --- a/icu4c/source/i18n/unicode/choicfmt.h +++ b/icu4c/source/i18n/unicode/choicfmt.h @@ -586,7 +586,7 @@ private: * @param status error code. * @return the converted double number. */ - static double stod(const UnicodeString& string, UErrorCode& status); + static double stod(const UnicodeString& string); /** * Converts a double value to a string using a default NumberFormat object @@ -596,7 +596,7 @@ private: * @@param status error code. * @@return the converted string. */ - static UnicodeString& dtos(double value, UnicodeString& string, UErrorCode& status); + static UnicodeString& dtos(double value, UnicodeString& string); //static UMTX fgMutex; //static NumberFormat* fgNumberFormat;