Index: third_party/harfbuzz-ng/src/hb-coretext.cc |
diff --git a/third_party/harfbuzz-ng/src/hb-coretext.cc b/third_party/harfbuzz-ng/src/hb-coretext.cc |
index 570513667dab5eed6fc121e27c457767c4251e1e..d92c6baaf61ed081b1d7df93467feaa38ac722ca 100644 |
--- a/third_party/harfbuzz-ng/src/hb-coretext.cc |
+++ b/third_party/harfbuzz-ng/src/hb-coretext.cc |
@@ -477,7 +477,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, |
event->start = false; |
event->feature = feature; |
} |
- feature_events.sort (); |
+ feature_events.qsort (); |
/* Add a strategic final event. */ |
{ |
active_feature_t feature; |
@@ -507,14 +507,12 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, |
if (unlikely (!range)) |
goto fail_features; |
- unsigned int offset = feature_records.len; |
- |
if (active_features.len) |
{ |
CFMutableArrayRef features_array = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); |
/* TODO sort and resolve conflicting features? */ |
- /* active_features.sort (); */ |
+ /* active_features.qsort (); */ |
for (unsigned int j = 0; j < active_features.len; j++) |
{ |
CFStringRef keys[2] = { |
@@ -612,13 +610,13 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, |
for (unsigned int i = 0; i < buffer->len; i++) { |
hb_codepoint_t c = buffer->info[i].codepoint; |
buffer->info[i].utf16_index() = chars_len; |
- if (likely (c < 0x10000)) |
+ if (likely (c <= 0xFFFFu)) |
pchars[chars_len++] = c; |
- else if (unlikely (c >= 0x110000)) |
- pchars[chars_len++] = 0xFFFD; |
+ else if (unlikely (c > 0x10FFFFu)) |
+ pchars[chars_len++] = 0xFFFDu; |
else { |
- pchars[chars_len++] = 0xD800 + ((c - 0x10000) >> 10); |
- pchars[chars_len++] = 0xDC00 + ((c - 0x10000) & ((1 << 10) - 1)); |
+ pchars[chars_len++] = 0xD800u + ((c - 0x10000u) >> 10); |
+ pchars[chars_len++] = 0xDC00u + ((c - 0x10000u) & ((1 << 10) - 1)); |
} |
} |
@@ -644,7 +642,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, |
hb_codepoint_t c = buffer->info[i].codepoint; |
unsigned int cluster = buffer->info[i].cluster; |
log_clusters[chars_len++] = cluster; |
- if (c >= 0x10000 && c < 0x110000) |
+ if (hb_in_range (c, 0x10000u, 0x10FFFFu)) |
log_clusters[chars_len++] = cluster; /* Surrogates. */ |
} |
@@ -716,10 +714,10 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, |
for (CFIndex j = range.location; j < range.location + range.length; j++) |
{ |
UniChar ch = CFStringGetCharacterAtIndex (string_ref, j); |
- if (hb_in_range<UniChar> (ch, 0xDC00, 0xDFFF) && range.location < j) |
+ if (hb_in_range<UniChar> (ch, 0xDC00u, 0xDFFFu) && range.location < j) |
{ |
ch = CFStringGetCharacterAtIndex (string_ref, j - 1); |
- if (hb_in_range<UniChar> (ch, 0xD800, 0xDBFF)) |
+ if (hb_in_range<UniChar> (ch, 0xD800u, 0xDBFFu)) |
/* This is the second of a surrogate pair. Don't need .notdef |
* for this one. */ |
continue; |