}
break;
default:
- U_ASSERT(false);
+ UPRV_UNREACHABLE;
}
offset += U16_LENGTH(cp);
Field AffixUtils::getFieldForType(AffixPatternType type) {
switch (type) {
case TYPE_MINUS_SIGN:
- return Field::UNUM_SIGN_FIELD;
+ return UNUM_SIGN_FIELD;
case TYPE_PLUS_SIGN:
- return Field::UNUM_SIGN_FIELD;
+ return UNUM_SIGN_FIELD;
case TYPE_PERCENT:
- return Field::UNUM_PERCENT_FIELD;
+ return UNUM_PERCENT_FIELD;
case TYPE_PERMILLE:
- return Field::UNUM_PERMILL_FIELD;
+ return UNUM_PERMILL_FIELD;
case TYPE_CURRENCY_SINGLE:
- return Field::UNUM_CURRENCY_FIELD;
+ return UNUM_CURRENCY_FIELD;
case TYPE_CURRENCY_DOUBLE:
- return Field::UNUM_CURRENCY_FIELD;
+ return UNUM_CURRENCY_FIELD;
case TYPE_CURRENCY_TRIPLE:
- return Field::UNUM_CURRENCY_FIELD;
+ return UNUM_CURRENCY_FIELD;
case TYPE_CURRENCY_QUAD:
- return Field::UNUM_CURRENCY_FIELD;
+ return UNUM_CURRENCY_FIELD;
case TYPE_CURRENCY_QUINT:
- return Field::UNUM_CURRENCY_FIELD;
+ return UNUM_CURRENCY_FIELD;
case TYPE_CURRENCY_OVERFLOW:
- return Field::UNUM_CURRENCY_FIELD;
+ return UNUM_CURRENCY_FIELD;
default:
- U_ASSERT(false);
- return Field::UNUM_FIELD_COUNT; // suppress "control reaches end of non-void function"
+ UPRV_UNREACHABLE;
}
}
int32_t
AffixUtils::unescape(const UnicodeString &affixPattern, NumberStringBuilder &output, int32_t position,
- const SymbolProvider &provider, UErrorCode &status) {
+ const SymbolProvider &provider, Field field, UErrorCode &status) {
int32_t length = 0;
AffixTag tag;
while (hasNext(tag, affixPattern)) {
length += output.insert(
position + length, provider.getSymbol(tag.type), getFieldForType(tag.type), status);
} else {
- length += output.insertCodePoint(position + length, tag.codePoint, UNUM_FIELD_COUNT, status);
+ length += output.insertCodePoint(position + length, tag.codePoint, field, status);
}
}
return length;
return makeTag(offset, TYPE_CURRENCY_OVERFLOW, STATE_BASE, 0);
}
default:
- U_ASSERT(false);
+ UPRV_UNREACHABLE;
}
}
// End of string
case STATE_OVERFLOW_CURR:
return makeTag(offset, TYPE_CURRENCY_OVERFLOW, STATE_BASE, 0);
default:
- U_ASSERT(false);
- return {-1}; // suppress "control reaches end of non-void function"
+ UPRV_UNREACHABLE;
}
}