]> git.sesse.net Git - vlc/commitdiff
calloc( nb_elmnt, size ) instead of calloc( size, nb_elmnt )
authorRémi Duraffort <ivoire@videolan.org>
Fri, 16 Jan 2009 10:53:20 +0000 (11:53 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Fri, 16 Jan 2009 10:53:20 +0000 (11:53 +0100)
modules/access/pvr.c
modules/codec/quicktime.c
modules/demux/avi/avi.c
modules/demux/avi/libavi.c
modules/misc/notify/growl.m
modules/video_output/opengllayer.m
src/misc/objects.c

index 737b73f61d6414446a1b23d91c3690d7b8b15fd9..291a82f4b54ec34270cbd5cdd7b82b17d3affe52 100644 (file)
@@ -433,8 +433,8 @@ static int ConfigureV4L2( access_t * p_access )
     controls.reserved[0] = 0;
     controls.reserved[1] = 0;
     controls.count       = 0;
-    controls.controls    = calloc( sizeof( struct v4l2_ext_control ),
-                                   MAX_V4L2_CTRLS );
+    controls.controls    = calloc( MAX_V4L2_CTRLS,
+                                   sizeof( struct v4l2_ext_control ) );
 
     if( controls.controls == NULL )
         return VLC_ENOMEM;
index 508d1167ef343740cc18d04a499853ee1b4cece9..b9ef7aea4033531aa087918db6d648dd2abcc1ed 100644 (file)
@@ -397,7 +397,7 @@ static int OpenAudio( decoder_t *p_dec )
     /* get lock, avoid segfault */
     vlc_mutex_lock( &qt_mutex );
 
-    p_sys = calloc( sizeof( decoder_sys_t ), 1 );
+    p_sys = calloc( 1, sizeof( decoder_sys_t ) );
     p_dec->p_sys = p_sys;
     p_dec->pf_decode_audio = DecodeAudio;
 
index 3321cdffe04024e8c065de7dab8f9ccf6a72a7ba..7d398e8550f960377fe8647463b244e897b03ad7 100644 (file)
@@ -584,7 +584,7 @@ static int Open( vlc_object_t * p_this )
                     {
                         const uint8_t *p_pal = fmt.p_extra;
 
-                        fmt.video.p_palette = calloc( sizeof(video_palette_t), 1 );
+                        fmt.video.p_palette = calloc( 1, sizeof(video_palette_t) );
                         fmt.video.p_palette->i_entries = __MIN(fmt.i_extra/4, 256);
 
                         for( int i = 0; i < fmt.video.p_palette->i_entries; i++ )
index 2f03219c021f8110658d63bd5be4b3e539ddb176..ad65ecb9decf50529d11d20495654ec5bef12dad 100644 (file)
@@ -513,7 +513,7 @@ static int AVI_ChunkRead_indx( stream_t *s, avi_chunk_t *p_chk )
 
         i_count = __MIN( p_indx->i_entriesinuse, i_read / 8 );
         p_indx->i_entriesinuse = i_count;
-        p_indx->idx.std = calloc( sizeof( indx_std_entry_t ), i_count );
+        p_indx->idx.std = calloc( i_count, sizeof( indx_std_entry_t ) );
 
         for( i = 0; i < i_count; i++ )
         {
@@ -528,7 +528,7 @@ static int AVI_ChunkRead_indx( stream_t *s, avi_chunk_t *p_chk )
 
         i_count = __MIN( p_indx->i_entriesinuse, i_read / 12 );
         p_indx->i_entriesinuse = i_count;
-        p_indx->idx.field = calloc( sizeof( indx_field_entry_t ), i_count );
+        p_indx->idx.field = calloc( i_count, sizeof( indx_field_entry_t ) );
         for( i = 0; i < i_count; i++ )
         {
             AVI_READ4BYTES( p_indx->idx.field[i].i_offset );
@@ -545,7 +545,7 @@ static int AVI_ChunkRead_indx( stream_t *s, avi_chunk_t *p_chk )
 
         i_count = __MIN( p_indx->i_entriesinuse, i_read / 16 );
         p_indx->i_entriesinuse = i_count;
-        p_indx->idx.super = calloc( sizeof( indx_super_entry_t ), i_count );
+        p_indx->idx.super = calloc( i_count, sizeof( indx_super_entry_t ) );
 
         for( i = 0; i < i_count; i++ )
         {
index 157ceee4e1b25b0a505d9d961e9b3748a54f8cdd..32abcb58f79fba9123775ceea327b0e6947688fb 100644 (file)
@@ -106,7 +106,7 @@ static int Open( vlc_object_t *p_this )
     intf_thread_t *p_intf = (intf_thread_t *)p_this;
     intf_sys_t    *p_sys;
 
-    p_sys = p_intf->p_sys = calloc( sizeof(intf_sys_t), 1);
+    p_sys = p_intf->p_sys = calloc( 1, sizeof(intf_sys_t) );
     if( !p_sys )
         return VLC_ENOMEM;
 
index b59f6bb4967e357d3387848319b5f6614d6d6d6f..8536cd015524389dbf4b936e9b40475abfdf699d 100644 (file)
@@ -140,7 +140,7 @@ static int CreateVout( vlc_object_t *p_this )
     char * psz;
 
     /* Allocate structure */
-    p_vout->p_sys = p_sys = calloc( sizeof( vout_sys_t ), 1 );
+    p_vout->p_sys = p_sys = calloc( 1, sizeof( vout_sys_t ) );
     if( p_sys == NULL )
         return VLC_EGENERIC;
 
index 36aeb7631edf753bff37127b9ca2dfb6234d8190..5f90d9942c17efcb0861c76d4be4c1f7b703b77d 100644 (file)
@@ -141,7 +141,7 @@ void *__vlc_custom_create( vlc_object_t *p_this, size_t i_size,
         p_new->i_flags = p_this->i_flags
             & (OBJECT_FLAGS_NODBG|OBJECT_FLAGS_QUIET|OBJECT_FLAGS_NOINTERACT);
 
-    p_priv->p_vars = calloc( sizeof( variable_t ), 16 );
+    p_priv->p_vars = calloc( 16, sizeof( variable_t ) );
 
     if( !p_priv->p_vars )
     {