From ebdb3e3c3029d3762207e8dcadfa3a61bf0a9293 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 14 Apr 2020 20:06:19 +0200 Subject: 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 --- core/table.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/table.h') 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); \ } \ \ -- cgit v1.2.3-70-g09d2