summaryrefslogtreecommitdiff
path: root/src/savage_driver.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-07-14 13:40:43 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-07-14 13:47:47 -0700
commit09f6c06f0a793c7d297f152227b551c128f20875 (patch)
tree46c2e97e14796680600e702f539bc2e4b2e906cf /src/savage_driver.c
parentb5bf275d66a00b2737ef1b099060c597ebca7d67 (diff)
Move sizeof to second argument in calloc callsHEADmaster
Clears -Wcalloc-transposed-args warnings from gcc 14.1, such as: savage_dri.c: In function ‘SAVAGEDRIScreenInit’: savage_dri.c:732:46: warning: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args] 732 | pSAVAGEDRI = (SAVAGEDRIPtr)calloc( sizeof(SAVAGEDRIRec), 1 ); | ^~~~~~~~~~~~ savage_dri.c:732:46: note: earlier argument should specify number of elements, later size of each element Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-savage/-/merge_requests/13>
Diffstat (limited to 'src/savage_driver.c')
-rw-r--r--src/savage_driver.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/savage_driver.c b/src/savage_driver.c
index bd26a8d..0621c99 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -635,7 +635,7 @@ static Bool SavageGetRec(ScrnInfoPtr pScrn)
if (pScrn->driverPrivate)
return TRUE;
- pScrn->driverPrivate = XNFcallocarray(sizeof(SavageRec), 1);
+ pScrn->driverPrivate = XNFcallocarray(1, sizeof(SavageRec));
return TRUE;
}
@@ -726,7 +726,7 @@ static Bool SavagePciProbe(DriverPtr drv, int entity_num,
for (j = 0; j < instance; j++)
xf86SetEntityInstanceForScreen(pScrn, pEnt->index, j);
- pPriv->ptr = XNFcallocarray(sizeof(SavageEntRec), 1);
+ pPriv->ptr = XNFcallocarray(1, sizeof(SavageEntRec));
pSavageEnt = pPriv->ptr;
pSavageEnt->HasSecondary = FALSE;
} else {
@@ -836,7 +836,7 @@ static Bool SavageProbe(DriverPtr drv, int flags)
for (j = 0; j < instance; j++)
xf86SetEntityInstanceForScreen(pScrn, pEnt->index, j);
- pPriv->ptr = XNFcallocarray(sizeof(SavageEntRec), 1);
+ pPriv->ptr = XNFcallocarray(1, sizeof(SavageEntRec));
pSavageEnt = pPriv->ptr;
pSavageEnt->HasSecondary = FALSE;
} else {