changeset 32100:0e09b34b0c47

Replace some sizeof(type) by sizeof(*pointer)
author reimar
date Sun, 12 Sep 2010 12:22:01 +0000
parents 0e249bbc445c
children adae664c1961
files libmpdemux/asfheader.c libmpdemux/demux_avs.c libmpdemux/demux_roq.c libmpdemux/demux_viv.c libmpdemux/muxer_lavf.c
diffstat 5 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/asfheader.c	Sun Sep 12 12:14:37 2010 +0000
+++ b/libmpdemux/asfheader.c	Sun Sep 12 12:22:01 2010 +0000
@@ -345,7 +345,7 @@
   uint8_t *buffer = *buf;
   int pos = *ppos;
 
-  sh_audio->wf=calloc((streamh->type_size<sizeof(WAVEFORMATEX))?sizeof(WAVEFORMATEX):streamh->type_size,1);
+  sh_audio->wf=calloc((streamh->type_size<sizeof(*sh_audio->wf))?sizeof(*sh_audio->wf):streamh->type_size,1);
   memcpy(sh_audio->wf,buffer,streamh->type_size);
   le2me_WAVEFORMATEX(sh_audio->wf);
   if( mp_msg_test(MSGT_HEADER,MSGL_V) ) print_wave_header(sh_audio->wf,MSGL_V);
@@ -494,10 +494,10 @@
         len=streamh->type_size-(4+4+1+2);
 	++video_streams;
 //        sh_video->bih=malloc(chunksize); memset(sh_video->bih,0,chunksize);
-        sh_video->bih=calloc((len<sizeof(BITMAPINFOHEADER))?sizeof(BITMAPINFOHEADER):len,1);
+        sh_video->bih=calloc((len<sizeof(*sh_video->bih))?sizeof(*sh_video->bih):len,1);
         memcpy(sh_video->bih,&buffer[4+4+1+2],len);
 	le2me_BITMAPINFOHEADER(sh_video->bih);
-	if (sh_video->bih->biSize > len && sh_video->bih->biSize > sizeof(BITMAPINFOHEADER))
+	if (sh_video->bih->biSize > len && sh_video->bih->biSize > sizeof(*sh_video->bih))
 		sh_video->bih->biSize = len;
         if (sh_video->bih->biCompression == mmioFOURCC('D', 'V', 'R', ' ')) {
           //mp_msg(MSGT_DEMUXER, MSGL_WARN, MSGTR_MPDEMUX_ASFHDR_DVRWantsLibavformat);
--- a/libmpdemux/demux_avs.c	Sun Sep 12 12:14:37 2010 +0000
+++ b/libmpdemux/demux_avs.c	Sun Sep 12 12:22:01 2010 +0000
@@ -300,7 +300,7 @@
         sh_video->fps = (double) AVS->video_info->fps_numerator / (double) AVS->video_info->fps_denominator;
         sh_video->frametime = 1.0 / sh_video->fps;
 
-        sh_video->bih = malloc(sizeof(BITMAPINFOHEADER) + (256 * 4));
+        sh_video->bih = malloc(sizeof(*sh_video->bih) + (256 * 4));
         sh_video->bih->biCompression = sh_video->format;
         sh_video->bih->biBitCount = avs_bits_per_pixel(AVS->video_info);
         //sh_video->bih->biPlanes = 2;
@@ -333,7 +333,7 @@
         demuxer->audio->sh = sh_audio;
         sh_audio->ds = demuxer->audio;
 
-        sh_audio->wf = malloc(sizeof(WAVEFORMATEX));
+        sh_audio->wf = malloc(sizeof(*sh_audio->wf));
         sh_audio->wf->wFormatTag = sh_audio->format =
             (AVS->video_info->sample_type == AVS_SAMPLE_FLOAT) ? 0x3 : 0x1;
         sh_audio->wf->nChannels = sh_audio->channels = AVS->video_info->nchannels;
--- a/libmpdemux/demux_roq.c	Sun Sep 12 12:14:37 2010 +0000
+++ b/libmpdemux/demux_roq.c	Sun Sep 12 12:22:01 2010 +0000
@@ -177,7 +177,7 @@
         sh_audio->ds = demuxer->audio;
 
         // go through the bother of making a WAVEFORMATEX structure
-        sh_audio->wf = malloc(sizeof(WAVEFORMATEX));
+        sh_audio->wf = malloc(sizeof(*sh_audio->wf));
 
         // custom fourcc for internal MPlayer use
         sh_audio->format = mmioFOURCC('R', 'o', 'Q', 'A');
--- a/libmpdemux/demux_viv.c	Sun Sep 12 12:14:37 2010 +0000
+++ b/libmpdemux/demux_viv.c	Sun Sep 12 12:22:01 2010 +0000
@@ -614,7 +614,7 @@
 		    sh->disp_h = height;
 
 		// emulate BITMAPINFOHEADER:
-		sh->bih=calloc(1, sizeof(BITMAPINFOHEADER));
+		sh->bih=calloc(1, sizeof(*sh->bih));
 		sh->bih->biSize=40;
 		if (priv->width)
 		    sh->bih->biWidth = priv->width;
@@ -678,7 +678,7 @@
 		}
 
 		// Emulate WAVEFORMATEX struct:
-		sh->wf=calloc(1, sizeof(WAVEFORMATEX));
+		sh->wf=calloc(1, sizeof(*sh->wf));
 		sh->wf->wFormatTag=sh->format;
 		sh->wf->nChannels=1; /* 1 channels for both Siren and G.723 */
 
--- a/libmpdemux/muxer_lavf.c	Sun Sep 12 12:14:37 2010 +0000
+++ b/libmpdemux/muxer_lavf.c	Sun Sep 12 12:22:01 2010 +0000
@@ -229,9 +229,9 @@
 		ctx->bit_rate = 800000;
 		ctx->time_base.den = stream->h.dwRate;
 		ctx->time_base.num = stream->h.dwScale;
-		if(stream->bih+1 && (stream->bih->biSize > sizeof(BITMAPINFOHEADER)))
+		if(stream->bih+1 && (stream->bih->biSize > sizeof(*stream->bih)))
 		{
-			ctx->extradata_size = stream->bih->biSize - sizeof(BITMAPINFOHEADER);
+			ctx->extradata_size = stream->bih->biSize - sizeof(*stream->bih);
 			ctx->extradata = av_malloc(ctx->extradata_size);
 			if(ctx->extradata != NULL)
 				memcpy(ctx->extradata, stream->bih+1, ctx->extradata_size);