summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMart Raudsepp <leio@gentoo.org>2011-03-12 22:17:19 +0200
committerMart Raudsepp <leio@gentoo.org>2011-03-12 22:20:38 +0200
commit4fd7500bb16b80ea9aee8dc61c5b11e9deb8281f (patch)
tree4722be43f58af87e8c9ad1f6af6cd10b896ea4ae
parent1a23956758d17a8b4c1d8acebf8acc94358c37b9 (diff)
Fix parameter ordering for calloc/xnfcalloc calls
First argument is the number of elements and second the size of one element, not vice-versa. Signed-off-by: Mart Raudsepp <leio@gentoo.org>
-rw-r--r--src/gx_driver.c14
-rw-r--r--src/gx_randr.c2
-rw-r--r--src/lx_display.c2
-rw-r--r--src/lx_driver.c4
4 files changed, 11 insertions, 11 deletions
diff --git a/src/gx_driver.c b/src/gx_driver.c
index e2ed44b..47c20d2 100644
--- a/src/gx_driver.c
+++ b/src/gx_driver.c
@@ -426,7 +426,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
return FALSE;
#endif
- pGeode = pScrni->driverPrivate = xnfcalloc(sizeof(GeodeRec), 1);
+ pGeode = pScrni->driverPrivate = xnfcalloc(1, sizeof(GeodeRec));
if (pGeode == NULL)
return FALSE;
@@ -447,7 +447,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
pGeode->useVGA = FALSE;
#if INT10_SUPPORT
- pGeode->vesa = calloc(sizeof(VESARec), 1);
+ pGeode->vesa = calloc(1, sizeof(VESARec));
#endif
}
@@ -649,7 +649,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
else
pScrni->videoRam = pGeode->pEnt->device->videoRam;
- GeodeClockRange = (ClockRangePtr) xnfcalloc(sizeof(ClockRange), 1);
+ GeodeClockRange = (ClockRangePtr) xnfcalloc(1, sizeof(ClockRange));
GeodeClockRange->next = NULL;
GeodeClockRange->minClock = 25175;
GeodeClockRange->maxClock = 229500;
@@ -1259,11 +1259,11 @@ GXScreenInit(int scrnIndex, ScreenPtr pScrn, int argc, char **argv)
}
} else {
pGeode->AccelImageWriteBuffers =
- calloc(sizeof(pGeode->AccelImageWriteBuffers[0]),
- pGeode->NoOfImgBuffers);
+ calloc(pGeode->NoOfImgBuffers,
+ sizeof(pGeode->AccelImageWriteBuffers[0]));
pGeode->AccelColorExpandBuffers =
- calloc(sizeof(pGeode->AccelColorExpandBuffers[0]),
- pGeode->NoOfColorExpandLines);
+ calloc(pGeode->NoOfColorExpandLines,
+ sizeof(pGeode->AccelColorExpandBuffers[0]));
}
}
diff --git a/src/gx_randr.c b/src/gx_randr.c
index 345eaa5..116678d 100644
--- a/src/gx_randr.c
+++ b/src/gx_randr.c
@@ -351,7 +351,7 @@ GXRandRInit(ScreenPtr pScreen, int rotation)
return FALSE;
#endif
- pRandr = calloc(sizeof(XF86RandRInfoRec), 1);
+ pRandr = calloc(1, sizeof(XF86RandRInfoRec));
if (pRandr == NULL)
return FALSE;
diff --git a/src/lx_display.c b/src/lx_display.c
index ca6fed1..1f240f5 100644
--- a/src/lx_display.c
+++ b/src/lx_display.c
@@ -577,7 +577,7 @@ LXSetupCrtc(ScrnInfoPtr pScrni)
return;
}
- lxpriv = xnfcalloc(sizeof(LXCrtcPrivateRec), 1);
+ lxpriv = xnfcalloc(1, sizeof(LXCrtcPrivateRec));
if (!lxpriv) {
xf86CrtcDestroy(crtc);
diff --git a/src/lx_driver.c b/src/lx_driver.c
index 477939d..a17854c 100644
--- a/src/lx_driver.c
+++ b/src/lx_driver.c
@@ -300,7 +300,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
return TRUE;
}
- pGeode = pScrni->driverPrivate = xnfcalloc(sizeof(GeodeRec), 1);
+ pGeode = pScrni->driverPrivate = xnfcalloc(1, sizeof(GeodeRec));
if (pGeode == NULL)
return FALSE;
@@ -313,7 +313,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
if (!xf86LoadSubModule(pScrni, "vgahw") || !vgaHWGetHWRec(pScrni))
pGeode->useVGA = FALSE;
- pGeode->vesa = calloc(sizeof(VESARec), 1);
+ pGeode->vesa = calloc(1, sizeof(VESARec));
}
cim_rdmsr = LXReadMSR;