ICU-7 help the OS/400 C++ compiler detect control path coverage in switch() {}

X-SVN-Rev: 100
This commit is contained in:
Markus Scherer 1999-10-22 00:43:39 +00:00
parent 0f43a91f08
commit c67973faff
3 changed files with 12 additions and 33 deletions

View File

@ -180,20 +180,17 @@ ucal_getAttribute( const UCalendar* cal,
switch(attr) {
case UCAL_LENIENT:
return ((Calendar*)cal)->isLenient();
break;
case UCAL_FIRST_DAY_OF_WEEK:
return ((Calendar*)cal)->getFirstDayOfWeek();
break;
case UCAL_MINIMAL_DAYS_IN_FIRST_WEEK:
return ((Calendar*)cal)->getMinimalDaysInFirstWeek();
break;
default:
return -1;
break;
}
return -1;
}
U_CAPI void
@ -349,37 +346,33 @@ ucal_getLimit( const UCalendar* cal,
UCalendarLimitType type,
UErrorCode *status)
{
if(U_FAILURE(*status)) return -1;
if(status==0 || U_FAILURE(*status)) {
return -1;
}
switch(type) {
case UCAL_MINIMUM:
return ((Calendar*)cal)->getMinimum((Calendar::EDateFields)field);
break;
case UCAL_MAXIMUM:
return ((Calendar*)cal)->getMaximum((Calendar::EDateFields)field);
break;
case UCAL_GREATEST_MINIMUM:
return ((Calendar*)cal)->getGreatestMinimum((Calendar::EDateFields)field);
break;
case UCAL_LEAST_MAXIMUM:
return ((Calendar*)cal)->getLeastMaximum((Calendar::EDateFields)field);
break;
case UCAL_ACTUAL_MINIMUM:
return ((Calendar*)cal)->getActualMinimum((Calendar::EDateFields)field,
*status);
break;
case UCAL_ACTUAL_MAXIMUM:
return ((Calendar*)cal)->getActualMaximum((Calendar::EDateFields)field,
*status);
break;
default:
return -1;
break;
}
return -1;
}

View File

@ -215,7 +215,11 @@ ucol_getNormalization(const UCollator* coll)
case Normalizer::DECOMP_COMPAT:
return UCOL_DECOMP_COMPAT;
default:
break;
}
return UCOL_NO_NORMALIZATION;
}
U_CAPI void

View File

@ -276,67 +276,53 @@ unum_getAttribute(const UNumberFormat* fmt,
switch(attr) {
case UNUM_PARSE_INT_ONLY:
return ((NumberFormat*)fmt)->isParseIntegerOnly();
break;
case UNUM_GROUPING_USED:
return ((NumberFormat*)fmt)->isGroupingUsed();
break;
case UNUM_DECIMAL_ALWAYS_SHOWN:
return ((DecimalFormat*)fmt)->isDecimalSeparatorAlwaysShown();
break;
case UNUM_MAX_INTEGER_DIGITS:
return ((NumberFormat*)fmt)->getMaximumIntegerDigits();
break;
case UNUM_MIN_INTEGER_DIGITS:
return ((NumberFormat*)fmt)->getMinimumIntegerDigits();
break;
case UNUM_INTEGER_DIGITS:
// TBD: what should this return?
return ((NumberFormat*)fmt)->getMinimumIntegerDigits();
break;
case UNUM_MAX_FRACTION_DIGITS:
return ((NumberFormat*)fmt)->getMaximumFractionDigits();
break;
case UNUM_MIN_FRACTION_DIGITS:
return ((NumberFormat*)fmt)->getMinimumFractionDigits();
break;
case UNUM_FRACTION_DIGITS:
// TBD: what should this return?
return ((NumberFormat*)fmt)->getMinimumFractionDigits();
break;
case UNUM_MULTIPLIER:
return ((DecimalFormat*)fmt)->getMultiplier();
break;
case UNUM_GROUPING_SIZE:
return ((DecimalFormat*)fmt)->getGroupingSize();
break;
case UNUM_ROUNDING_MODE:
return ((DecimalFormat*)fmt)->getRoundingMode();
break;
case UNUM_FORMAT_WIDTH:
return ((DecimalFormat*)fmt)->getFormatWidth();
break;
/** The position at which padding will take place. */
case UNUM_PADDING_POSITION:
return ((DecimalFormat*)fmt)->getPadPosition();
break;
default:
return -1;
break;
}
return -1;
}
U_CAPI void
@ -411,14 +397,10 @@ U_CAPI double
unum_getDoubleAttribute(const UNumberFormat* fmt,
UNumberFormatAttribute attr)
{
switch(attr) {
case UNUM_ROUNDING_INCREMENT:
if(attr==UNUM_ROUNDING_INCREMENT) {
return ((DecimalFormat*)fmt)->getRoundingIncrement();
break;
default:
} else {
return -1.0;
break;
}
}