diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2015-03-21 14:58:50 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2015-04-21 16:58:08 -0700 |
commit | 7ac280287491fe06127d9fefc504217e21c780e6 (patch) | |
tree | d86d2eb383f27378e6e6867fba3aa80290c7bd18 /miext | |
parent | 70f4a0e6bd18055cc9cb6685253bf5e07b125657 (diff) |
Convert mi & miext to new *allocarray functions
v2: remove now useless parentheses
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'miext')
-rw-r--r-- | miext/damage/damage.c | 2 | ||||
-rw-r--r-- | miext/rootless/rootlessWindow.c | 4 | ||||
-rw-r--r-- | miext/shadow/shalloc.c | 2 |
3 files changed, 4 insertions, 4 deletions
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; } |