From 7ac280287491fe06127d9fefc504217e21c780e6 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 21 Mar 2015 14:58:50 -0700 Subject: Convert mi & miext to new *allocarray functions v2: remove now useless parentheses Signed-off-by: Alan Coopersmith Reviewed-by: Matt Turner --- miext/damage/damage.c | 2 +- miext/rootless/rootlessWindow.c | 4 ++-- miext/shadow/shalloc.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'miext') diff --git a/miext/damage/damage.c b/miext/damage/damage.c index 6ef7f9dfc..ce20169d4 100644 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -1293,7 +1293,7 @@ damageText(DrawablePtr pDrawable, if (!checkGCDamage(pDrawable, pGC)) return; - charinfo = malloc(count * sizeof(CharInfoPtr)); + charinfo = xallocarray(count, sizeof(CharInfoPtr)); if (!charinfo) return; diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index a8f296a39..1f78e3f6c 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -949,7 +949,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity, copy_rect_width = copy_rect.x2 - copy_rect.x1; copy_rect_height = copy_rect.y2 - copy_rect.y1; copy_rowbytes = ((copy_rect_width * Bpp) + 31) & ~31; - gResizeDeathBits = malloc(copy_rowbytes * copy_rect_height); + gResizeDeathBits = xallocarray(copy_rowbytes, copy_rect_height); if (copy_rect_width * copy_rect_height > rootless_CopyBytes_threshold && @@ -998,7 +998,7 @@ StartFrameResize(WindowPtr pWin, Bool gravity, RootlessStartDrawing(pWin); - gResizeDeathBits = malloc(winRec->bytesPerRow * winRec->height); + gResizeDeathBits = xallocarray(winRec->bytesPerRow, winRec->height); memcpy(gResizeDeathBits, winRec->pixelData, winRec->bytesPerRow * winRec->height); diff --git a/miext/shadow/shalloc.c b/miext/shadow/shalloc.c index e555135b9..6a79085c4 100644 --- a/miext/shadow/shalloc.c +++ b/miext/shadow/shalloc.c @@ -44,6 +44,6 @@ shadowAlloc(int width, int height, int bpp) /* Cant use PixmapBytePad -- the structure is probably not initialized yet */ stride = BitmapBytePad(width * bpp); - fb = malloc(stride * height); + fb = xallocarray(stride, height); return fb; } -- cgit v1.2.3