// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
-* Copyright (c) 2001-2016 International Business Machines
+* Copyright (c) 2001-2014, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
#define NO_VARIANT UnicodeString()
// initial estimate for specDAG size
+// ICU 60 Transliterator::countAvailableSources()
+//#define SPECDAG_INIT_SIZE 149
+// Apple adjustment
#define SPECDAG_INIT_SIZE 134
// initial estimate for number of variant names
#define VARIANT_LIST_MAX_SIZE 31
// initial estimate for availableIDs count (default estimate is 8 => multiple reallocs)
+// ICU 60 Transliterator::countAvailableIDs()
+//#define AVAILABLE_IDS_INIT_SIZE 641
+// Apple adjustment
#define AVAILABLE_IDS_INIT_SIZE 493
// initial estimate for number of targets for source "Any", "Lat"
+// ICU 60 Transliterator::countAvailableTargets("Any")/("Latn")
+//#define ANY_TARGETS_INIT_SIZE 125
+// Apple adjustmennt
#define ANY_TARGETS_INIT_SIZE 102
#define LAT_TARGETS_INIT_SIZE 23
}
break;
case RULES:
- U_ASSERT(FALSE); // don't call create() if isRuleBased() returns TRUE!
- break;
+ UPRV_UNREACHABLE; // don't call create() if isRuleBased() returns TRUE!
}
return t;
}
if (targets == 0) {
return 0;
}
- int32_t varMask = targets->geti(target);
+ uint32_t varMask = targets->geti(target);
int32_t varCount = 0;
while (varMask > 0) {
if (varMask & 1) {
result.truncate(0); // invalid source
return result;
}
- int32_t varMask = targets->geti(target);
+ uint32_t varMask = targets->geti(target);
int32_t varCount = 0;
int32_t varListIndex = 0;
while (varMask > 0) {
return;
}
}
- int32_t addMask = 1 << variantListIndex;
- int32_t varMask = targets->geti(target);
+ uint32_t addMask = 1 << variantListIndex;
+ uint32_t varMask = targets->geti(target);
targets->puti(target, varMask | addMask, status);
}
if (targets == NULL) {
return; // should never happen for valid s-t/v
}
- int32_t varMask = targets->geti(target);
+ uint32_t varMask = targets->geti(target);
if (varMask == 0) {
return; // should never happen for valid s-t/v
}
} else {
targets->remove(target); // should delete variants
if (targets->count() == 0) {
- specDAG.remove(source); // should delete targetss
+ specDAG.remove(source); // should delete targets
}
}
}
int32_t passNumber = 1;
for (int32_t i = 0; U_SUCCESS(status) && i < entry->u.dataVector->size(); i++) {
// TODO: Should passNumber be turned into a decimal-string representation (1 -> "1")?
- Transliterator* t = new RuleBasedTransliterator(UnicodeString(CompoundTransliterator::PASS_STRING) + UnicodeString(passNumber++),
+ Transliterator* tl = new RuleBasedTransliterator(UnicodeString(CompoundTransliterator::PASS_STRING) + UnicodeString(passNumber++),
(TransliterationRuleData*)(entry->u.dataVector->elementAt(i)), FALSE);
- if (t == 0)
+ if (tl == 0)
status = U_MEMORY_ALLOCATION_ERROR;
else
- rbts->addElement(t, status);
+ rbts->addElement(tl, status);
}
if (U_FAILURE(status)) {
delete rbts;
}
return 0;
default:
- U_ASSERT(FALSE); // can't get here
- return 0;
+ UPRV_UNREACHABLE; // can't get here
}
}
U_NAMESPACE_END