# HG changeset patch # User ib # Date 1398529973 0 # Node ID ae4f30c4ef02acd77458dca0a5e71b460fdb21ed # Parent 9e3b2b71a146b7b42b599bc81f454cea25bd28d0 Determine size from variable declaration. diff -r 9e3b2b71a146 -r ae4f30c4ef02 gui/app/cfg.c --- a/gui/app/cfg.c Sat Apr 26 16:30:54 2014 +0000 +++ b/gui/app/cfg.c Sat Apr 26 16:32:53 2014 +0000 @@ -294,7 +294,7 @@ if (!*line) continue; - item = calloc(1, sizeof(plItem)); + item = calloc(1, sizeof(*item)); if (!item) { gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_MemAllocFailed); @@ -329,7 +329,7 @@ if (!*line) continue; - item = calloc(1, sizeof(urlItem)); + item = calloc(1, sizeof(*item)); if (!item) { gmp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_MemAllocFailed); diff -r 9e3b2b71a146 -r ae4f30c4ef02 gui/dialog/playlist.c --- a/gui/dialog/playlist.c Sat Apr 26 16:30:54 2014 +0000 +++ b/gui/dialog/playlist.c Sat Apr 26 16:32:53 2014 +0000 @@ -143,7 +143,7 @@ for ( i=0;iname = strdup( text[0] ); @@ -361,7 +361,7 @@ if ( stat( path,&statbuf ) != -1 && S_ISDIR( statbuf.st_mode ) && dirent->d_name[0] != '.' ) { - DirNode=malloc( sizeof( DirNodeType ) ); DirNode->scaned=False; DirNode->path=strdup( path ); + DirNode=malloc( sizeof( *DirNode ) ); DirNode->scaned=False; DirNode->path=strdup( path ); subdir=check_for_subdir( path ); node=gtk_ctree_insert_node( ctree,parent_node,NULL,&utf8name,4,pxOpenedBook,msOpenedBook,pxClosedBook,msClosedBook,!subdir,FALSE ); gtk_ctree_node_set_row_data_full( ctree,node,DirNode,NULL ); @@ -479,7 +479,7 @@ if ( !pxClosedBook ) pxClosedBook=gdk_pixmap_create_from_xpm_d( Playlist->window,&msClosedBook,&transparent,(gchar **)open2_xpm ); parent=gtk_ctree_insert_node( GTK_CTREE( CTDirTree ),NULL,NULL,&root,4,pxOpenedBook,msOpenedBook,pxClosedBook,msClosedBook,FALSE,FALSE ); - DirNode=malloc( sizeof( DirNodeType ) ); + DirNode=malloc( sizeof( *DirNode ) ); DirNode->scaned=False; DirNode->path=strdup( root ); gtk_ctree_node_set_row_data_full(GTK_CTREE( CTDirTree ),parent,DirNode,NULL ); sibling=gtk_ctree_insert_node( GTK_CTREE( CTDirTree ),parent,NULL,&dummy,4,NULL,NULL,NULL,NULL,TRUE,TRUE ); diff -r 9e3b2b71a146 -r ae4f30c4ef02 gui/dialog/url.c --- a/gui/dialog/url.c Sat Apr 26 16:30:54 2014 +0000 +++ b/gui/dialog/url.c Sat Apr 26 16:32:53 2014 +0000 @@ -74,7 +74,7 @@ listMgr(PLAYLIST_DELETE, 0); add_to_gui_playlist(str, PLAYLIST_ITEM_APPEND); - item = calloc(1, sizeof(urlItem)); + item = calloc(1, sizeof(*item)); if (item) { item->url = str; diff -r 9e3b2b71a146 -r ae4f30c4ef02 gui/interface.c --- a/gui/interface.c Sat Apr 26 16:30:54 2014 +0000 +++ b/gui/interface.c Sat Apr 26 16:32:53 2014 +0000 @@ -108,7 +108,7 @@ listFree(&vf_settings[i].attribs); vf_settings[i].attribs = listDup(argvf); } else { - void *settings = realloc(vf_settings, (i + 2) * sizeof(m_obj_settings_t)); + void *settings = realloc(vf_settings, (i + 2) * sizeof(*vf_settings)); if (!settings) return; @@ -119,7 +119,7 @@ memset(&vf_settings[i + 1], 0, sizeof(m_obj_settings_t)); } } else { - vf_settings = calloc(2, sizeof(m_obj_settings_t)); + vf_settings = calloc(2, sizeof(*vf_settings)); if (!vf_settings) return; diff -r 9e3b2b71a146 -r ae4f30c4ef02 gui/ui/main.c --- a/gui/ui/main.c Sat Apr 26 16:30:54 2014 +0000 +++ b/gui/ui/main.c Sat Apr 26 16:32:53 2014 +0000 @@ -353,7 +353,7 @@ listMgr(PLAYLIST_DELETE,0); } - item = calloc(1,sizeof(plItem)); + item = calloc(1,sizeof(*item)); s = strrchr( str,'/' ); diff -r 9e3b2b71a146 -r ae4f30c4ef02 gui/util/list.c --- a/gui/util/list.c Sat Apr 26 16:30:54 2014 +0000 +++ b/gui/util/list.c Sat Apr 26 16:32:53 2014 +0000 @@ -407,7 +407,7 @@ else strcpy(path, "."); - item = calloc(1, sizeof(plItem)); + item = calloc(1, sizeof(*item)); if (!item) { free(path);