changeset 35216:4c2104e9e0d1

Use correct function prototype instead of casting away the warnings.
author reimar
date Wed, 31 Oct 2012 19:44:56 +0000
parents caf85cf24a2e
children c45cbe0d8ce1
files libmenu/menu_filesel.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;