summaryrefslogtreecommitdiffstats
path: root/libmenu
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-10 01:46:46 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-10 01:50:55 +0200
commite74708f6194ef0af2bdf37e857ed232027fa46ba (patch)
treef7b53476abeb1cc8ccbe1c49113e9722c51b7800 /libmenu
parent2ad00b5319603b22f9b0858bb14d016f673157cb (diff)
parentcb8796857c8bd851e3b97d729af149e3f003b851 (diff)
downloadmpv-e74708f6194ef0af2bdf37e857ed232027fa46ba.tar.bz2
mpv-e74708f6194ef0af2bdf37e857ed232027fa46ba.tar.xz
Merge svn changes up to r30748
Diffstat (limited to 'libmenu')
-rw-r--r--libmenu/menu_filesel.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c
index 3b239d11d6..27dab40dae 100644
--- a/libmenu/menu_filesel.c
+++ b/libmenu/menu_filesel.c
@@ -192,7 +192,7 @@ static char **get_extensions(menu_t *menu){
if(!fp)
return NULL;
- extensions = (char **) malloc(sizeof(*extensions));
+ extensions = malloc(sizeof(*extensions));
*extensions = NULL;
while(fgets(ext,sizeof(ext),fp)) {
@@ -203,9 +203,9 @@ static char **get_extensions(menu_t *menu){
ext[s-1] = '\0';
s--;
}
- e = (char *) malloc(s+1);
- extensions = (char **) realloc(extensions, ++n * sizeof(*extensions));
- extensions = (char **) realloc(extensions, ++n * sizeof(*extensions));
+ e = malloc(s+1);
+ extensions = realloc(extensions, ++n * sizeof(*extensions));
+ extensions = realloc(extensions, ++n * sizeof(*extensions));
strcpy (e, ext);
for (l=extensions; *l; l++);
*l++ = e;
@@ -261,7 +261,7 @@ static int open_dir(menu_t* menu,char* args) {
}
}
- namelist = (char **) malloc(sizeof(char *));
+ namelist = malloc(sizeof(char *));
extensions = get_extensions(menu);
n=0;
@@ -289,7 +289,7 @@ static int open_dir(menu_t* menu,char* args) {
continue;
}
if(n%20 == 0){ // Get some more mem
- if((tp = (char **) realloc(namelist, (n+20) * sizeof (char *)))
+ if((tp = realloc(namelist, (n+20) * sizeof (char *)))
== NULL) {
mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] realloc error: %s\n", strerror(errno));
n--;
@@ -298,7 +298,7 @@ static int open_dir(menu_t* menu,char* args) {
namelist=tp;
}
- namelist[n] = (char *) malloc(strlen(dp->d_name) + 2);
+ namelist[n] = malloc(strlen(dp->d_name) + 2);
if(namelist[n] == NULL){
mp_tmsg(MSGT_GLOBAL,MSGL_ERR,"[MENU] memory allocation error: %s\n", strerror(errno));
n--;