From 830202089a59519a23009370325823c1a34e1e60 Mon Sep 17 00:00:00 2001 From: Mikko Rapeli Date: Wed, 25 Jul 2012 17:15:49 +0200 Subject: [PATCH] Fix calloc() parameter ordering First parameter to calloc() is the count and second the amount of bytes for each item. Likely this has no run time effect since the resulting buffer size is the same. --- src/framework/mlt_field.c | 4 ++-- src/framework/mlt_frame.c | 2 +- src/framework/mlt_multitrack.c | 2 +- src/framework/mlt_playlist.c | 4 ++-- src/framework/mlt_properties.c | 4 ++-- src/framework/mlt_repository.c | 2 +- src/framework/mlt_service.c | 2 +- src/framework/mlt_tractor.c | 4 ++-- src/modules/core/filter_audioconvert.c | 2 +- src/modules/core/filter_crop.c | 2 +- src/modules/core/filter_imageconvert.c | 2 +- src/modules/core/filter_panner.c | 2 +- src/modules/core/filter_resize.c | 2 +- src/modules/core/producer_ppm.c | 2 +- src/modules/core/transition_composite.c | 2 +- src/modules/core/transition_mix.c | 2 +- src/modules/dv/producer_libdv.c | 2 +- src/modules/gtk2/producer_pango.c | 2 +- src/modules/gtk2/producer_pixbuf.c | 2 +- src/modules/kino/producer_kino.c | 2 +- src/modules/linsys/consumer_SDIstream.c | 2 +- src/modules/normalize/filter_volume.c | 2 +- src/modules/qimage/producer_kdenlivetitle.c | 2 +- src/modules/qimage/producer_qimage.c | 2 +- src/modules/rtaudio/RtAudio.cpp | 24 ++++++++++----------- src/modules/sdl/consumer_sdl.c | 2 +- src/modules/sdl/consumer_sdl_audio.c | 2 +- src/modules/sdl/consumer_sdl_preview.c | 2 +- src/modules/sdl/consumer_sdl_still.c | 2 +- src/modules/xml/consumer_xml.c | 2 +- src/modules/xml/producer_xml.c | 4 ++-- 31 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/framework/mlt_field.c b/src/framework/mlt_field.c index 6dc82280..95c92b96 100644 --- a/src/framework/mlt_field.c +++ b/src/framework/mlt_field.c @@ -57,7 +57,7 @@ struct mlt_field_s mlt_field mlt_field_init( ) { // Initialise the field - mlt_field self = calloc( sizeof( struct mlt_field_s ), 1 ); + mlt_field self = calloc( 1, sizeof( struct mlt_field_s ) ); // Initialise it if ( self != NULL ) @@ -90,7 +90,7 @@ mlt_field mlt_field_init( ) mlt_field mlt_field_new( mlt_multitrack multitrack, mlt_tractor tractor ) { // Initialise the field - mlt_field self = calloc( sizeof( struct mlt_field_s ), 1 ); + mlt_field self = calloc( 1, sizeof( struct mlt_field_s ) ); // Initialise it if ( self != NULL ) diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index d1e03736..c05aebb1 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -41,7 +41,7 @@ mlt_frame mlt_frame_init( mlt_service service ) { // Allocate a frame - mlt_frame self = calloc( sizeof( struct mlt_frame_s ), 1 ); + mlt_frame self = calloc( 1, sizeof( struct mlt_frame_s ) ); if ( self != NULL ) { diff --git a/src/framework/mlt_multitrack.c b/src/framework/mlt_multitrack.c index 8fcef9b9..46309072 100644 --- a/src/framework/mlt_multitrack.c +++ b/src/framework/mlt_multitrack.c @@ -43,7 +43,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i mlt_multitrack mlt_multitrack_init( ) { // Allocate the multitrack object - mlt_multitrack self = calloc( sizeof( struct mlt_multitrack_s ), 1 ); + mlt_multitrack self = calloc( 1, sizeof( struct mlt_multitrack_s ) ); if ( self != NULL ) { diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index 92d23382..79fbd8bf 100644 --- a/src/framework/mlt_playlist.c +++ b/src/framework/mlt_playlist.c @@ -64,7 +64,7 @@ static int mlt_playlist_resize_mix( mlt_playlist self, int clip, int in, int out mlt_playlist mlt_playlist_init( ) { - mlt_playlist self = calloc( sizeof( struct mlt_playlist_s ), 1 ); + mlt_playlist self = calloc( 1, sizeof( struct mlt_playlist_s ) ); if ( self != NULL ) { mlt_producer producer = &self->parent; @@ -336,7 +336,7 @@ static int mlt_playlist_virtual_append( mlt_playlist self, mlt_producer source, } // Create the entry - self->list[ self->count ] = calloc( sizeof( playlist_entry ), 1 ); + self->list[ self->count ] = calloc( 1, sizeof( playlist_entry ) ); if ( self->list[ self->count ] != NULL ) { self->list[ self->count ]->producer = producer; diff --git a/src/framework/mlt_properties.c b/src/framework/mlt_properties.c index 6982ccaf..6d8ef08b 100644 --- a/src/framework/mlt_properties.c +++ b/src/framework/mlt_properties.c @@ -91,7 +91,7 @@ int mlt_properties_init( mlt_properties self, void *child ) self->child = child; // Allocate the local structure - self->local = calloc( sizeof( property_list ), 1 ); + self->local = calloc( 1, sizeof( property_list ) ); // Increment the ref count ( ( property_list * )self->local )->ref_count = 1; @@ -113,7 +113,7 @@ int mlt_properties_init( mlt_properties self, void *child ) mlt_properties mlt_properties_new( ) { // Construct a standalone properties object - mlt_properties self = calloc( sizeof( struct mlt_properties_s ), 1 ); + mlt_properties self = calloc( 1, sizeof( struct mlt_properties_s ) ); // Initialise self mlt_properties_init( self, NULL ); diff --git a/src/framework/mlt_repository.c b/src/framework/mlt_repository.c index acda89cc..e5e5e793 100644 --- a/src/framework/mlt_repository.c +++ b/src/framework/mlt_repository.c @@ -70,7 +70,7 @@ mlt_repository mlt_repository_init( const char *directory ) return NULL; // Construct the repository - mlt_repository self = calloc( sizeof( struct mlt_repository_s ), 1 ); + mlt_repository self = calloc( 1, sizeof( struct mlt_repository_s )); mlt_properties_init( &self->parent, self ); self->consumers = mlt_properties_new(); self->filters = mlt_properties_new(); diff --git a/src/framework/mlt_service.c b/src/framework/mlt_service.c index bfcc9134..7e66451e 100644 --- a/src/framework/mlt_service.c +++ b/src/framework/mlt_service.c @@ -87,7 +87,7 @@ int mlt_service_init( mlt_service self, void *child ) self->child = child; // Generate local space - self->local = calloc( sizeof( mlt_service_base ), 1 ); + self->local = calloc( 1, sizeof( mlt_service_base ) ); // Associate the methods self->get_frame = service_get_frame; diff --git a/src/framework/mlt_tractor.c b/src/framework/mlt_tractor.c index acd49ed8..b39b1949 100644 --- a/src/framework/mlt_tractor.c +++ b/src/framework/mlt_tractor.c @@ -49,7 +49,7 @@ static void mlt_tractor_listener( mlt_multitrack tracks, mlt_tractor self ); mlt_tractor mlt_tractor_init( ) { - mlt_tractor self = calloc( sizeof( struct mlt_tractor_s ), 1 ); + mlt_tractor self = calloc( 1, sizeof( struct mlt_tractor_s ) ); if ( self != NULL ) { mlt_producer producer = &self->parent; @@ -88,7 +88,7 @@ mlt_tractor mlt_tractor_init( ) mlt_tractor mlt_tractor_new( ) { - mlt_tractor self = calloc( sizeof( struct mlt_tractor_s ), 1 ); + mlt_tractor self = calloc( 1, sizeof( struct mlt_tractor_s ) ); if ( self != NULL ) { mlt_producer producer = &self->parent; diff --git a/src/modules/core/filter_audioconvert.c b/src/modules/core/filter_audioconvert.c index d1f7cb33..67b78ea6 100644 --- a/src/modules/core/filter_audioconvert.c +++ b/src/modules/core/filter_audioconvert.c @@ -419,7 +419,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) mlt_filter filter_audioconvert_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { - mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 ); + mlt_filter this = calloc( 1, sizeof( struct mlt_filter_s ) ); if ( mlt_filter_init( this, this ) == 0 ) this->process = filter_process; return this; diff --git a/src/modules/core/filter_crop.c b/src/modules/core/filter_crop.c index f8ba65ed..1969fdb1 100644 --- a/src/modules/core/filter_crop.c +++ b/src/modules/core/filter_crop.c @@ -225,7 +225,7 @@ static mlt_frame filter_process( mlt_filter filter, mlt_frame frame ) mlt_filter filter_crop_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { - mlt_filter filter = calloc( sizeof( struct mlt_filter_s ), 1 ); + mlt_filter filter = calloc( 1, sizeof( struct mlt_filter_s ) ); if ( mlt_filter_init( filter, filter ) == 0 ) { filter->process = filter_process; diff --git a/src/modules/core/filter_imageconvert.c b/src/modules/core/filter_imageconvert.c index 00161857..f651f172 100644 --- a/src/modules/core/filter_imageconvert.c +++ b/src/modules/core/filter_imageconvert.c @@ -381,7 +381,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) mlt_filter filter_imageconvert_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { - mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 ); + mlt_filter this = calloc( 1, sizeof( struct mlt_filter_s ) ); if ( mlt_filter_init( this, this ) == 0 ) { this->process = filter_process; diff --git a/src/modules/core/filter_panner.c b/src/modules/core/filter_panner.c index 6ce55d9c..88009b20 100644 --- a/src/modules/core/filter_panner.c +++ b/src/modules/core/filter_panner.c @@ -292,7 +292,7 @@ static mlt_frame filter_process( mlt_filter filter, mlt_frame frame ) mlt_filter filter_panner_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { - mlt_filter filter = calloc( sizeof( struct mlt_filter_s ), 1 ); + mlt_filter filter = calloc( 1, sizeof( struct mlt_filter_s ) ); if ( filter != NULL && mlt_filter_init( filter, NULL ) == 0 ) { filter->process = filter_process; diff --git a/src/modules/core/filter_resize.c b/src/modules/core/filter_resize.c index 17a6aa38..d3e4ca34 100644 --- a/src/modules/core/filter_resize.c +++ b/src/modules/core/filter_resize.c @@ -286,7 +286,7 @@ static mlt_frame filter_process( mlt_filter filter, mlt_frame frame ) mlt_filter filter_resize_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { - mlt_filter filter = calloc( sizeof( struct mlt_filter_s ), 1 ); + mlt_filter filter = calloc( 1, sizeof( struct mlt_filter_s ) ); if ( mlt_filter_init( filter, filter ) == 0 ) { filter->process = filter_process; diff --git a/src/modules/core/producer_ppm.c b/src/modules/core/producer_ppm.c index 929d6633..cda58c04 100644 --- a/src/modules/core/producer_ppm.c +++ b/src/modules/core/producer_ppm.c @@ -40,7 +40,7 @@ static void producer_close( mlt_producer parent ); mlt_producer producer_ppm_init( mlt_profile profile, mlt_service_type type, const char *id, char *command ) { - producer_ppm this = calloc( sizeof( struct producer_ppm_s ), 1 ); + producer_ppm this = calloc( 1, sizeof( struct producer_ppm_s ) ); if ( this != NULL && mlt_producer_init( &this->parent, this ) == 0 ) { mlt_producer producer = &this->parent; diff --git a/src/modules/core/transition_composite.c b/src/modules/core/transition_composite.c index 8aa8a616..49d01f5d 100644 --- a/src/modules/core/transition_composite.c +++ b/src/modules/core/transition_composite.c @@ -1327,7 +1327,7 @@ static mlt_frame composite_process( mlt_transition self, mlt_frame a_frame, mlt_ mlt_transition transition_composite_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { - mlt_transition self = calloc( sizeof( struct mlt_transition_s ), 1 ); + mlt_transition self = calloc( 1, sizeof( struct mlt_transition_s ) ); if ( self != NULL && mlt_transition_init( self, NULL ) == 0 ) { mlt_properties properties = MLT_TRANSITION_PROPERTIES( self ); diff --git a/src/modules/core/transition_mix.c b/src/modules/core/transition_mix.c index e2653663..d40a5041 100644 --- a/src/modules/core/transition_mix.c +++ b/src/modules/core/transition_mix.c @@ -295,7 +295,7 @@ static mlt_frame transition_process( mlt_transition this, mlt_frame a_frame, mlt mlt_transition transition_mix_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { - mlt_transition this = calloc( sizeof( struct mlt_transition_s ), 1 ); + mlt_transition this = calloc( 1, sizeof( struct mlt_transition_s ) ); if ( this != NULL && mlt_transition_init( this, NULL ) == 0 ) { this->process = transition_process; diff --git a/src/modules/dv/producer_libdv.c b/src/modules/dv/producer_libdv.c index cef5ef3c..f3f1ce4b 100644 --- a/src/modules/dv/producer_libdv.c +++ b/src/modules/dv/producer_libdv.c @@ -138,7 +138,7 @@ static int producer_collect_info( producer_libdv this, mlt_profile profile ); mlt_producer producer_libdv_init( mlt_profile profile, mlt_service_type type, const char *id, char *filename ) { - producer_libdv this = calloc( sizeof( struct producer_libdv_s ), 1 ); + producer_libdv this = calloc( 1, sizeof( struct producer_libdv_s ) ); if ( filename != NULL && this != NULL && mlt_producer_init( &this->parent, this ) == 0 ) { diff --git a/src/modules/gtk2/producer_pango.c b/src/modules/gtk2/producer_pango.c index 48399069..3322dd5b 100644 --- a/src/modules/gtk2/producer_pango.c +++ b/src/modules/gtk2/producer_pango.c @@ -123,7 +123,7 @@ static PangoFT2FontMap *fontmap = NULL; mlt_producer producer_pango_init( const char *filename ) { - producer_pango this = calloc( sizeof( struct producer_pango_s ), 1 ); + producer_pango this = calloc( 1, sizeof( struct producer_pango_s ) ); if ( this != NULL && mlt_producer_init( &this->parent, this ) == 0 ) { mlt_producer producer = &this->parent; diff --git a/src/modules/gtk2/producer_pixbuf.c b/src/modules/gtk2/producer_pixbuf.c index 48d2032e..d1e15eaf 100644 --- a/src/modules/gtk2/producer_pixbuf.c +++ b/src/modules/gtk2/producer_pixbuf.c @@ -73,7 +73,7 @@ static void producer_close( mlt_producer parent ); mlt_producer producer_pixbuf_init( char *filename ) { - producer_pixbuf self = calloc( sizeof( struct producer_pixbuf_s ), 1 ); + producer_pixbuf self = calloc( 1, sizeof( struct producer_pixbuf_s ) ); if ( self != NULL && mlt_producer_init( &self->parent, self ) == 0 ) { mlt_producer producer = &self->parent; diff --git a/src/modules/kino/producer_kino.c b/src/modules/kino/producer_kino.c index 7f94a9e7..6e0ef767 100644 --- a/src/modules/kino/producer_kino.c +++ b/src/modules/kino/producer_kino.c @@ -47,7 +47,7 @@ mlt_producer producer_kino_init( mlt_profile profile, mlt_service_type type, con if ( kino_wrapper_open( wrapper, filename ) ) { - producer_kino this = calloc( sizeof( struct producer_kino_s ), 1 ); + producer_kino this = calloc( 1, sizeof( struct producer_kino_s ) ); if ( this != NULL && mlt_producer_init( &this->parent, this ) == 0 ) { diff --git a/src/modules/linsys/consumer_SDIstream.c b/src/modules/linsys/consumer_SDIstream.c index ef4ac37f..fa77155d 100644 --- a/src/modules/linsys/consumer_SDIstream.c +++ b/src/modules/linsys/consumer_SDIstream.c @@ -211,7 +211,7 @@ int convertYCBCRtoRGB(int y1, int cb, int cr, int y2, uint8_t * target_rgb); mlt_consumer consumer_SDIstream_init(mlt_profile profile, mlt_service_type type, const char *id, char *arg) { // Create the consumer object - consumer_SDIstream this = calloc(sizeof(struct consumer_SDIstream_s), 1); + consumer_SDIstream this = calloc( 1, sizeof(struct consumer_SDIstream_s) ); // If malloc and consumer init ok if (this != NULL && mlt_consumer_init(&this->parent, this, profile) == 0) { diff --git a/src/modules/normalize/filter_volume.c b/src/modules/normalize/filter_volume.c index 2b294cbe..8b0ccd60 100644 --- a/src/modules/normalize/filter_volume.c +++ b/src/modules/normalize/filter_volume.c @@ -445,7 +445,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) mlt_filter filter_volume_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { - mlt_filter this = calloc( sizeof( struct mlt_filter_s ), 1 ); + mlt_filter this = calloc( 1, sizeof( struct mlt_filter_s ) ); if ( this != NULL && mlt_filter_init( this, NULL ) == 0 ) { mlt_properties properties = MLT_FILTER_PROPERTIES( this ); diff --git a/src/modules/qimage/producer_kdenlivetitle.c b/src/modules/qimage/producer_kdenlivetitle.c index 5c37d3a3..693538be 100644 --- a/src/modules/qimage/producer_kdenlivetitle.c +++ b/src/modules/qimage/producer_kdenlivetitle.c @@ -147,7 +147,7 @@ mlt_producer producer_kdenlivetitle_init( mlt_profile profile, mlt_service_type /* fprintf(stderr, ":::::::::::: CREATE TITLE\n"); */ /* Create a new producer object */ - producer_ktitle this = calloc( sizeof( struct producer_ktitle_s ), 1 ); + producer_ktitle this = calloc( 1, sizeof( struct producer_ktitle_s ) ); if ( this != NULL && mlt_producer_init( &this->parent, this ) == 0 ) { mlt_producer producer = &this->parent; diff --git a/src/modules/qimage/producer_qimage.c b/src/modules/qimage/producer_qimage.c index 3896d118..76b96893 100644 --- a/src/modules/qimage/producer_qimage.c +++ b/src/modules/qimage/producer_qimage.c @@ -40,7 +40,7 @@ static void producer_close( mlt_producer parent ); mlt_producer producer_qimage_init( mlt_profile profile, mlt_service_type type, const char *id, char *filename ) { - producer_qimage self = calloc( sizeof( struct producer_qimage_s ), 1 ); + producer_qimage self = calloc( 1, sizeof( struct producer_qimage_s ) ); if ( self != NULL && mlt_producer_init( &self->parent, self ) == 0 ) { mlt_producer producer = &self->parent; diff --git a/src/modules/rtaudio/RtAudio.cpp b/src/modules/rtaudio/RtAudio.cpp index 2bdd89b9..249fa256 100644 --- a/src/modules/rtaudio/RtAudio.cpp +++ b/src/modules/rtaudio/RtAudio.cpp @@ -1193,7 +1193,7 @@ bool RtApiCore :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne // Allocate necessary internal buffers. unsigned long bufferBytes; bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); - // stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); + // stream_.userBuffer[mode] = (char *) calloc( 1, bufferBytes ); stream_.userBuffer[mode] = (char *) malloc( bufferBytes * sizeof(char) ); memset( stream_.userBuffer[mode], 0, bufferBytes * sizeof(char) ); if ( stream_.userBuffer[mode] == NULL ) { @@ -1218,7 +1218,7 @@ bool RtApiCore :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); - stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); + stream_.deviceBuffer = (char *) calloc( 1, bufferBytes ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiCore::probeDeviceOpen: error allocating device buffer memory."; goto error; @@ -2124,7 +2124,7 @@ bool RtApiJack :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne // Allocate necessary internal buffers. unsigned long bufferBytes; bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); - stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); + stream_.userBuffer[mode] = (char *) calloc( 1, bufferBytes ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiJack::probeDeviceOpen: error allocating user buffer memory."; goto error; @@ -2146,7 +2146,7 @@ bool RtApiJack :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); - stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); + stream_.deviceBuffer = (char *) calloc( 1, bufferBytes ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiJack::probeDeviceOpen: error allocating device buffer memory."; goto error; @@ -2999,7 +2999,7 @@ bool RtApiAsio :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne // Allocate necessary internal buffers unsigned long bufferBytes; bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); - stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); + stream_.userBuffer[mode] = (char *) calloc( 1, bufferBytes ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiAsio::probeDeviceOpen: error allocating user buffer memory."; goto error; @@ -3019,7 +3019,7 @@ bool RtApiAsio :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); - stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); + stream_.deviceBuffer = (char *) calloc( 1, bufferBytes ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiAsio::probeDeviceOpen: error allocating device buffer memory."; goto error; @@ -4216,7 +4216,7 @@ bool RtApiDs :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned // Allocate necessary internal buffers long bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); - stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); + stream_.userBuffer[mode] = (char *) calloc( 1, bufferBytes ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiDs::probeDeviceOpen: error allocating user buffer memory."; goto error; @@ -4236,7 +4236,7 @@ bool RtApiDs :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); - stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); + stream_.deviceBuffer = (char *) calloc( 1, bufferBytes ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiDs::probeDeviceOpen: error allocating device buffer memory."; goto error; @@ -5848,7 +5848,7 @@ bool RtApiAlsa :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne // Allocate necessary internal buffers. unsigned long bufferBytes; bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); - stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); + stream_.userBuffer[mode] = (char *) calloc( 1, bufferBytes ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiAlsa::probeDeviceOpen: error allocating user buffer memory."; goto error; @@ -5868,7 +5868,7 @@ bool RtApiAlsa :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); - stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); + stream_.deviceBuffer = (char *) calloc( 1, bufferBytes ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiAlsa::probeDeviceOpen: error allocating device buffer memory."; goto error; @@ -6858,7 +6858,7 @@ bool RtApiOss :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned // Allocate necessary internal buffers. unsigned long bufferBytes; bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); - stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); + stream_.userBuffer[mode] = (char *) calloc( 1, bufferBytes ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiOss::probeDeviceOpen: error allocating user buffer memory."; goto error; @@ -6878,7 +6878,7 @@ bool RtApiOss :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned if ( makeBuffer ) { bufferBytes *= *bufferSize; if ( stream_.deviceBuffer ) free( stream_.deviceBuffer ); - stream_.deviceBuffer = (char *) calloc( bufferBytes, 1 ); + stream_.deviceBuffer = (char *) calloc( 1, bufferBytes ); if ( stream_.deviceBuffer == NULL ) { errorText_ = "RtApiOss::probeDeviceOpen: error allocating device buffer memory."; goto error; diff --git a/src/modules/sdl/consumer_sdl.c b/src/modules/sdl/consumer_sdl.c index 1f8b9ce4..4c9489cb 100644 --- a/src/modules/sdl/consumer_sdl.c +++ b/src/modules/sdl/consumer_sdl.c @@ -87,7 +87,7 @@ static void consumer_sdl_event( mlt_listener listener, mlt_properties owner, mlt mlt_consumer consumer_sdl_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { // Create the consumer object - consumer_sdl this = calloc( sizeof( struct consumer_sdl_s ), 1 ); + consumer_sdl this = calloc( 1, sizeof( struct consumer_sdl_s ) ); // If no malloc'd and consumer init ok if ( this != NULL && mlt_consumer_init( &this->parent, this, profile ) == 0 ) diff --git a/src/modules/sdl/consumer_sdl_audio.c b/src/modules/sdl/consumer_sdl_audio.c index 266580e3..8db5fe2c 100644 --- a/src/modules/sdl/consumer_sdl_audio.c +++ b/src/modules/sdl/consumer_sdl_audio.c @@ -76,7 +76,7 @@ static void consumer_refresh_cb( mlt_consumer sdl, mlt_consumer self, char *name mlt_consumer consumer_sdl_audio_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { // Create the consumer object - consumer_sdl self = calloc( sizeof( struct consumer_sdl_s ), 1 ); + consumer_sdl self = calloc( 1, sizeof( struct consumer_sdl_s ) ); // If no malloc'd and consumer init ok if ( self != NULL && mlt_consumer_init( &self->parent, self, profile ) == 0 ) diff --git a/src/modules/sdl/consumer_sdl_preview.c b/src/modules/sdl/consumer_sdl_preview.c index bd5fe366..7a9b44fb 100644 --- a/src/modules/sdl/consumer_sdl_preview.c +++ b/src/modules/sdl/consumer_sdl_preview.c @@ -67,7 +67,7 @@ static void consumer_refresh_cb( mlt_consumer sdl, mlt_consumer this, char *name mlt_consumer consumer_sdl_preview_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { - consumer_sdl this = calloc( sizeof( struct consumer_sdl_s ), 1 ); + consumer_sdl this = calloc( 1, sizeof( struct consumer_sdl_s ) ); if ( this != NULL && mlt_consumer_init( &this->parent, this, profile ) == 0 ) { // Get the parent consumer object diff --git a/src/modules/sdl/consumer_sdl_still.c b/src/modules/sdl/consumer_sdl_still.c index 1ef82b87..2b5ee6a6 100644 --- a/src/modules/sdl/consumer_sdl_still.c +++ b/src/modules/sdl/consumer_sdl_still.c @@ -78,7 +78,7 @@ static void consumer_sdl_event( mlt_listener listener, mlt_properties owner, mlt mlt_consumer consumer_sdl_still_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { // Create the consumer object - consumer_sdl this = calloc( sizeof( struct consumer_sdl_s ), 1 ); + consumer_sdl this = calloc( 1, sizeof( struct consumer_sdl_s ) ); // If no malloc'd and consumer init ok if ( this != NULL && mlt_consumer_init( &this->parent, this, profile ) == 0 ) diff --git a/src/modules/xml/consumer_xml.c b/src/modules/xml/consumer_xml.c index 8ed27204..883ee7de 100644 --- a/src/modules/xml/consumer_xml.c +++ b/src/modules/xml/consumer_xml.c @@ -186,7 +186,7 @@ static char *xml_get_id( serialise_context context, mlt_service service, xml_typ mlt_consumer consumer_xml_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { // Create the consumer object - mlt_consumer this = calloc( sizeof( struct mlt_consumer_s ), 1 ); + mlt_consumer this = calloc( 1, sizeof( struct mlt_consumer_s ) ); // If no malloc'd and consumer init ok if ( this != NULL && mlt_consumer_init( this, NULL, profile ) == 0 ) diff --git a/src/modules/xml/producer_xml.c b/src/modules/xml/producer_xml.c index c2d41b2c..646d6a2c 100644 --- a/src/modules/xml/producer_xml.c +++ b/src/modules/xml/producer_xml.c @@ -1301,7 +1301,7 @@ static void on_characters( void *ctx, const xmlChar *ch, int len ) { struct _xmlParserCtxt *xmlcontext = ( struct _xmlParserCtxt* )ctx; deserialise_context context = ( deserialise_context )( xmlcontext->_private ); - char *value = calloc( len + 1, 1 ); + char *value = calloc( 1, len + 1 ); enum service_type type; mlt_service service = context_pop_service( context, &type ); mlt_properties properties = MLT_SERVICE_PROPERTIES( service ); @@ -1324,7 +1324,7 @@ static void on_characters( void *ctx, const xmlChar *ch, int len ) if ( s != NULL ) { // Append new text to existing content - char *new = calloc( strlen( s ) + len + 1, 1 ); + char *new = calloc( 1, strlen( s ) + len + 1 ); strcat( new, s ); strcat( new, value ); mlt_properties_set( properties, context->property, new ); -- 2.39.2