[MPlayer-cvslog] r35310 - trunk/libmenu/menu_filesel.c

reimar subversion at mplayerhq.hu
Wed Oct 31 20:44:56 CET 2012


Author: reimar
Date: Wed Oct 31 20:44:56 2012
New Revision: 35310

Log:
Use correct function prototype instead of casting away the warnings.

Modified:
   trunk/libmenu/menu_filesel.c

Modified: trunk/libmenu/menu_filesel.c
==============================================================================
--- trunk/libmenu/menu_filesel.c	Wed Oct 31 20:42:13 2012	(r35309)
+++ trunk/libmenu/menu_filesel.c	Wed Oct 31 20:44:56 2012	(r35310)
@@ -139,8 +139,6 @@ static char* replace_path(char* title , 
     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 @@ static int mylstat(char *dir, char *file
   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 @@ bailout:
     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;


More information about the MPlayer-cvslog mailing list