OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 createUnicodeSet(name##Array, WTF_ARRAY_LENGTH(name##Array), name##Ranges, \ | 68 createUnicodeSet(name##Array, WTF_ARRAY_LENGTH(name##Array), name##Ranges, \ |
69 WTF_ARRAY_LENGTH(name##Ranges)) | 69 WTF_ARRAY_LENGTH(name##Ranges)) |
70 | 70 |
71 #define RETURN_HAS_PROPERTY(c, name) \ | 71 #define RETURN_HAS_PROPERTY(c, name) \ |
72 static icu::UnicodeSet* unicodeSet = nullptr; \ | 72 static icu::UnicodeSet* unicodeSet = nullptr; \ |
73 if (!unicodeSet) \ | 73 if (!unicodeSet) \ |
74 unicodeSet = CREATE_UNICODE_SET(name); \ | 74 unicodeSet = CREATE_UNICODE_SET(name); \ |
75 return unicodeSet->contains(c); | 75 return unicodeSet->contains(c); |
76 #else | 76 #else |
77 // Freezed trie tree, see CharacterDataGenerator.cpp. | 77 // Freezed trie tree, see CharacterDataGenerator.cpp. |
78 extern int32_t serializedCharacterDataSize; | 78 extern const int32_t serializedCharacterDataSize; |
79 extern uint8_t serializedCharacterData[]; | 79 extern const uint8_t serializedCharacterData[]; |
80 | 80 |
81 static UTrie2* createTrie() { | 81 static UTrie2* createTrie() { |
82 // Create a Trie from the value array. | 82 // Create a Trie from the value array. |
83 ICUError error; | 83 ICUError error; |
84 UTrie2* trie = utrie2_openFromSerialized( | 84 UTrie2* trie = utrie2_openFromSerialized( |
85 UTrie2ValueBits::UTRIE2_16_VALUE_BITS, serializedCharacterData, | 85 UTrie2ValueBits::UTRIE2_16_VALUE_BITS, serializedCharacterData, |
86 serializedCharacterDataSize, nullptr, &error); | 86 serializedCharacterDataSize, nullptr, &error); |
87 ASSERT(error == U_ZERO_ERROR); | 87 ASSERT(error == U_ZERO_ERROR); |
88 return trie; | 88 return trie; |
89 } | 89 } |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 } | 254 } |
255 | 255 |
256 bool Character::isCommonOrInheritedScript(UChar32 character) { | 256 bool Character::isCommonOrInheritedScript(UChar32 character) { |
257 ICUError status; | 257 ICUError status; |
258 UScriptCode script = uscript_getScript(character, &status); | 258 UScriptCode script = uscript_getScript(character, &status); |
259 return U_SUCCESS(status) && | 259 return U_SUCCESS(status) && |
260 (script == USCRIPT_COMMON || script == USCRIPT_INHERITED); | 260 (script == USCRIPT_COMMON || script == USCRIPT_INHERITED); |
261 } | 261 } |
262 | 262 |
263 } // namespace blink | 263 } // namespace blink |
OLD | NEW |