You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-29 16:16:38 +00:00
Update HarfBuzz, ICU and FreeType
HarfBuzz: Update to version 7.3.0 ICU4C: Update to version 73.1 FreeType: Update to version 2.13.0
This commit is contained in:
80
thirdparty/icu4c/common/rbbiscan.cpp
vendored
80
thirdparty/icu4c/common/rbbiscan.cpp
vendored
@@ -46,7 +46,7 @@
|
||||
// source form of the state transition table for the RBBI rule parser.
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
static const UChar gRuleSet_rule_char_pattern[] = {
|
||||
static const char16_t gRuleSet_rule_char_pattern[] = {
|
||||
// Characters that may appear as literals in patterns without escaping or quoting.
|
||||
// [ ^ [ \ p { Z } \ u 0 0 2 0
|
||||
0x5b, 0x5e, 0x5b, 0x5c, 0x70, 0x7b, 0x5a, 0x7d, 0x5c, 0x75, 0x30, 0x30, 0x32, 0x30,
|
||||
@@ -55,19 +55,19 @@ static const UChar gRuleSet_rule_char_pattern[] = {
|
||||
// { L } ] - [ \ p { N } ] ]
|
||||
0x7b, 0x4c, 0x7d, 0x5d, 0x2d, 0x5b, 0x5c, 0x70, 0x7b, 0x4e, 0x7d, 0x5d, 0x5d, 0};
|
||||
|
||||
static const UChar gRuleSet_name_char_pattern[] = {
|
||||
static const char16_t gRuleSet_name_char_pattern[] = {
|
||||
// [ _ \ p { L } \ p { N } ]
|
||||
0x5b, 0x5f, 0x5c, 0x70, 0x7b, 0x4c, 0x7d, 0x5c, 0x70, 0x7b, 0x4e, 0x7d, 0x5d, 0};
|
||||
|
||||
static const UChar gRuleSet_digit_char_pattern[] = {
|
||||
static const char16_t gRuleSet_digit_char_pattern[] = {
|
||||
// [ 0 - 9 ]
|
||||
0x5b, 0x30, 0x2d, 0x39, 0x5d, 0};
|
||||
|
||||
static const UChar gRuleSet_name_start_char_pattern[] = {
|
||||
static const char16_t gRuleSet_name_start_char_pattern[] = {
|
||||
// [ _ \ p { L } ]
|
||||
0x5b, 0x5f, 0x5c, 0x70, 0x7b, 0x4c, 0x7d, 0x5d, 0 };
|
||||
|
||||
static const UChar kAny[] = {0x61, 0x6e, 0x79, 0x00}; // "any"
|
||||
static const char16_t kAny[] = {0x61, 0x6e, 0x79, 0x00}; // "any"
|
||||
|
||||
|
||||
U_CDECL_BEGIN
|
||||
@@ -97,18 +97,18 @@ RBBIRuleScanner::RBBIRuleScanner(RBBIRuleBuilder *rb)
|
||||
fCharNum = 0;
|
||||
fLastChar = 0;
|
||||
|
||||
fStateTable = NULL;
|
||||
fStateTable = nullptr;
|
||||
fStack[0] = 0;
|
||||
fStackPtr = 0;
|
||||
fNodeStack[0] = NULL;
|
||||
fNodeStack[0] = nullptr;
|
||||
fNodeStackPtr = 0;
|
||||
|
||||
fReverseRule = false;
|
||||
fLookAheadRule = false;
|
||||
fNoChainInRule = false;
|
||||
|
||||
fSymbolTable = NULL;
|
||||
fSetTable = NULL;
|
||||
fSymbolTable = nullptr;
|
||||
fSetTable = nullptr;
|
||||
fRuleNum = 0;
|
||||
fOptionStart = 0;
|
||||
|
||||
@@ -146,11 +146,11 @@ RBBIRuleScanner::RBBIRuleScanner(RBBIRuleBuilder *rb)
|
||||
}
|
||||
|
||||
fSymbolTable = new RBBISymbolTable(this, rb->fRules, *rb->fStatus);
|
||||
if (fSymbolTable == NULL) {
|
||||
if (fSymbolTable == nullptr) {
|
||||
*rb->fStatus = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
fSetTable = uhash_open(uhash_hashUnicodeString, uhash_compareUnicodeString, NULL, rb->fStatus);
|
||||
fSetTable = uhash_open(uhash_hashUnicodeString, uhash_compareUnicodeString, nullptr, rb->fStatus);
|
||||
if (U_FAILURE(*rb->fStatus)) {
|
||||
return;
|
||||
}
|
||||
@@ -166,9 +166,9 @@ RBBIRuleScanner::RBBIRuleScanner(RBBIRuleBuilder *rb)
|
||||
//------------------------------------------------------------------------------
|
||||
RBBIRuleScanner::~RBBIRuleScanner() {
|
||||
delete fSymbolTable;
|
||||
if (fSetTable != NULL) {
|
||||
if (fSetTable != nullptr) {
|
||||
uhash_close(fSetTable);
|
||||
fSetTable = NULL;
|
||||
fSetTable = nullptr;
|
||||
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ RBBIRuleScanner::~RBBIRuleScanner() {
|
||||
//------------------------------------------------------------------------------
|
||||
UBool RBBIRuleScanner::doParseActions(int32_t action)
|
||||
{
|
||||
RBBINode *n = NULL;
|
||||
RBBINode *n = nullptr;
|
||||
|
||||
UBool returnVal = true;
|
||||
|
||||
@@ -374,7 +374,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
||||
//
|
||||
RBBINode **destRules = (fReverseRule? &fRB->fSafeRevTree : fRB->fDefaultTree);
|
||||
|
||||
if (*destRules != NULL) {
|
||||
if (*destRules != nullptr) {
|
||||
// This is not the first rule encountered.
|
||||
// OR previous stuff (from *destRules)
|
||||
// with the current rule expression (on the Node Stack)
|
||||
@@ -583,7 +583,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
||||
|
||||
case doEndVariableName:
|
||||
n = fNodeStack[fNodeStackPtr];
|
||||
if (n==NULL || n->fType != RBBINode::varRef) {
|
||||
if (n==nullptr || n->fType != RBBINode::varRef) {
|
||||
error(U_BRK_INTERNAL_ERROR);
|
||||
break;
|
||||
}
|
||||
@@ -598,7 +598,7 @@ UBool RBBIRuleScanner::doParseActions(int32_t action)
|
||||
|
||||
case doCheckVarDef:
|
||||
n = fNodeStack[fNodeStackPtr];
|
||||
if (n->fLeftChild == NULL) {
|
||||
if (n->fLeftChild == nullptr) {
|
||||
error(U_BRK_UNDEFINED_VARIABLE);
|
||||
returnVal = false;
|
||||
}
|
||||
@@ -737,7 +737,7 @@ void RBBIRuleScanner::findSetFor(const UnicodeString &s, RBBINode *node, Unicode
|
||||
// If so, just use the cached set in the new node.
|
||||
// delete any set provided by the caller, since we own it.
|
||||
el = (RBBISetTableEl *)uhash_get(fSetTable, &s);
|
||||
if (el != NULL) {
|
||||
if (el != nullptr) {
|
||||
delete setToAdopt;
|
||||
node->fLeftChild = el->val;
|
||||
U_ASSERT(node->fLeftChild->fType == RBBINode::uset);
|
||||
@@ -747,7 +747,7 @@ void RBBIRuleScanner::findSetFor(const UnicodeString &s, RBBINode *node, Unicode
|
||||
// Haven't seen this set before.
|
||||
// If the caller didn't provide us with a prebuilt set,
|
||||
// create a new UnicodeSet now.
|
||||
if (setToAdopt == NULL) {
|
||||
if (setToAdopt == nullptr) {
|
||||
if (s.compare(kAny, -1) == 0) {
|
||||
setToAdopt = new UnicodeSet(0x000000, 0x10ffff);
|
||||
} else {
|
||||
@@ -762,7 +762,7 @@ void RBBIRuleScanner::findSetFor(const UnicodeString &s, RBBINode *node, Unicode
|
||||
// This new uset node becomes the child of the caller's setReference node.
|
||||
//
|
||||
RBBINode *usetNode = new RBBINode(RBBINode::uset);
|
||||
if (usetNode == NULL) {
|
||||
if (usetNode == nullptr) {
|
||||
error(U_MEMORY_ALLOCATION_ERROR);
|
||||
return;
|
||||
}
|
||||
@@ -783,14 +783,14 @@ void RBBIRuleScanner::findSetFor(const UnicodeString &s, RBBINode *node, Unicode
|
||||
//
|
||||
el = (RBBISetTableEl *)uprv_malloc(sizeof(RBBISetTableEl));
|
||||
UnicodeString *tkey = new UnicodeString(s);
|
||||
if (tkey == NULL || el == NULL || setToAdopt == NULL) {
|
||||
if (tkey == nullptr || el == nullptr || setToAdopt == nullptr) {
|
||||
// Delete to avoid memory leak
|
||||
delete tkey;
|
||||
tkey = NULL;
|
||||
tkey = nullptr;
|
||||
uprv_free(el);
|
||||
el = NULL;
|
||||
el = nullptr;
|
||||
delete setToAdopt;
|
||||
setToAdopt = NULL;
|
||||
setToAdopt = nullptr;
|
||||
|
||||
error(U_MEMORY_ALLOCATION_ERROR);
|
||||
return;
|
||||
@@ -809,15 +809,15 @@ void RBBIRuleScanner::findSetFor(const UnicodeString &s, RBBINode *node, Unicode
|
||||
// Numeric because there is no portable way to enter them as literals.
|
||||
// (Think EBCDIC).
|
||||
//
|
||||
static const UChar chCR = 0x0d; // New lines, for terminating comments.
|
||||
static const UChar chLF = 0x0a;
|
||||
static const UChar chNEL = 0x85; // NEL newline variant
|
||||
static const UChar chLS = 0x2028; // Unicode Line Separator
|
||||
static const UChar chApos = 0x27; // single quote, for quoted chars.
|
||||
static const UChar chPound = 0x23; // '#', introduces a comment.
|
||||
static const UChar chBackSlash = 0x5c; // '\' introduces a char escape
|
||||
static const UChar chLParen = 0x28;
|
||||
static const UChar chRParen = 0x29;
|
||||
static const char16_t chCR = 0x0d; // New lines, for terminating comments.
|
||||
static const char16_t chLF = 0x0a;
|
||||
static const char16_t chNEL = 0x85; // NEL newline variant
|
||||
static const char16_t chLS = 0x2028; // Unicode Line Separator
|
||||
static const char16_t chApos = 0x27; // single quote, for quoted chars.
|
||||
static const char16_t chPound = 0x23; // '#', introduces a comment.
|
||||
static const char16_t chBackSlash = 0x5c; // '\' introduces a char escape
|
||||
static const char16_t chLParen = 0x28;
|
||||
static const char16_t chRParen = 0x29;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -918,7 +918,7 @@ void RBBIRuleScanner::nextChar(RBBIRuleChar &c) {
|
||||
// Toggle quoting mode.
|
||||
// Return either '(' or ')', because quotes cause a grouping of the quoted text.
|
||||
fQuoteMode = !fQuoteMode;
|
||||
if (fQuoteMode == true) {
|
||||
if (fQuoteMode) {
|
||||
c.fChar = chLParen;
|
||||
} else {
|
||||
c.fChar = chRParen;
|
||||
@@ -1119,7 +1119,7 @@ void RBBIRuleScanner::parse() {
|
||||
|
||||
// If there are no forward rules set an error.
|
||||
//
|
||||
if (fRB->fForwardTree == NULL) {
|
||||
if (fRB->fForwardTree == nullptr) {
|
||||
error(U_BRK_RULE_SYNTAX);
|
||||
return;
|
||||
}
|
||||
@@ -1169,16 +1169,16 @@ void RBBIRuleScanner::printNodeStack(const char *title) {
|
||||
//------------------------------------------------------------------------------
|
||||
RBBINode *RBBIRuleScanner::pushNewNode(RBBINode::NodeType t) {
|
||||
if (U_FAILURE(*fRB->fStatus)) {
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (fNodeStackPtr >= kStackSize - 1) {
|
||||
error(U_BRK_RULE_SYNTAX);
|
||||
RBBIDebugPuts("RBBIRuleScanner::pushNewNode - stack overflow.");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
fNodeStackPtr++;
|
||||
fNodeStack[fNodeStackPtr] = new RBBINode(t);
|
||||
if (fNodeStack[fNodeStackPtr] == NULL) {
|
||||
if (fNodeStack[fNodeStackPtr] == nullptr) {
|
||||
*fRB->fStatus = U_MEMORY_ALLOCATION_ERROR;
|
||||
}
|
||||
return fNodeStack[fNodeStackPtr];
|
||||
@@ -1214,7 +1214,7 @@ void RBBIRuleScanner::scanSet() {
|
||||
startPos = fScanIndex;
|
||||
UErrorCode localStatus = U_ZERO_ERROR;
|
||||
uset = new UnicodeSet();
|
||||
if (uset == NULL) {
|
||||
if (uset == nullptr) {
|
||||
localStatus = U_MEMORY_ALLOCATION_ERROR;
|
||||
} else {
|
||||
uset->applyPatternIgnoreSpace(fRB->fRules, pos, fSymbolTable, localStatus);
|
||||
@@ -1232,7 +1232,7 @@ void RBBIRuleScanner::scanSet() {
|
||||
|
||||
// Verify that the set contains at least one code point.
|
||||
//
|
||||
U_ASSERT(uset!=NULL);
|
||||
U_ASSERT(uset!=nullptr);
|
||||
if (uset->isEmpty()) {
|
||||
// This set is empty.
|
||||
// Make it an error, because it almost certainly is not what the user wanted.
|
||||
|
||||
Reference in New Issue
Block a user