# HG changeset patch # User reimar # Date 1351712696 0 # Node ID 4c2104e9e0d16d11c21f1cdd9ea0be74762eeb24 # Parent caf85cf24a2e69ca82869e0d8706fc9f0ca62c01 Use correct function prototype instead of casting away the warnings. diff -r caf85cf24a2e -r 4c2104e9e0d1 libmenu/menu_filesel.c --- a/libmenu/menu_filesel.c Wed Oct 31 19:42:13 2012 +0000 +++ b/libmenu/menu_filesel.c Wed Oct 31 19:44:56 2012 +0000 @@ -139,8 +139,6 @@ return title; } -typedef int (*kill_warn)(const void*, const void*); - static int mylstat(char *dir, char *file,struct stat* st) { int l = strlen(dir) + strlen(file); char s[l+2]; @@ -168,7 +166,9 @@ return stat(s,st); } -static int compare(char **a, char **b){ +static int compare(const void *av, const void *bv){ + const char * const *a = av; + const char * const *b = bv; if((*a)[strlen(*a) - 1] == '/') { if((*b)[strlen(*b) - 1] == '/') return strcmp(*b, *a) ; @@ -317,7 +317,7 @@ mp_msg(MSGT_GLOBAL,MSGL_ERR,MSGTR_LIBMENU_ReaddirError,strerror(errno)); return 0; } - qsort(namelist, n, sizeof(char *), (kill_warn)compare); + qsort(namelist, n, sizeof(char *), compare); while(n--) { if((e = calloc(1,sizeof(list_entry_t))) != NULL){ e->p.next = NULL;