[gnumeric] Compilation: use g_ptr_array_sort instead of raw qsort.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Compilation: use g_ptr_array_sort instead of raw qsort.
- Date: Thu, 30 Nov 2017 02:25:32 +0000 (UTC)
commit d3815481d9a4b7907bfeef65f9d40428d40acd68
Author: Morten Welinder <terra gnome org>
Date: Wed Nov 29 21:20:18 2017 -0500
Compilation: use g_ptr_array_sort instead of raw qsort.
src/sstest.c | 5 +----
src/widgets/ChangeLog | 7 +++++++
src/widgets/gnm-filter-combo-view.c | 4 +---
src/widgets/gnm-validation-combo-view.c | 4 +---
4 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/sstest.c b/src/sstest.c
index 3f40e92..3b8a4d3 100644
--- a/src/sstest.c
+++ b/src/sstest.c
@@ -293,10 +293,7 @@ enumerate_functions (gboolean filter)
gnm_func_load_if_stub (fd);
}
- if (res->len > 0)
- qsort (&g_ptr_array_index (res, 0),
- res->len, sizeof (gpointer),
- func_def_cmp);
+ g_ptr_array_sort (res, func_def_cmp);
return res;
}
diff --git a/src/widgets/ChangeLog b/src/widgets/ChangeLog
index d03340b..44e7527 100644
--- a/src/widgets/ChangeLog
+++ b/src/widgets/ChangeLog
@@ -1,3 +1,10 @@
+2017-11-29 Morten Welinder <terra gnome org>
+
+ * gnm-validation-combo-view.c (vcombo_create_list): Use
+ g_ptr_array_sort for simplicity.
+
+ * gnm-filter-combo-view.c (fcombo_create_list): Ditto.
+
2017-11-18 Morten Welinder <terra gnome org>
* Release 1.12.36
diff --git a/src/widgets/gnm-filter-combo-view.c b/src/widgets/gnm-filter-combo-view.c
index a7db14b..1b34029 100644
--- a/src/widgets/gnm-filter-combo-view.c
+++ b/src/widgets/gnm-filter-combo-view.c
@@ -218,9 +218,7 @@ fcombo_create_list (SheetObject *so,
(CellIterFunc)&cb_collect_content, &uc);
g_hash_table_foreach (uc.hash, (GHFunc)cb_hash_domain, sorted);
- qsort (&g_ptr_array_index (sorted, 0),
- sorted->len, sizeof (char *),
- &value_cmp);
+ g_ptr_array_sort (sorted, value_cmp);
if (fcombo->cond != NULL &&
fcombo->cond->op[0] == GNM_FILTER_OP_EQUAL &&
diff --git a/src/widgets/gnm-validation-combo-view.c b/src/widgets/gnm-validation-combo-view.c
index dcb9f0c..1ab2cb9 100644
--- a/src/widgets/gnm-validation-combo-view.c
+++ b/src/widgets/gnm-validation-combo-view.c
@@ -127,9 +127,7 @@ vcombo_create_list (SheetObject *so,
sorted = g_ptr_array_new ();
g_hash_table_foreach (uc.hash, (GHFunc)cb_hash_domain, sorted);
- qsort (&g_ptr_array_index (sorted, 0),
- sorted->len, sizeof (char *),
- &value_cmp);
+ g_ptr_array_sort (sorted, value_cmp);
model = gtk_list_store_new (3,
G_TYPE_STRING, G_TYPE_STRING, gnm_value_get_type ());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]