summaryrefslogtreecommitdiff
path: root/exa/exa_accel.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-03-21 14:40:39 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-04-21 16:58:07 -0700
commit70f4a0e6bd18055cc9cb6685253bf5e07b125657 (patch)
tree5b398a4e03c7f3d23cd4ad72bdf0b281516bcbb8 /exa/exa_accel.c
parent4fe6b03b97ab8dbb32e4908e46be350d7f7d336f (diff)
Convert exa & fb to new *allocarray functions
v2: fixup whitespace Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'exa/exa_accel.c')
-rw-r--r--exa/exa_accel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index 5aa7d1078..b26d5c804 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -386,7 +386,7 @@ exaHWCopyNtoN(DrawablePtr pSrcDrawable,
exaGetDrawableDeltas(pSrcDrawable, pSrcPixmap, &src_off_x, &src_off_y);
exaGetDrawableDeltas(pDstDrawable, pDstPixmap, &dst_off_x, &dst_off_y);
- rects = malloc(nbox * sizeof(xRectangle));
+ rects = xallocarray(nbox, sizeof(xRectangle));
if (rects) {
int i;
@@ -626,7 +626,7 @@ exaPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
return;
}
- prect = malloc(sizeof(xRectangle) * npt);
+ prect = xallocarray(npt, sizeof(xRectangle));
for (i = 0; i < npt; i++) {
prect[i].x = ppt[i].x;
prect[i].y = ppt[i].y;
@@ -667,7 +667,7 @@ exaPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
return;
}
- prect = malloc(sizeof(xRectangle) * (npt - 1));
+ prect = xallocarray(npt - 1, sizeof(xRectangle));
x1 = ppt[0].x;
y1 = ppt[0].y;
/* If we have any non-horizontal/vertical, fall back. */
@@ -738,7 +738,7 @@ exaPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg)
}
}
- prect = malloc(sizeof(xRectangle) * nseg);
+ prect = xallocarray(nseg, sizeof(xRectangle));
for (i = 0; i < nseg; i++) {
if (pSeg[i].x1 < pSeg[i].x2) {
prect[i].x = pSeg[i].x1;