Make enum in sorting function const

This commit is contained in:
Mario Hüttel 2019-03-12 19:28:17 +01:00
parent 72d5352b09
commit ab23be1cfc
1 changed files with 3 additions and 2 deletions

View File

@ -162,10 +162,11 @@ static gint sort_func(GtkListBoxRow *row1, GtkListBoxRow *row2, gpointer unused)
{ {
LayerElement *le1, *le2; LayerElement *le1, *le2;
gint ret; gint ret;
enum layer_selector_sort_algo default_sort = LAYER_SELECTOR_SORT_DOWN; static const enum layer_selector_sort_algo default_sort = LAYER_SELECTOR_SORT_DOWN;
enum layer_selector_sort_algo *algo = (enum layer_selector_sort_algo *)unused; const enum layer_selector_sort_algo *algo = (const enum layer_selector_sort_algo *)unused;
/* Assume downward sorting */ /* Assume downward sorting */
/* TODO: This is nasty. Find a better way */
if (!algo) if (!algo)
algo = &default_sort; algo = &default_sort;