From fb8cc86ff99c08064ac58a559bb66cc340693b92 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 19 Jun 2014 15:30:18 -0400 Subject: [PATCH] Rename sort() to qsort() In an effort to make the algorithm used clear. --- src/hb-coretext.cc | 4 ++-- src/hb-ot-map.cc | 4 ++-- src/hb-private.hh | 8 ++++---- src/hb-uniscribe.cc | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/hb-coretext.cc b/src/hb-coretext.cc index 06ccfd89f..864e9e7c0 100644 --- a/src/hb-coretext.cc +++ b/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; @@ -512,7 +512,7 @@ _hb_coretext_shape (hb_shape_plan_t *shape_plan, 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] = { diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc index 559193c1b..bd2d87f55 100644 --- a/src/hb-ot-map.cc +++ b/src/hb-ot-map.cc @@ -141,7 +141,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m) /* Sort features and merge duplicates */ { - feature_infos.sort (); + feature_infos.qsort (); unsigned int j = 0; for (unsigned int i = 1; i < feature_infos.len; i++) if (feature_infos[i].tag != feature_infos[j].tag) @@ -251,7 +251,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m) /* Sort lookups and merge duplicates */ if (last_num_lookups < m.lookups[table_index].len) { - m.lookups[table_index].sort (last_num_lookups, m.lookups[table_index].len); + m.lookups[table_index].qsort (last_num_lookups, m.lookups[table_index].len); unsigned int j = last_num_lookups; for (unsigned int i = j + 1; i < m.lookups[table_index].len; i++) diff --git a/src/hb-private.hh b/src/hb-private.hh index f36187586..5179912ff 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -353,14 +353,14 @@ struct hb_prealloced_array_t return NULL; } - inline void sort (void) + inline void qsort (void) { - qsort (array, len, sizeof (Type), (hb_compare_func_t) Type::cmp); + ::qsort (array, len, sizeof (Type), (hb_compare_func_t) Type::cmp); } - inline void sort (unsigned int start, unsigned int end) + inline void qsort (unsigned int start, unsigned int end) { - qsort (array + start, end - start, sizeof (Type), (hb_compare_func_t) Type::cmp); + ::qsort (array + start, end - start, sizeof (Type), (hb_compare_func_t) Type::cmp); } template diff --git a/src/hb-uniscribe.cc b/src/hb-uniscribe.cc index 657144887..f6994159f 100644 --- a/src/hb-uniscribe.cc +++ b/src/hb-uniscribe.cc @@ -631,7 +631,7 @@ _hb_uniscribe_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; @@ -663,7 +663,7 @@ _hb_uniscribe_shape (hb_shape_plan_t *shape_plan, unsigned int offset = feature_records.len; - active_features.sort (); + active_features.qsort (); for (unsigned int j = 0; j < active_features.len; j++) { if (!j || active_features[j].rec.tagFeature != feature_records[feature_records.len - 1].tagFeature)