diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2015-03-21 13:42:12 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2015-04-21 16:57:08 -0700 |
commit | 1c56ac63c040280498c4a9d67b48c35b60070821 (patch) | |
tree | ab1073d348cb1acf0523ede3e1f2fa73f3b5fdb6 /randr/rrcrtc.c | |
parent | b9e665c8b2f048feb3064ce412e0b3e9eb6797b0 (diff) |
Convert top level extensions 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 'randr/rrcrtc.c')
-rw-r--r-- | randr/rrcrtc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 69b3ecf0f..63d94e26a 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -65,8 +65,8 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate) /* make space for the crtc pointer */ if (pScrPriv->numCrtcs) - crtcs = realloc(pScrPriv->crtcs, - (pScrPriv->numCrtcs + 1) * sizeof(RRCrtcPtr)); + crtcs = reallocarray(pScrPriv->crtcs, + pScrPriv->numCrtcs + 1, sizeof(RRCrtcPtr)); else crtcs = malloc(sizeof(RRCrtcPtr)); if (!crtcs) @@ -176,10 +176,10 @@ RRCrtcNotify(RRCrtcPtr crtc, if (numOutputs) { if (crtc->numOutputs) - newoutputs = realloc(crtc->outputs, - numOutputs * sizeof(RROutputPtr)); + newoutputs = reallocarray(crtc->outputs, + numOutputs, sizeof(RROutputPtr)); else - newoutputs = malloc(numOutputs * sizeof(RROutputPtr)); + newoutputs = xallocarray(numOutputs, sizeof(RROutputPtr)); if (!newoutputs) return FALSE; } @@ -798,7 +798,7 @@ RRCrtcGammaSetSize(RRCrtcPtr crtc, int size) if (size == crtc->gammaSize) return TRUE; if (size) { - gamma = malloc(size * 3 * sizeof(CARD16)); + gamma = xallocarray(size, 3 * sizeof(CARD16)); if (!gamma) return FALSE; } @@ -1027,7 +1027,7 @@ ProcRRSetCrtcConfig(ClientPtr client) return BadMatch; } if (numOutputs) { - outputs = malloc(numOutputs * sizeof(RROutputPtr)); + outputs = xallocarray(numOutputs, sizeof(RROutputPtr)); if (!outputs) return BadAlloc; } |