Dylan Smith dylan.ah.smith@gmail.com writes:
+static void sort_vertex_indices(struct point2d_index *start, int count) +{
- struct point2d_index *current, *middle_value, *last;
- int below_count;
- if (count <= 1)
return;
- /* quick sort */
- last = start + count - 1;
- middle_value = last--;
- current = start;
- while (current <= last)
- {
if (compare_vertex_indices(current, middle_value) < 0) {
current++;
} else {
swap_vertex_indices(current, last);
last--;
}
- }
- swap_vertex_indices(current, middle_value);
- below_count = current - start;
- sort_vertex_indices(start, below_count);
- sort_vertex_indices(current + 1, count - below_count - 1);
+}
Is there a reason for not using qsort?
On Wed, Mar 9, 2011 at 8:02 AM, Alexandre Julliard julliard@winehq.orgwrote:
Is there a reason for not using qsort?
No.
I didn't realize the function existed in the c standard library.