ICU-5454 Fix some compiler warnings

X-SVN-Rev: 21912
This commit is contained in:
Yoshito Umaoka 2007-07-05 17:17:59 +00:00
parent 78ea0a4f4c
commit e0e1ccd5a4
5 changed files with 34 additions and 27 deletions

View file

@ -356,8 +356,8 @@ RuleBasedTimeZone::getOffset(uint8_t era, int32_t year, int32_t month, int32_t d
int32_t
RuleBasedTimeZone::getOffset(uint8_t era, int32_t year, int32_t month, int32_t day,
uint8_t dayOfWeek, int32_t millis,
int32_t monthLength, UErrorCode& status) const {
uint8_t /*dayOfWeek*/, int32_t millis,
int32_t /*monthLength*/, UErrorCode& status) const {
// dayOfWeek and monthLength are unused
if (U_FAILURE(status)) {
return 0;
@ -427,7 +427,7 @@ RuleBasedTimeZone::getOffset(UDate date, UBool local, int32_t& rawOffset,
}
void
RuleBasedTimeZone::setRawOffset(int32_t offsetMillis) {
RuleBasedTimeZone::setRawOffset(int32_t /*offsetMillis*/) {
// We don't support this operation at this moment.
// Nothing to do!
}
@ -536,7 +536,7 @@ RuleBasedTimeZone::getPreviousTransition(UDate base, UBool inclusive, TimeZoneTr
}
int32_t
RuleBasedTimeZone::countTransitionRules(UErrorCode& status) /*const*/ {
RuleBasedTimeZone::countTransitionRules(UErrorCode& /*status*/) /*const*/ {
int32_t count = 0;
if (fHistoricRules != NULL) {
count += fHistoricRules->size();
@ -700,7 +700,10 @@ RuleBasedTimeZone::findNext(UDate base, UBool inclusive, UDate& transitionTime,
UBool avail0 = r0->getNextStart(base, r1->getRawOffset(), r1->getDSTSavings(), inclusive, start0);
UBool avail1 = r1->getNextStart(base, r0->getRawOffset(), r0->getDSTSavings(), inclusive, start1);
// avail0/avail1 should be always TRUE
if (start0 < start1) {
if (!avail0 && !avail1) {
return FALSE;
}
if (!avail1 || start0 < start1) {
result.time = start0;
result.from = r1;
result.to = r0;
@ -776,7 +779,10 @@ RuleBasedTimeZone::findPrev(UDate base, UBool inclusive, UDate& transitionTime,
UBool avail0 = r0->getPreviousStart(base, r1->getRawOffset(), r1->getDSTSavings(), inclusive, start0);
UBool avail1 = r1->getPreviousStart(base, r0->getRawOffset(), r0->getDSTSavings(), inclusive, start1);
// avail0/avail1 should be always TRUE
if (start0 > start1) {
if (!avail0 && !avail1) {
return FALSE;
}
if (!avail1 || start0 > start1) {
result.time = start0;
result.from = r1;
result.to = r0;

View file

@ -1075,7 +1075,7 @@ SimpleTimeZone::initTransitionRules(UErrorCode& status) {
// Create a TimeZoneRule for initial time
if (firstStdStart < firstDstStart) {
initialRule = new InitialTimeZoneRule(tzid+"(DST)", getRawOffset(), dstRule->getDSTSavings());
initialRule = new InitialTimeZoneRule(tzid+"(DST)", getRawOffset(), dstRule->getDSTSavings());
firstTransition = new TimeZoneTransition(firstStdStart, initialRule->clone(), stdRule->clone());
} else {
initialRule = new InitialTimeZoneRule(tzid+"(STD)", getRawOffset(), 0);
@ -1090,7 +1090,7 @@ SimpleTimeZone::initTransitionRules(UErrorCode& status) {
}
int32_t
SimpleTimeZone::countTransitionRules(UErrorCode& status) /*const*/ {
SimpleTimeZone::countTransitionRules(UErrorCode& /*status*/) /*const*/ {
return (startMonth == 0) ? 0 : 2;
}

View file

@ -130,34 +130,34 @@ InitialTimeZoneRule::isEquivalentTo(const TimeZoneRule& other) const {
}
UBool
InitialTimeZoneRule::getFirstStart(int32_t prevRawOffset,
int32_t prevDSTSavings,
UDate& result) const {
InitialTimeZoneRule::getFirstStart(int32_t /*prevRawOffset*/,
int32_t /*prevDSTSavings*/,
UDate& /*result*/) const {
return FALSE;
}
UBool
InitialTimeZoneRule::getFinalStart(int32_t prevRawOffset,
int32_t prevDSTSavings,
UDate& result) const {
InitialTimeZoneRule::getFinalStart(int32_t /*prevRawOffset*/,
int32_t /*prevDSTSavings*/,
UDate& /*result*/) const {
return FALSE;
}
UBool
InitialTimeZoneRule::getNextStart(const UDate base,
int32_t prevRawOffset,
int32_t prevDSTSavings,
UBool inclusive,
UDate& result) const {
InitialTimeZoneRule::getNextStart(const UDate /*base*/,
int32_t /*prevRawOffset*/,
int32_t /*prevDSTSavings*/,
UBool /*inclusive*/,
UDate& /*result*/) const {
return FALSE;
}
UBool
InitialTimeZoneRule::getPreviousStart(const UDate base,
int32_t prevRawOffset,
int32_t prevDSTSavings,
UBool inclusive,
UDate& result) const {
InitialTimeZoneRule::getPreviousStart(const UDate /*base*/,
int32_t /*prevRawOffset*/,
int32_t /*prevDSTSavings*/,
UBool /*inclusive*/,
UDate& /*result*/) const {
return FALSE;
}

View file

@ -713,7 +713,7 @@ unsupportedRRule:
* Create a TimeZoneRule by the RDATE definition
*/
static TimeZoneRule* createRuleByRDATE(const UnicodeString& tzname, int32_t rawOffset, int32_t dstSavings,
UDate start, UVector* dates, int32_t fromOffset, UErrorCode& status) {
UDate /*start*/, UVector* dates, int32_t fromOffset, UErrorCode& status) {
if (U_FAILURE(status)) {
return NULL;
}

View file

@ -66,12 +66,13 @@ private:
const char TestZIDEnumeration::fgClassID = 0;
TestZIDEnumeration::TestZIDEnumeration(UBool all)
: tzenum(NULL), idx(0) {
: idx(0) {
UErrorCode status = U_ZERO_ERROR;
if (all) {
tzenum = TimeZone::createEnumeration();
len = tzenum->count(status);
} else {
tzenum = NULL;
len = (int32_t)sizeof(TESTZIDS)/sizeof(TESTZIDS[0]);
}
}
@ -760,7 +761,7 @@ TimeZoneRuleTest::TestVTimeZoneHeaderProps(void) {
// Roundtrip conversion
UnicodeString vtzdata;
vtz->write(vtzdata, status);
VTimeZone *newvtz1;
VTimeZone *newvtz1 = NULL;
if (U_FAILURE(status)) {
errln("FAIL: error returned while writing VTIMEZONE data 1");
} else {