summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/picture.c2
-rw-r--r--core/picture.h1
-rw-r--r--core/table.h4
3 files changed, 4 insertions, 3 deletions
diff --git a/core/picture.c b/core/picture.c
index df1304ab8..d7ba597f6 100644
--- a/core/picture.c
+++ b/core/picture.c
@@ -31,7 +31,7 @@ static MAKE_GROW_TABLE(picture_table, struct picture, pictures)
static MAKE_GET_INSERTION_INDEX(picture_table, struct picture, pictures, picture_less_than)
MAKE_ADD_TO(picture_table, struct picture, pictures)
static MAKE_REMOVE_FROM(picture_table, pictures)
-//MAKE_SORT(picture_table, struct picture, pictures, comp_pictures)
+MAKE_SORT(picture_table, struct picture, pictures, comp_pictures)
//MAKE_REMOVE(picture_table, struct picture, picture)
MAKE_CLEAR_TABLE(picture_table, pictures, picture)
diff --git a/core/picture.h b/core/picture.h
index 4e42052a4..999ef9681 100644
--- a/core/picture.h
+++ b/core/picture.h
@@ -35,6 +35,7 @@ extern void copy_pictures(const struct picture_table *s, struct picture_table *d
extern void add_picture(struct picture_table *, struct picture newpic);
extern bool remove_picture(struct picture_table *, const char *filename);
extern int get_picture_idx(const struct picture_table *, const char *filename); /* Return -1 if not found */
+extern void sort_picture_table(struct picture_table *);
#ifdef __cplusplus
}
diff --git a/core/table.h b/core/table.h
index 0f168f4bc..d12a711eb 100644
--- a/core/table.h
+++ b/core/table.h
@@ -72,8 +72,8 @@
#define MAKE_SORT(table_type, item_type, array_name, fun) \
static int sortfn_##table_type(const void *_a, const void *_b) \
{ \
- const item_type a = (const item_type)*(const void **)_a; \
- const item_type b = (const item_type)*(const void **)_b; \
+ const item_type a = *(const item_type *)_a; \
+ const item_type b = *(const item_type *)_b; \
return fun(a, b); \
} \
\