From fe6c4fcae203e6f95ae654acf80f912185c853da Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 12 Sep 2010 11:44:42 +0000 Subject: cleanup: malloc+memset->calloc, sizeof(TYPE)->sizeof(*ptr) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace malloc+memset by calloc git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32181 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32182 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32183 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace some sizeof(type) by sizeof(*pointer) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32184 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32186 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32187 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32188 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizoef(type) by sizeof(*ptrvar). Besides being consistent with FFmpeg style, this reduces the size of a patch to rename these types to not conflict with the windows.h definitions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32189 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32191 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32192 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizeof(type) by sizeof(*ptrvar) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32193 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove a useless cast. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32194 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizeof(type) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32195 b3059339-0415-0410-9bf9-f77b7e298cf2 Remove a useless cast. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32196 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace several sizeof(WAVEFORMATEX) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32197 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace one more instance of sizeof(WAVEFORMATEX); fix compilation. patch by Clément Bœsch, ubitux gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32199 b3059339-0415-0410-9bf9-f77b7e298cf2 Avoid some pointless uses of sizeof() and one related cast. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32200 b3059339-0415-0410-9bf9-f77b7e298cf2 Merge one malloc() + memset() invocation into calloc(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32202 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32203 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizeof(WAVEFORMATEX) occurrences. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32205 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace malloc+memset by calloc. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32206 b3059339-0415-0410-9bf9-f77b7e298cf2 Replace sizeof(BITMAPINFOHEADER) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32207 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_rawdv.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libmpdemux/demux_rawdv.c') diff --git a/libmpdemux/demux_rawdv.c b/libmpdemux/demux_rawdv.c index 6c3cdffd3a..f0b081318c 100644 --- a/libmpdemux/demux_rawdv.c +++ b/libmpdemux/demux_rawdv.c @@ -189,7 +189,7 @@ static demuxer_t* demux_open_rawdv(demuxer_t* demuxer) sh_video->frametime = 1.0/sh_video->fps; // emulate BITMAPINFOHEADER for win32 decoders: - sh_video->bih=calloc(1, sizeof(BITMAPINFOHEADER)); + sh_video->bih=calloc(1, sizeof(*sh_video->bih)); sh_video->bih->biSize=40; sh_video->bih->biWidth = dv_decoder->width; sh_video->bih->biHeight = dv_decoder->height; @@ -214,8 +214,7 @@ static demuxer_t* demux_open_rawdv(demuxer_t* demuxer) // custom fourcc for internal MPlayer use sh_audio->format = mmioFOURCC('R', 'A', 'D', 'V'); - sh_audio->wf = malloc(sizeof(WAVEFORMATEX)); - memset(sh_audio->wf, 0, sizeof(WAVEFORMATEX)); + sh_audio->wf = calloc(1, sizeof(*sh_audio->wf)); sh_audio->wf->wFormatTag = sh_audio->format; sh_audio->wf->nChannels = dv_decoder->audio->num_channels; sh_audio->wf->wBitsPerSample = 16; -- cgit v1.2.3