mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
media: create sort_picture_table function via macro
This needs a slight change to the macro, because here we sort by value type. Yes, from a C-programming point of view this is horrible, however a decent compiler should just inline everything and not pass around value types. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
db24f16686
commit
ebdb3e3c30
3 changed files with 4 additions and 3 deletions
|
|
@ -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); \
|
||||
} \
|
||||
\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue