From 15b4fbebc17040a77ce3bda75ad4b815871f198f Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 22 May 2001 16:54:15 +0000 Subject: [PATCH] ICU-900 Fixed some compiler warnings. X-SVN-Rev: 4749 --- icu4c/source/i18n/dtfmtsym.cpp | 10 +++++----- icu4c/source/test/intltest/caltest.cpp | 4 ++-- icu4c/source/test/intltest/cppcnvt.cpp | 2 +- icu4c/source/test/intltest/dtfmrgts.cpp | 2 +- icu4c/source/test/intltest/dtfmttst.cpp | 12 ++++++------ icu4c/source/test/intltest/tfsmalls.cpp | 6 +++--- icu4c/source/test/intltest/tstnorm.cpp | 2 +- icu4c/source/test/intltest/tzregts.cpp | 2 +- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/icu4c/source/i18n/dtfmtsym.cpp b/icu4c/source/i18n/dtfmtsym.cpp index 0866b33be6..6adc675a32 100644 --- a/icu4c/source/i18n/dtfmtsym.cpp +++ b/icu4c/source/i18n/dtfmtsym.cpp @@ -456,13 +456,13 @@ DateFormatSymbols::initializeData(const Locale& locale, UErrorCode& status, UBoo status = U_USING_FALLBACK_ERROR; fEras = (UnicodeString*)fgLastResortEras; - fErasCount = sizeof(fgLastResortEras[0]) / sizeof(fgLastResortEras[0]); + fErasCount = (int32_t)(sizeof(fgLastResortEras[0]) / sizeof(fgLastResortEras[0])); fMonths = fShortMonths = (UnicodeString*)fgLastResortMonthNames; - fMonthsCount = fShortMonthsCount = sizeof(fgLastResortMonthNames) / sizeof(fgLastResortMonthNames[0]); + fMonthsCount = fShortMonthsCount = (int32_t)(sizeof(fgLastResortMonthNames) / sizeof(fgLastResortMonthNames[0])); fWeekdays = fShortWeekdays = (UnicodeString*)fgLastResortDayNames; - fWeekdaysCount = fShortWeekdaysCount = sizeof(fgLastResortDayNames) / sizeof(fgLastResortDayNames[0]); + fWeekdaysCount = fShortWeekdaysCount = (int32_t)(sizeof(fgLastResortDayNames) / sizeof(fgLastResortDayNames[0])); fAmPms = (UnicodeString*)fgLastResortAmPmMarkers; - fAmPmsCount = sizeof(fgLastResortAmPmMarkers) / sizeof(fgLastResortAmPmMarkers[0]); + fAmPmsCount = (int32_t)(sizeof(fgLastResortAmPmMarkers) / sizeof(fgLastResortAmPmMarkers[0])); if (fgLastResortZoneStringsH == 0) { // Initialize this -- the compiler doesn't like to do so at static init time @@ -473,7 +473,7 @@ DateFormatSymbols::initializeData(const Locale& locale, UErrorCode& status, UBoo } fZoneStrings = fgLastResortZoneStringsH; fZoneStringsRowCount = 1; - fZoneStringsColCount = sizeof(fgLastResortZoneStrings); + fZoneStringsColCount = (int32_t)(sizeof(fgLastResortZoneStrings)); fLocalPatternChars = fgPatternChars; } return; diff --git a/icu4c/source/test/intltest/caltest.cpp b/icu4c/source/test/intltest/caltest.cpp index 457b96f16c..25fe33cf78 100644 --- a/icu4c/source/test/intltest/caltest.cpp +++ b/icu4c/source/test/intltest/caltest.cpp @@ -1104,8 +1104,8 @@ int32_t CalendarTest::EXPECTED_FIELDS[] = { Calendar::DAY_OF_YEAR, 295 }; -const int32_t CalendarTest::EXPECTED_FIELDS_length = sizeof(CalendarTest::EXPECTED_FIELDS) / - sizeof(CalendarTest::EXPECTED_FIELDS[0]); +const int32_t CalendarTest::EXPECTED_FIELDS_length = (int32_t)(sizeof(CalendarTest::EXPECTED_FIELDS) / + sizeof(CalendarTest::EXPECTED_FIELDS[0])); // ------------------------------------- diff --git a/icu4c/source/test/intltest/cppcnvt.cpp b/icu4c/source/test/intltest/cppcnvt.cpp index 224373bf4c..ba9271b704 100644 --- a/icu4c/source/test/intltest/cppcnvt.cpp +++ b/icu4c/source/test/intltest/cppcnvt.cpp @@ -460,7 +460,7 @@ void ConvertTest::TestConvert() /*Reads in the file*/ - while(!feof(ucs_file_in)&&(i+=fread(ucs_file_buffer+i, (unsigned int)sizeof(UChar), 1, ucs_file_in))) + while(!feof(ucs_file_in)&&(i+=fread(ucs_file_buffer+i, sizeof(UChar), 1, ucs_file_in))) { myUChar = ucs_file_buffer[i-1]; diff --git a/icu4c/source/test/intltest/dtfmrgts.cpp b/icu4c/source/test/intltest/dtfmrgts.cpp index 10457f95a6..d927735c8a 100644 --- a/icu4c/source/test/intltest/dtfmrgts.cpp +++ b/icu4c/source/test/intltest/dtfmrgts.cpp @@ -1039,7 +1039,7 @@ void DateFormatRegressionTest::Test4182066(void) { "09/12/+1", "09/12/001", }; - int32_t STRINGS_COUNT = sizeof(STRINGS) / sizeof(STRINGS[0]); + int32_t STRINGS_COUNT = (int32_t)(sizeof(STRINGS) / sizeof(STRINGS[0])); UDate FAIL_DATE = (UDate) 0; UDate DATES[] = { date(2000-1900, Calendar::FEBRUARY, 29), diff --git a/icu4c/source/test/intltest/dtfmttst.cpp b/icu4c/source/test/intltest/dtfmttst.cpp index 3dc714e1e9..6b20a9f77c 100644 --- a/icu4c/source/test/intltest/dtfmttst.cpp +++ b/icu4c/source/test/intltest/dtfmttst.cpp @@ -245,7 +245,7 @@ DateFormatTest::TestFieldPosition(void) { UErrorCode status = U_ZERO_ERROR; DateFormat* dateFormats[4]; - int32_t dateFormats_length = sizeof(dateFormats) / sizeof(dateFormats[0]); + int32_t dateFormats_length = (int32_t)(sizeof(dateFormats) / sizeof(dateFormats[0])); /* {sfb} This test was coded incorrectly. / FieldPosition uses the fields in the class you are formatting with @@ -599,11 +599,11 @@ DateFormatTest::TestBadInput135() int32_t looks[] = { DateFormat::SHORT, DateFormat::MEDIUM, DateFormat::LONG, DateFormat::FULL }; - int32_t looks_length = sizeof(looks) / sizeof(looks[0]); + int32_t looks_length = (int32_t)(sizeof(looks) / sizeof(looks[0])); const char* strings[] = { "Mar 15", "Mar 15 1997", "asdf", "3/1/97 1:23:", "3/1/00 1:23:45 AM" }; - int32_t strings_length = sizeof(strings) / sizeof(strings[0]); + int32_t strings_length = (int32_t)(sizeof(strings) / sizeof(strings[0])); DateFormat *full = DateFormat::createDateTimeInstance(DateFormat::LONG, DateFormat::LONG); UnicodeString expected("March 1, 2000 1:23:45 AM "); for (int32_t i = 0; i < strings_length;++i) { @@ -682,8 +682,8 @@ DateFormatTest::TestBadInput135a() SimpleDateFormat* dateParse = new SimpleDateFormat(status); const char* s; UDate date; - const uint32_t PF_LENGTH = sizeof(parseFormats)/sizeof(parseFormats[0]); - const uint32_t INPUT_LENGTH = sizeof(inputStrings)/sizeof(inputStrings[0]); + const uint32_t PF_LENGTH = (int32_t)(sizeof(parseFormats)/sizeof(parseFormats[0])); + const uint32_t INPUT_LENGTH = (int32_t)(sizeof(inputStrings)/sizeof(inputStrings[0])); dateParse->applyPattern("d MMMM, yyyy"); dateParse->adoptTimeZone(TimeZone::createDefault()); @@ -856,7 +856,7 @@ DateFormatTest::TestDateFormatZone146() UnicodeString("short format: "), UnicodeString("4/4/97 11:00 PM"), UnicodeString("M/d/yy h:mm a") }; - int32_t DATA_length = sizeof(DATA) / sizeof(DATA[0]); + int32_t DATA_length = (int32_t)(sizeof(DATA) / sizeof(DATA[0])); for (int32_t i=0; i