Rename sort() to qsort()

In an effort to make the algorithm used clear.
pull/27/merge
Behdad Esfahbod 11 years ago
parent 577ca48143
commit fb8cc86ff9
  1. 4
      src/hb-coretext.cc
  2. 4
      src/hb-ot-map.cc
  3. 8
      src/hb-private.hh
  4. 4
      src/hb-uniscribe.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] = {

@ -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++)

@ -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 <typename T>

@ -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)

Loading…
Cancel
Save