ICU-329 Clear the parseErr struct consistently by setting the offsets and line with -1

X-SVN-Rev: 6922
This commit is contained in:
Ram Viswanadha 2001-11-15 21:13:37 +00:00
parent ed179d925f
commit 189e70e306
6 changed files with 7 additions and 7 deletions

View File

@ -233,7 +233,7 @@ ChoiceFormat::applyPattern(const UnicodeString& pattern,
}
// Clear error struct
parseError.offset = 0;
parseError.offset = -1;
parseError.preContext[0] = parseError.postContext[0] = (UChar)0;
// Perform 2 passes. The first computes the number of limits in

View File

@ -2290,7 +2290,7 @@ DecimalFormat::applyPattern(const UnicodeString& pattern,
return;
}
// Clear error struct
parseError.offset = 0;
parseError.offset = -1;
parseError.preContext[0] = parseError.postContext[0] = (UChar)0;
// Set the significant pattern symbols

View File

@ -403,7 +403,7 @@ MessageFormat::applyPattern(const UnicodeString& newPattern,
int32_t i = 0;
fMaxOffset = -1;
// Clear error struct
parseError.offset = 0;
parseError.offset = -1;
parseError.preContext[0] = parseError.postContext[0] = (UChar)0;
int32_t patLen = newPattern.length();
for (; i < patLen; ++i) {

View File

@ -743,7 +743,7 @@ TransliterationRuleData* TransliteratorParser::orphanData() {
void TransliteratorParser::parseRules(const UnicodeString& rules,
UTransDirection theDirection) {
// Clear error struct
parseError.line = parseError.offset = 0;
parseError.line = parseError.offset = -1;
parseError.preContext[0] = parseError.postContext[0] = (UChar)0;
status = U_ZERO_ERROR;

View File

@ -154,8 +154,7 @@ static void maskingError(const U_NAMESPACE_QUALIFIER TransliterationRule& rule1,
U_NAMESPACE_QUALIFIER UnicodeString r;
int32_t len;
parseError.line = 0;
parseError.offset = 0;
parseError.line = parseError.offset = -1;
// for pre-context
rule1.toRule(r, FALSE);

View File

@ -1174,7 +1174,8 @@ Transliterator* Transliterator::parseID(const UnicodeString& ID,
if (registry == 0) {
initializeRegistry();
}
parseError.line = parseError.offset = 0;
/* clear the error struct */
parseError.line = parseError.offset = -1;
parseError.preContext[0] = parseError.postContext[0] = 0;
TransliteratorAlias* alias = 0;
{