xf86-video-r128: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jul 20 22:30:28 UTC 2024


 src/r128_crtc.c   |    4 ++--
 src/r128_dri.c    |    2 +-
 src/r128_driver.c |    2 +-
 src/r128_output.c |    2 +-
 src/r128_probe.c  |    2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 0ee4ec6947cf9a9bb3fde60ed7b261f40e28e30d
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Sun Jul 14 13:32:15 2024 -0700

    Move sizeof to second argument in calloc calls
    
    Clears -Wcalloc-transposed-args warnings from gcc 14.1, such as:
    
    r128_dri.c: In function ‘R128DRIScreenInit’:
    r128_dri.c:822:48: warning: ‘calloc’ sizes specified with ‘sizeof’ in the
     earlier argument and not in the later argument [-Wcalloc-transposed-args]
      822 |     if (!(pR128DRI = (R128DRIPtr)calloc(sizeof(R128DRIRec),1))) {
          |                                                ^~~~~~~~~~
    r128_dri.c:822:48: note: earlier argument should specify number of elements,
     later size of each element
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-r128/-/merge_requests/13>

diff --git a/src/r128_crtc.c b/src/r128_crtc.c
index b72e534..d3d192c 100644
--- a/src/r128_crtc.c
+++ b/src/r128_crtc.c
@@ -1084,7 +1084,7 @@ Bool R128AllocateControllers(ScrnInfoPtr pScrn)
     if (!pR128Ent->pCrtc[0])
         return FALSE;
 
-    pR128Ent->Controller[0] = XNFcallocarray(sizeof(R128CrtcPrivateRec), 1);
+    pR128Ent->Controller[0] = XNFcallocarray(1, sizeof(R128CrtcPrivateRec));
     if (!pR128Ent->Controller[0])
         return FALSE;
 
@@ -1098,7 +1098,7 @@ Bool R128AllocateControllers(ScrnInfoPtr pScrn)
     if (!pR128Ent->pCrtc[1])
         return FALSE;
 
-    pR128Ent->Controller[1] = XNFcallocarray(sizeof(R128CrtcPrivateRec), 1);
+    pR128Ent->Controller[1] = XNFcallocarray(1, sizeof(R128CrtcPrivateRec));
     if (!pR128Ent->Controller[1]) {
         free(pR128Ent->Controller[0]);
         return FALSE;
diff --git a/src/r128_dri.c b/src/r128_dri.c
index b801b50..560ef33 100644
--- a/src/r128_dri.c
+++ b/src/r128_dri.c
@@ -819,7 +819,7 @@ Bool R128DRIScreenInit(ScreenPtr pScreen)
     pDRIInfo->SAREASize = SAREA_MAX;
 #endif
 
-    if (!(pR128DRI = (R128DRIPtr)calloc(sizeof(R128DRIRec),1))) {
+    if (!(pR128DRI = (R128DRIPtr)calloc(1, sizeof(R128DRIRec)))) {
 	DRIDestroyInfoRec(info->pDRIInfo);
 	info->pDRIInfo = NULL;
 	return FALSE;
diff --git a/src/r128_driver.c b/src/r128_driver.c
index da8aa86..fc42bfa 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -204,7 +204,7 @@ static Bool R128GetRec(ScrnInfoPtr pScrn)
 {
     if (pScrn->driverPrivate) return TRUE;
 
-    pScrn->driverPrivate = XNFcallocarray(sizeof(R128InfoRec), 1);
+    pScrn->driverPrivate = XNFcallocarray(1, sizeof(R128InfoRec));
     return TRUE;
 }
 
diff --git a/src/r128_output.c b/src/r128_output.c
index bc99e20..6543971 100644
--- a/src/r128_output.c
+++ b/src/r128_output.c
@@ -540,7 +540,7 @@ Bool R128SetupConnectors(ScrnInfoPtr pScrn)
         R128I2CBusRec i2c;
         R128OutputPrivatePtr r128_output;
 
-        r128_output = XNFcallocarray(sizeof(R128OutputPrivateRec), 1);
+        r128_output = XNFcallocarray(1, sizeof(R128OutputPrivateRec));
         if (!r128_output) return FALSE;
 
         r128_output->MonType = MT_UNKNOWN;
diff --git a/src/r128_probe.c b/src/r128_probe.c
index a86a27e..e1a5a9f 100644
--- a/src/r128_probe.c
+++ b/src/r128_probe.c
@@ -265,7 +265,7 @@ r128_get_scrninfo(int entity_num)
 
         if (!pPriv->ptr) {
             R128EntPtr pR128Ent;
-            pPriv->ptr = XNFcallocarray(sizeof(R128EntRec), 1);
+            pPriv->ptr = XNFcallocarray(1, sizeof(R128EntRec));
             pR128Ent = pPriv->ptr;
             pR128Ent->HasSecondary = FALSE;
             pR128Ent->IsSecondaryRestored = FALSE;


More information about the xorg-commit mailing list