From 3279df42ed7231d2ed6d2328c66c1e080ad49f39 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 14 Jul 2024 13:22:13 -0700 Subject: Fix 2 -Wcalloc-transposed-args warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From gcc 14.1: mga_dri.c: In function ‘MGADRIScreenInit’: mga_dri.c:757:40: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args] 757 | pMGADRI = (MGADRIPtr)calloc( sizeof(MGADRIRec), 1 ); | ^~~~~~~~~ mga_dri.c:757:40: note: earlier argument should specify number of elements, later size of each element mga_dri.c:767:22: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args] 767 | calloc( sizeof(MGADRIServerPrivateRec), 1 ); | ^~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith Part-of: --- src/mga_dri.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mga_dri.c b/src/mga_dri.c index 4222d53..1fb818f 100644 --- a/src/mga_dri.c +++ b/src/mga_dri.c @@ -754,7 +754,7 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) pDRIInfo->SAREASize = SAREA_MAX; - pMGADRI = (MGADRIPtr)calloc( sizeof(MGADRIRec), 1 ); + pMGADRI = (MGADRIPtr)calloc( 1, sizeof(MGADRIRec) ); if ( !pMGADRI ) { DRIDestroyInfoRec( pMga->pDRIInfo ); pMga->pDRIInfo = 0; @@ -764,7 +764,7 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) } pMGADRIServer = (MGADRIServerPrivatePtr) - calloc( sizeof(MGADRIServerPrivateRec), 1 ); + calloc( 1, sizeof(MGADRIServerPrivateRec) ); if ( !pMGADRIServer ) { free( pMGADRI ); DRIDestroyInfoRec( pMga->pDRIInfo ); -- cgit v1.2.3