From ef1328e9b6c5e394237e151ce0a128da489497b6 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Sat, 30 Sep 2000 01:40:03 +0000 Subject: [PATCH] ICU-535 Fixed some compiler warnings X-SVN-Rev: 2541 --- icu4c/source/i18n/simpletz.cpp | 123 ++++++++++++++------------- icu4c/source/i18n/unicode/simpletz.h | 93 ++++++++++---------- 2 files changed, 113 insertions(+), 103 deletions(-) diff --git a/icu4c/source/i18n/simpletz.cpp b/icu4c/source/i18n/simpletz.cpp index 6da34571b14..e8f3635ab23 100644 --- a/icu4c/source/i18n/simpletz.cpp +++ b/icu4c/source/i18n/simpletz.cpp @@ -14,8 +14,8 @@ * testing. * 07/29/97 aliu Ported source bodies back from Java version with * numerous feature enhancements and bug fixes. -* 08/10/98 stephen JDK 1.2 sync. -* 09/17/98 stephen Fixed getOffset() for last hour of year and DST +* 08/10/98 stephen JDK 1.2 sync. +* 09/17/98 stephen Fixed getOffset() for last hour of year and DST * 12/02/99 aliu Added TimeMode and constructor and setStart/EndRule * methods that take TimeMode. Whitespace cleanup. ******************************************************************************** @@ -38,7 +38,7 @@ const int8_t SimpleTimeZone::staticMonthLength[] = {31,28,31,30,31,30,31,31,30,3 // ***************************************************************************** -SimpleTimeZone::SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID) +SimpleTimeZone::SimpleTimeZone(int32_t rawOffsetGMT, const UnicodeString& ID) : startMonth(0), startDay(0), startDayOfWeek(0), @@ -50,7 +50,7 @@ SimpleTimeZone::SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID) endDayOfWeek(0), endTime(0), startYear(0), - rawOffset(rawOffset), + rawOffset(rawOffsetGMT), useDaylight(FALSE), startMode(DOM_MODE), endMode(DOM_MODE), @@ -61,50 +61,52 @@ SimpleTimeZone::SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID) // ------------------------------------- -SimpleTimeZone::SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID, - int8_t startMonth, int8_t startDay, - int8_t startDayOfWeek, int32_t startTime, - int8_t endMonth, int8_t endDay, - int8_t endDayOfWeek, int32_t endTime, +SimpleTimeZone::SimpleTimeZone(int32_t rawOffsetGMT, const UnicodeString& ID, + int8_t savingsStartMonth, int8_t savingsStartDay, + int8_t savingsStartDayOfWeek, int32_t savingsStartTime, + int8_t savingsEndMonth, int8_t savingsEndDay, + int8_t savingsEndDayOfWeek, int32_t savingsEndTime, UErrorCode& status) { - construct(rawOffset, ID, - startMonth, startDay, startDayOfWeek, - startTime, WALL_TIME, - endMonth, endDay, endDayOfWeek, - endTime, WALL_TIME, + construct(rawOffsetGMT, ID, + savingsStartMonth, savingsStartDay, savingsStartDayOfWeek, + savingsStartTime, WALL_TIME, + savingsEndMonth, savingsEndDay, savingsEndDayOfWeek, + savingsEndTime, WALL_TIME, U_MILLIS_PER_HOUR, status); } // ------------------------------------- -SimpleTimeZone::SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID, - int8_t startMonth, int8_t startDay, - int8_t startDayOfWeek, int32_t startTime, - int8_t endMonth, int8_t endDay, - int8_t endDayOfWeek, int32_t endTime, - int32_t dstSavings, UErrorCode& status) { - construct(rawOffset, ID, - startMonth, startDay, startDayOfWeek, - startTime, WALL_TIME, - endMonth, endDay, endDayOfWeek, - endTime, WALL_TIME, - dstSavings, status); +SimpleTimeZone::SimpleTimeZone(int32_t rawOffsetGMT, const UnicodeString& ID, + int8_t savingsStartMonth, int8_t savingsStartDay, + int8_t savingsStartDayOfWeek, int32_t savingsStartTime, + int8_t savingsEndMonth, int8_t savingsEndDay, + int8_t savingsEndDayOfWeek, int32_t savingsEndTime, + int32_t savingsDST, UErrorCode& status) { + construct(rawOffsetGMT, ID, + savingsStartMonth, savingsStartDay, savingsStartDayOfWeek, + savingsStartTime, WALL_TIME, + savingsEndMonth, savingsEndDay, savingsEndDayOfWeek, + savingsEndTime, WALL_TIME, + savingsDST, status); } // ------------------------------------- -SimpleTimeZone::SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID, - int8_t startMonth, int8_t startDay, - int8_t startDayOfWeek, int32_t startTime, TimeMode startTimeMode, - int8_t endMonth, int8_t endDay, - int8_t endDayOfWeek, int32_t endTime, TimeMode endTimeMode, - int32_t dstSavings, UErrorCode& status) { - construct(rawOffset, ID, - startMonth, startDay, startDayOfWeek, - startTime, startTimeMode, - endMonth, endDay, endDayOfWeek, - endTime, endTimeMode, - dstSavings, status); +SimpleTimeZone::SimpleTimeZone(int32_t rawOffsetGMT, const UnicodeString& ID, + int8_t savingsStartMonth, int8_t savingsStartDay, + int8_t savingsStartDayOfWeek, int32_t savingsStartTime, + TimeMode savingsStartTimeMode, + int8_t savingsEndMonth, int8_t savingsEndDay, + int8_t savingsEndDayOfWeek, int32_t savingsEndTime, + TimeMode savingsEndTimeMode, + int32_t savingsDST, UErrorCode& status) { + construct(rawOffsetGMT, ID, + savingsStartMonth, savingsStartDay, savingsStartDayOfWeek, + savingsStartTime, savingsStartTimeMode, + savingsEndMonth, savingsEndDay, savingsEndDayOfWeek, + savingsEndTime, savingsEndTimeMode, + savingsDST, status); } /** @@ -140,24 +142,31 @@ SimpleTimeZone::SimpleTimeZone(const DSTZone& dstZone, /** * Internal construction method. */ -void SimpleTimeZone::construct(int32_t rawOffset, const UnicodeString& ID, - int8_t startMonth, int8_t startDay, int8_t startDayOfWeek, - int32_t startTime, TimeMode startTimeMode, - int8_t endMonth, int8_t endDay, int8_t endDayOfWeek, - int32_t endTime, TimeMode endTimeMode, - int32_t dstSavings, UErrorCode& status) { - this->rawOffset = rawOffset; - this->startMonth = startMonth; - this->startDay = startDay; - this->startDayOfWeek = startDayOfWeek; - this->startTime = startTime; - this->startTimeMode = startTimeMode; - this->endMonth = endMonth; - this->endDay = endDay; - this->endDayOfWeek = endDayOfWeek; - this->endTime = endTime; - this->endTimeMode = endTimeMode; - this->dstSavings = dstSavings; +void SimpleTimeZone::construct(int32_t rawOffsetGMT, const UnicodeString& ID, + int8_t savingsStartMonth, + int8_t savingsStartDay, + int8_t savingsStartDayOfWeek, + int32_t savingsStartTime, + TimeMode savingsStartTimeMode, + int8_t savingsEndMonth, + int8_t savingsEndDay, + int8_t savingsEndDayOfWeek, + int32_t savingsEndTime, + TimeMode savingsEndTimeMode, + int32_t savingsDST, + UErrorCode& status) { + this->rawOffset = rawOffsetGMT; + this->startMonth = savingsStartMonth; + this->startDay = savingsStartDay; + this->startDayOfWeek = savingsStartDayOfWeek; + this->startTime = savingsStartTime; + this->startTimeMode = savingsStartTimeMode; + this->endMonth = savingsEndMonth; + this->endDay = savingsEndDay; + this->endDayOfWeek = savingsEndDayOfWeek; + this->endTime = savingsEndTime; + this->endTimeMode = savingsEndTimeMode; + this->dstSavings = savingsDST; setID(ID); this->startYear = 0; @@ -166,7 +175,7 @@ void SimpleTimeZone::construct(int32_t rawOffset, const UnicodeString& ID, decodeRules(status); - if (dstSavings <= 0) { + if (savingsDST <= 0) { status = U_ILLEGAL_ARGUMENT_ERROR; } } diff --git a/icu4c/source/i18n/unicode/simpletz.h b/icu4c/source/i18n/unicode/simpletz.h index c4be9e93171..035d6e80bb4 100644 --- a/icu4c/source/i18n/unicode/simpletz.h +++ b/icu4c/source/i18n/unicode/simpletz.h @@ -99,12 +99,12 @@ public: * TimeZone::createInstance() to create a TimeZone instead of creating a * SimpleTimeZone directly with this constructor. * - * @param rawOffset The given base time zone offset to GMT. + * @param rawOffsetGMT The given base time zone offset to GMT. * @param ID The timezone ID which is obtained from * TimeZone.getAvailableIDs. * @stable */ - SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID); + SimpleTimeZone(int32_t rawOffsetGMT, const UnicodeString& ID); /** * Construct a SimpleTimeZone with the given raw GMT offset, time zone ID, @@ -119,54 +119,55 @@ public: * complete explanation of how these parameters work, see the documentation for * setStartRule(). * - * @param rawOffset The new SimpleTimeZone's raw GMT offset - * @param ID The new SimpleTimeZone's time zone ID. - * @param startMonth The daylight savings starting month. Month is - * 0-based. eg, 0 for January. - * @param startDay The daylight savings starting - * day-of-week-in-month. See setStartRule() for a - * complete explanation. - * @param startDayOfWeek The daylight savings starting day-of-week. See setStartRule() - * for a complete explanation. - * @param startTime The daylight savings starting time, expressed as the - * number of milliseconds after midnight. - * @param startTimeMode Whether the start time is local wall time, local - * standard time, or UTC time. Default is local wall time. - * @param endMonth The daylight savings ending month. Month is - * 0-based. eg, 0 for January. - * @param endDay The daylight savings ending day-of-week-in-month. - * See setStartRule() for a complete explanation. - * @param endDayOfWeek The daylight savings ending day-of-week. See setStartRule() - * for a complete explanation. - * @param endTime The daylight savings ending time, expressed as the - * number of milliseconds after midnight. - * @param endTimeMode Whether the end time is local wall time, local - * standard time, or UTC time. Default is local wall time. - * @param dstSavings The number of milliseconds added to standard time - * to get DST time. Default is one hour. - * @param status An UErrorCode to receive the status. + * @param rawOffsetGMT The new SimpleTimeZone's raw GMT offset + * @param ID The new SimpleTimeZone's time zone ID. + * @param savingsStartMonth The daylight savings starting month. Month is + * 0-based. eg, 0 for January. + * @param savingsStartDay The daylight savings starting + * day-of-week-in-month. See setStartRule() for a + * complete explanation. + * @param savingsStartDayOfWeek The daylight savings starting day-of-week. + * See setStartRule() for a complete explanation. + * @param savingsStartTime The daylight savings starting time, expressed as the + * number of milliseconds after midnight. + * @param savingsStartTimeMode Whether the start time is local wall time, local + * standard time, or UTC time. Default is local wall time. + * @param savingsEndMonth The daylight savings ending month. Month is + * 0-based. eg, 0 for January. + * @param savingsEndDay The daylight savings ending day-of-week-in-month. + * See setStartRule() for a complete explanation. + * @param savingsEndDayOfWeek The daylight savings ending day-of-week. + * See setStartRule() for a complete explanation. + * @param savingsEndTime The daylight savings ending time, expressed as the + * number of milliseconds after midnight. + * @param savingsEndTimeMode Whether the end time is local wall time, local + * standard time, or UTC time. Default is local wall time. + * @param savingsDST The number of milliseconds added to standard time + * to get DST time. Default is one hour. + * @param status An UErrorCode to receive the status. * @stable */ - SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID, - int8_t startMonth, int8_t startDayOfWeekInMonth, - int8_t startDayOfWeek, int32_t startTime, - int8_t endMonth, int8_t endDayOfWeekInMonth, - int8_t endDayOfWeek, int32_t endTime, + SimpleTimeZone(int32_t rawOffsetGMT, const UnicodeString& ID, + int8_t savingsStartMonth, int8_t savingsStartDayOfWeekInMonth, + int8_t savingsStartDayOfWeek, int32_t savingsStartTime, + int8_t savingsEndMonth, int8_t savingsEndDayOfWeekInMonth, + int8_t savingsEndDayOfWeek, int32_t savingsEndTime, UErrorCode& status); - SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID, - int8_t startMonth, int8_t startDayOfWeekInMonth, - int8_t startDayOfWeek, int32_t startTime, - int8_t endMonth, int8_t endDayOfWeekInMonth, - int8_t endDayOfWeek, int32_t endTime, - int32_t dstSavings, UErrorCode& status); + SimpleTimeZone(int32_t rawOffsetGMT, const UnicodeString& ID, + int8_t savingsStartMonth, int8_t savingsStartDayOfWeekInMonth, + int8_t savingsStartDayOfWeek, int32_t savingsStartTime, + int8_t savingsEndMonth, int8_t savingsEndDayOfWeekInMonth, + int8_t savingsEndDayOfWeek, int32_t savingsEndTime, + int32_t savingsDST, UErrorCode& status); - SimpleTimeZone(int32_t rawOffset, const UnicodeString& ID, - int8_t startMonth, int8_t startDayOfWeekInMonth, - int8_t startDayOfWeek, int32_t startTime, TimeMode startTimeMode, - int8_t endMonth, int8_t endDayOfWeekInMonth, - int8_t endDayOfWeek, int32_t endTime, TimeMode endTimeMode, - int32_t dstSavings, UErrorCode& status); + SimpleTimeZone(int32_t rawOffsetGMT, const UnicodeString& ID, + int8_t savingsStartMonth, int8_t savingsStartDayOfWeekInMonth, + int8_t savingsStartDayOfWeek, int32_t savingsStartTime, + TimeMode savingsStartTimeMode, + int8_t savingsEndMonth, int8_t savingsEndDayOfWeekInMonth, + int8_t savingsEndDayOfWeek, int32_t savingsEndTime, TimeMode savingsEndTimeMode, + int32_t savingsDST, UErrorCode& status); /** * Sets the daylight savings starting year, that is, the year this time zone began @@ -516,7 +517,7 @@ private: /** * Internal construction method. */ - void construct(int32_t rawOffset, const UnicodeString& ID, + void construct(int32_t rawOffsetGMT, const UnicodeString& ID, int8_t startMonth, int8_t startDay, int8_t startDayOfWeek, int32_t startTime, TimeMode startTimeMode, int8_t endMonth, int8_t endDay, int8_t endDayOfWeek,