mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +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:
parent
d5c1b9f883
commit
b64df2bf74
810 changed files with 32198 additions and 11081 deletions
170
thirdparty/icu4c/common/messagepattern.cpp
vendored
170
thirdparty/icu4c/common/messagepattern.cpp
vendored
|
@ -32,56 +32,56 @@ U_NAMESPACE_BEGIN
|
|||
|
||||
// Unicode character/code point constants ---------------------------------- ***
|
||||
|
||||
static const UChar u_pound=0x23;
|
||||
static const UChar u_apos=0x27;
|
||||
static const UChar u_plus=0x2B;
|
||||
static const UChar u_comma=0x2C;
|
||||
static const UChar u_minus=0x2D;
|
||||
static const UChar u_dot=0x2E;
|
||||
static const UChar u_colon=0x3A;
|
||||
static const UChar u_lessThan=0x3C;
|
||||
static const UChar u_equal=0x3D;
|
||||
static const UChar u_A=0x41;
|
||||
static const UChar u_C=0x43;
|
||||
static const UChar u_D=0x44;
|
||||
static const UChar u_E=0x45;
|
||||
static const UChar u_H=0x48;
|
||||
static const UChar u_I=0x49;
|
||||
static const UChar u_L=0x4C;
|
||||
static const UChar u_N=0x4E;
|
||||
static const UChar u_O=0x4F;
|
||||
static const UChar u_P=0x50;
|
||||
static const UChar u_R=0x52;
|
||||
static const UChar u_S=0x53;
|
||||
static const UChar u_T=0x54;
|
||||
static const UChar u_U=0x55;
|
||||
static const UChar u_Z=0x5A;
|
||||
static const UChar u_a=0x61;
|
||||
static const UChar u_c=0x63;
|
||||
static const UChar u_d=0x64;
|
||||
static const UChar u_e=0x65;
|
||||
static const UChar u_f=0x66;
|
||||
static const UChar u_h=0x68;
|
||||
static const UChar u_i=0x69;
|
||||
static const UChar u_l=0x6C;
|
||||
static const UChar u_n=0x6E;
|
||||
static const UChar u_o=0x6F;
|
||||
static const UChar u_p=0x70;
|
||||
static const UChar u_r=0x72;
|
||||
static const UChar u_s=0x73;
|
||||
static const UChar u_t=0x74;
|
||||
static const UChar u_u=0x75;
|
||||
static const UChar u_z=0x7A;
|
||||
static const UChar u_leftCurlyBrace=0x7B;
|
||||
static const UChar u_pipe=0x7C;
|
||||
static const UChar u_rightCurlyBrace=0x7D;
|
||||
static const UChar u_lessOrEqual=0x2264; // U+2264 is <=
|
||||
static const char16_t u_pound=0x23;
|
||||
static const char16_t u_apos=0x27;
|
||||
static const char16_t u_plus=0x2B;
|
||||
static const char16_t u_comma=0x2C;
|
||||
static const char16_t u_minus=0x2D;
|
||||
static const char16_t u_dot=0x2E;
|
||||
static const char16_t u_colon=0x3A;
|
||||
static const char16_t u_lessThan=0x3C;
|
||||
static const char16_t u_equal=0x3D;
|
||||
static const char16_t u_A=0x41;
|
||||
static const char16_t u_C=0x43;
|
||||
static const char16_t u_D=0x44;
|
||||
static const char16_t u_E=0x45;
|
||||
static const char16_t u_H=0x48;
|
||||
static const char16_t u_I=0x49;
|
||||
static const char16_t u_L=0x4C;
|
||||
static const char16_t u_N=0x4E;
|
||||
static const char16_t u_O=0x4F;
|
||||
static const char16_t u_P=0x50;
|
||||
static const char16_t u_R=0x52;
|
||||
static const char16_t u_S=0x53;
|
||||
static const char16_t u_T=0x54;
|
||||
static const char16_t u_U=0x55;
|
||||
static const char16_t u_Z=0x5A;
|
||||
static const char16_t u_a=0x61;
|
||||
static const char16_t u_c=0x63;
|
||||
static const char16_t u_d=0x64;
|
||||
static const char16_t u_e=0x65;
|
||||
static const char16_t u_f=0x66;
|
||||
static const char16_t u_h=0x68;
|
||||
static const char16_t u_i=0x69;
|
||||
static const char16_t u_l=0x6C;
|
||||
static const char16_t u_n=0x6E;
|
||||
static const char16_t u_o=0x6F;
|
||||
static const char16_t u_p=0x70;
|
||||
static const char16_t u_r=0x72;
|
||||
static const char16_t u_s=0x73;
|
||||
static const char16_t u_t=0x74;
|
||||
static const char16_t u_u=0x75;
|
||||
static const char16_t u_z=0x7A;
|
||||
static const char16_t u_leftCurlyBrace=0x7B;
|
||||
static const char16_t u_pipe=0x7C;
|
||||
static const char16_t u_rightCurlyBrace=0x7D;
|
||||
static const char16_t u_lessOrEqual=0x2264; // U+2264 is <=
|
||||
|
||||
static const UChar kOffsetColon[]={ // "offset:"
|
||||
static const char16_t kOffsetColon[]={ // "offset:"
|
||||
u_o, u_f, u_f, u_s, u_e, u_t, u_colon
|
||||
};
|
||||
|
||||
static const UChar kOther[]={ // "other"
|
||||
static const char16_t kOther[]={ // "other"
|
||||
u_o, u_t, u_h, u_e, u_r
|
||||
};
|
||||
|
||||
|
@ -112,7 +112,7 @@ MessagePatternList<T, stackCapacity>::copyFrom(
|
|||
int32_t length,
|
||||
UErrorCode &errorCode) {
|
||||
if(U_SUCCESS(errorCode) && length>0) {
|
||||
if(length>a.getCapacity() && NULL==a.resize(length)) {
|
||||
if(length>a.getCapacity() && nullptr==a.resize(length)) {
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ MessagePatternList<T, stackCapacity>::ensureCapacityForOneMore(int32_t oldLength
|
|||
if(U_FAILURE(errorCode)) {
|
||||
return false;
|
||||
}
|
||||
if(a.getCapacity()>oldLength || a.resize(2*oldLength, oldLength)!=NULL) {
|
||||
if(a.getCapacity()>oldLength || a.resize(2*oldLength, oldLength)!=nullptr) {
|
||||
return true;
|
||||
}
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
|
@ -145,24 +145,24 @@ class MessagePatternPartsList : public MessagePatternList<MessagePattern::Part,
|
|||
|
||||
MessagePattern::MessagePattern(UErrorCode &errorCode)
|
||||
: aposMode(UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE),
|
||||
partsList(NULL), parts(NULL), partsLength(0),
|
||||
numericValuesList(NULL), numericValues(NULL), numericValuesLength(0),
|
||||
partsList(nullptr), parts(nullptr), partsLength(0),
|
||||
numericValuesList(nullptr), numericValues(nullptr), numericValuesLength(0),
|
||||
hasArgNames(false), hasArgNumbers(false), needsAutoQuoting(false) {
|
||||
init(errorCode);
|
||||
}
|
||||
|
||||
MessagePattern::MessagePattern(UMessagePatternApostropheMode mode, UErrorCode &errorCode)
|
||||
: aposMode(mode),
|
||||
partsList(NULL), parts(NULL), partsLength(0),
|
||||
numericValuesList(NULL), numericValues(NULL), numericValuesLength(0),
|
||||
partsList(nullptr), parts(nullptr), partsLength(0),
|
||||
numericValuesList(nullptr), numericValues(nullptr), numericValuesLength(0),
|
||||
hasArgNames(false), hasArgNumbers(false), needsAutoQuoting(false) {
|
||||
init(errorCode);
|
||||
}
|
||||
|
||||
MessagePattern::MessagePattern(const UnicodeString &pattern, UParseError *parseError, UErrorCode &errorCode)
|
||||
: aposMode(UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE),
|
||||
partsList(NULL), parts(NULL), partsLength(0),
|
||||
numericValuesList(NULL), numericValues(NULL), numericValuesLength(0),
|
||||
partsList(nullptr), parts(nullptr), partsLength(0),
|
||||
numericValuesList(nullptr), numericValues(nullptr), numericValuesLength(0),
|
||||
hasArgNames(false), hasArgNumbers(false), needsAutoQuoting(false) {
|
||||
if(init(errorCode)) {
|
||||
parse(pattern, parseError, errorCode);
|
||||
|
@ -175,7 +175,7 @@ MessagePattern::init(UErrorCode &errorCode) {
|
|||
return false;
|
||||
}
|
||||
partsList=new MessagePatternPartsList();
|
||||
if(partsList==NULL) {
|
||||
if(partsList==nullptr) {
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return false;
|
||||
}
|
||||
|
@ -185,8 +185,8 @@ MessagePattern::init(UErrorCode &errorCode) {
|
|||
|
||||
MessagePattern::MessagePattern(const MessagePattern &other)
|
||||
: UObject(other), aposMode(other.aposMode), msg(other.msg),
|
||||
partsList(NULL), parts(NULL), partsLength(0),
|
||||
numericValuesList(NULL), numericValues(NULL), numericValuesLength(0),
|
||||
partsList(nullptr), parts(nullptr), partsLength(0),
|
||||
numericValuesList(nullptr), numericValues(nullptr), numericValuesLength(0),
|
||||
hasArgNames(other.hasArgNames), hasArgNumbers(other.hasArgNumbers),
|
||||
needsAutoQuoting(other.needsAutoQuoting) {
|
||||
UErrorCode errorCode=U_ZERO_ERROR;
|
||||
|
@ -217,13 +217,13 @@ MessagePattern::copyStorage(const MessagePattern &other, UErrorCode &errorCode)
|
|||
if(U_FAILURE(errorCode)) {
|
||||
return false;
|
||||
}
|
||||
parts=NULL;
|
||||
parts=nullptr;
|
||||
partsLength=0;
|
||||
numericValues=NULL;
|
||||
numericValues=nullptr;
|
||||
numericValuesLength=0;
|
||||
if(partsList==NULL) {
|
||||
if(partsList==nullptr) {
|
||||
partsList=new MessagePatternPartsList();
|
||||
if(partsList==NULL) {
|
||||
if(partsList==nullptr) {
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return false;
|
||||
}
|
||||
|
@ -238,9 +238,9 @@ MessagePattern::copyStorage(const MessagePattern &other, UErrorCode &errorCode)
|
|||
partsLength=other.partsLength;
|
||||
}
|
||||
if(other.numericValuesLength>0) {
|
||||
if(numericValuesList==NULL) {
|
||||
if(numericValuesList==nullptr) {
|
||||
numericValuesList=new MessagePatternDoubleList();
|
||||
if(numericValuesList==NULL) {
|
||||
if(numericValuesList==nullptr) {
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return false;
|
||||
}
|
||||
|
@ -351,7 +351,7 @@ MessagePattern::autoQuoteApostropheDeep() const {
|
|||
for(int32_t i=count; i>0;) {
|
||||
const Part &part=getPart(--i);
|
||||
if(part.getType()==UMSGPAT_PART_TYPE_INSERT_CHAR) {
|
||||
modified.insert(part.index, (UChar)part.value);
|
||||
modified.insert(part.index, (char16_t)part.value);
|
||||
}
|
||||
}
|
||||
return modified;
|
||||
|
@ -407,7 +407,7 @@ MessagePattern::preParse(const UnicodeString &pattern, UParseError *parseError,
|
|||
if(U_FAILURE(errorCode)) {
|
||||
return;
|
||||
}
|
||||
if(parseError!=NULL) {
|
||||
if(parseError!=nullptr) {
|
||||
parseError->line=0;
|
||||
parseError->offset=0;
|
||||
parseError->preContext[0]=0;
|
||||
|
@ -422,10 +422,10 @@ MessagePattern::preParse(const UnicodeString &pattern, UParseError *parseError,
|
|||
|
||||
void
|
||||
MessagePattern::postParse() {
|
||||
if(partsList!=NULL) {
|
||||
if(partsList!=nullptr) {
|
||||
parts=partsList->a.getAlias();
|
||||
}
|
||||
if(numericValuesList!=NULL) {
|
||||
if(numericValuesList!=nullptr) {
|
||||
numericValues=numericValuesList->a.getAlias();
|
||||
}
|
||||
}
|
||||
|
@ -451,7 +451,7 @@ MessagePattern::parseMessage(int32_t index, int32_t msgStartLength,
|
|||
if(index>=msg.length()) {
|
||||
break;
|
||||
}
|
||||
UChar c=msg.charAt(index++);
|
||||
char16_t c=msg.charAt(index++);
|
||||
if(c==u_apos) {
|
||||
if(index==msg.length()) {
|
||||
// The apostrophe is the last character in the pattern.
|
||||
|
@ -582,7 +582,7 @@ MessagePattern::parseArg(int32_t index, int32_t argStartLength, int32_t nestingL
|
|||
errorCode=U_UNMATCHED_BRACES;
|
||||
return 0;
|
||||
}
|
||||
UChar c=msg.charAt(index);
|
||||
char16_t c=msg.charAt(index);
|
||||
if(c==u_rightCurlyBrace) {
|
||||
// all done
|
||||
} else if(c!=u_comma) {
|
||||
|
@ -663,7 +663,7 @@ MessagePattern::parseSimpleStyle(int32_t index, UParseError *parseError, UErrorC
|
|||
int32_t start=index;
|
||||
int32_t nestedBraces=0;
|
||||
while(index<msg.length()) {
|
||||
UChar c=msg.charAt(index++);
|
||||
char16_t c=msg.charAt(index++);
|
||||
if(c==u_apos) {
|
||||
// Treat apostrophe as quoting but include it in the style part.
|
||||
// Find the end of the quoted literal text.
|
||||
|
@ -738,7 +738,7 @@ MessagePattern::parseChoiceStyle(int32_t index, int32_t nestingLevel,
|
|||
errorCode=U_PATTERN_SYNTAX_ERROR;
|
||||
return 0;
|
||||
}
|
||||
UChar c=msg.charAt(index);
|
||||
char16_t c=msg.charAt(index);
|
||||
if(!(c==u_pound || c==u_lessThan || c==u_lessOrEqual)) { // U+2264 is <=
|
||||
setParseError(parseError, start); // Expected choice separator (#<\u2264) instead of c.
|
||||
errorCode=U_PATTERN_SYNTAX_ERROR;
|
||||
|
@ -895,7 +895,7 @@ MessagePattern::parseArgNumber(const UnicodeString &s, int32_t start, int32_t li
|
|||
int32_t number;
|
||||
// Defer numeric errors until we know there are only digits.
|
||||
UBool badNumber;
|
||||
UChar c=s.charAt(start++);
|
||||
char16_t c=s.charAt(start++);
|
||||
if(c==0x30) {
|
||||
if(start==limit) {
|
||||
return 0;
|
||||
|
@ -941,7 +941,7 @@ MessagePattern::parseDouble(int32_t start, int32_t limit, UBool allowInfinity,
|
|||
int32_t value=0;
|
||||
int32_t isNegative=0; // not boolean so that we can easily add it to value
|
||||
int32_t index=start;
|
||||
UChar c=msg.charAt(index++);
|
||||
char16_t c=msg.charAt(index++);
|
||||
if(c==u_minus) {
|
||||
isNegative=1;
|
||||
if(index==limit) {
|
||||
|
@ -1004,17 +1004,17 @@ MessagePattern::parseDouble(int32_t start, int32_t limit, UBool allowInfinity,
|
|||
|
||||
int32_t
|
||||
MessagePattern::skipWhiteSpace(int32_t index) {
|
||||
const UChar *s=msg.getBuffer();
|
||||
const char16_t *s=msg.getBuffer();
|
||||
int32_t msgLength=msg.length();
|
||||
const UChar *t=PatternProps::skipWhiteSpace(s+index, msgLength-index);
|
||||
const char16_t *t=PatternProps::skipWhiteSpace(s+index, msgLength-index);
|
||||
return (int32_t)(t-s);
|
||||
}
|
||||
|
||||
int32_t
|
||||
MessagePattern::skipIdentifier(int32_t index) {
|
||||
const UChar *s=msg.getBuffer();
|
||||
const char16_t *s=msg.getBuffer();
|
||||
int32_t msgLength=msg.length();
|
||||
const UChar *t=PatternProps::skipIdentifier(s+index, msgLength-index);
|
||||
const char16_t *t=PatternProps::skipIdentifier(s+index, msgLength-index);
|
||||
return (int32_t)(t-s);
|
||||
}
|
||||
|
||||
|
@ -1022,7 +1022,7 @@ int32_t
|
|||
MessagePattern::skipDouble(int32_t index) {
|
||||
int32_t msgLength=msg.length();
|
||||
while(index<msgLength) {
|
||||
UChar c=msg.charAt(index);
|
||||
char16_t c=msg.charAt(index);
|
||||
// U+221E: Allow the infinity symbol, for ChoiceFormat patterns.
|
||||
if((c<0x30 && c!=u_plus && c!=u_minus && c!=u_dot) || (c>0x39 && c!=u_e && c!=u_E && c!=0x221e)) {
|
||||
break;
|
||||
|
@ -1039,7 +1039,7 @@ MessagePattern::isArgTypeChar(UChar32 c) {
|
|||
|
||||
UBool
|
||||
MessagePattern::isChoice(int32_t index) {
|
||||
UChar c;
|
||||
char16_t c;
|
||||
return
|
||||
((c=msg.charAt(index++))==u_c || c==u_C) &&
|
||||
((c=msg.charAt(index++))==u_h || c==u_H) &&
|
||||
|
@ -1051,7 +1051,7 @@ MessagePattern::isChoice(int32_t index) {
|
|||
|
||||
UBool
|
||||
MessagePattern::isPlural(int32_t index) {
|
||||
UChar c;
|
||||
char16_t c;
|
||||
return
|
||||
((c=msg.charAt(index++))==u_p || c==u_P) &&
|
||||
((c=msg.charAt(index++))==u_l || c==u_L) &&
|
||||
|
@ -1063,7 +1063,7 @@ MessagePattern::isPlural(int32_t index) {
|
|||
|
||||
UBool
|
||||
MessagePattern::isSelect(int32_t index) {
|
||||
UChar c;
|
||||
char16_t c;
|
||||
return
|
||||
((c=msg.charAt(index++))==u_s || c==u_S) &&
|
||||
((c=msg.charAt(index++))==u_e || c==u_E) &&
|
||||
|
@ -1075,7 +1075,7 @@ MessagePattern::isSelect(int32_t index) {
|
|||
|
||||
UBool
|
||||
MessagePattern::isOrdinal(int32_t index) {
|
||||
UChar c;
|
||||
char16_t c;
|
||||
return
|
||||
((c=msg.charAt(index++))==u_o || c==u_O) &&
|
||||
((c=msg.charAt(index++))==u_r || c==u_R) &&
|
||||
|
@ -1127,9 +1127,9 @@ MessagePattern::addArgDoublePart(double numericValue, int32_t start, int32_t len
|
|||
return;
|
||||
}
|
||||
int32_t numericIndex=numericValuesLength;
|
||||
if(numericValuesList==NULL) {
|
||||
if(numericValuesList==nullptr) {
|
||||
numericValuesList=new MessagePatternDoubleList();
|
||||
if(numericValuesList==NULL) {
|
||||
if(numericValuesList==nullptr) {
|
||||
errorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
@ -1147,7 +1147,7 @@ MessagePattern::addArgDoublePart(double numericValue, int32_t start, int32_t len
|
|||
|
||||
void
|
||||
MessagePattern::setParseError(UParseError *parseError, int32_t index) {
|
||||
if(parseError==NULL) {
|
||||
if(parseError==nullptr) {
|
||||
return;
|
||||
}
|
||||
parseError->offset=index;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue