aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
authorMihai Moldovan <ïonic@ionic.de>2016-09-12 02:59:02 +0000
committerMihai Moldovan <ïonic@ionic.de>2017-03-03 11:20:20 +0000
commit5413c5ec8b17dcc223b31f9d08fa3f3c3665d83e (patch)
tree0ebd53bdaa410fc836b2e36a1cf2ec260634d346 /nx-X11/programs/Xserver
parentcd1dcdb2b7458717c6692e43c4ecc36e92a3f81c (diff)
downloadnx-libs-5413c5ec8b17dcc223b31f9d08fa3f3c3665d83e.tar.gz
nx-libs-5413c5ec8b17dcc223b31f9d08fa3f3c3665d83e.tar.bz2
nx-libs-5413c5ec8b17dcc223b31f9d08fa3f3c3665d83e.zip
misc nx-X11/programs/Xserver/{composite,dix,randr}/: switch to using reallocarray, since it has been ported now.
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r--nx-X11/programs/Xserver/composite/compinit.c10
-rw-r--r--nx-X11/programs/Xserver/dix/colormap.c9
-rw-r--r--nx-X11/programs/Xserver/randr/rrcrtc.c10
-rw-r--r--nx-X11/programs/Xserver/randr/rrinfo.c14
-rw-r--r--nx-X11/programs/Xserver/randr/rrmode.c4
-rw-r--r--nx-X11/programs/Xserver/randr/rrmonitor.c5
-rw-r--r--nx-X11/programs/Xserver/randr/rroutput.c10
7 files changed, 0 insertions, 62 deletions
diff --git a/nx-X11/programs/Xserver/composite/compinit.c b/nx-X11/programs/Xserver/composite/compinit.c
index 27b54468f..c4d069dae 100644
--- a/nx-X11/programs/Xserver/composite/compinit.c
+++ b/nx-X11/programs/Xserver/composite/compinit.c
@@ -226,13 +226,8 @@ compRegisterAlternateVisuals(CompScreenPtr cs, VisualID * vids, int nVisuals)
{
VisualID *p;
-#ifndef NXAGENT_SERVER
p = reallocarray(cs->alternateVisuals,
cs->numAlternateVisuals + nVisuals, sizeof(VisualID));
-#else
- p = realloc(cs->alternateVisuals,
- sizeof(VisualID) * (cs->numAlternateVisuals + nVisuals));
-#endif
if (p == NULL)
return FALSE;
@@ -261,13 +256,8 @@ CompositeRegisterImplicitRedirectionException(ScreenPtr pScreen,
CompScreenPtr cs = GetCompScreen(pScreen);
CompImplicitRedirectException *p;
-#ifndef NXAGENT_SERVER
p = reallocarray(cs->implicitRedirectExceptions,
cs->numImplicitRedirectExceptions + 1, sizeof(p[0]));
-#else
- p = realloc(cs->implicitRedirectExceptions,
- sizeof(p[0]) * (cs->numImplicitRedirectExceptions + 1));
-#endif
if (p == NULL)
return FALSE;
diff --git a/nx-X11/programs/Xserver/dix/colormap.c b/nx-X11/programs/Xserver/dix/colormap.c
index 8b0e1e421..d4ad5114c 100644
--- a/nx-X11/programs/Xserver/dix/colormap.c
+++ b/nx-X11/programs/Xserver/dix/colormap.c
@@ -2721,13 +2721,8 @@ ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, DepthPtr depth)
first_new_vid = depth->numVids;
first_new_visual = pScreen->numVisuals;
-#if 0 /* !defined(NXAGENT_SERVER) */
vids = reallocarray(depth->vids, depth->numVids + new_visual_count,
sizeof(XID));
-#else
- vids = realloc(depth->vids, sizeof(XID) *
- (depth->numVids + new_visual_count));
-#endif
if (!vids)
return FALSE;
@@ -2735,11 +2730,7 @@ ResizeVisualArray(ScreenPtr pScreen, int new_visual_count, DepthPtr depth)
depth->vids = vids;
numVisuals = pScreen->numVisuals + new_visual_count;
-#if 0 /* !defined(NXAGENT_SERVER) */
visuals = reallocarray(pScreen->visuals, numVisuals, sizeof(VisualRec));
-#else
- visuals = realloc(pScreen->visuals, sizeof(VisualRec) * numVisuals);
-#endif
if (!visuals) {
return FALSE;
}
diff --git a/nx-X11/programs/Xserver/randr/rrcrtc.c b/nx-X11/programs/Xserver/randr/rrcrtc.c
index 1034eac5d..55570e0cd 100644
--- a/nx-X11/programs/Xserver/randr/rrcrtc.c
+++ b/nx-X11/programs/Xserver/randr/rrcrtc.c
@@ -90,13 +90,8 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate)
/* make space for the crtc pointer */
if (pScrPriv->numCrtcs)
-#ifndef NXAGENT_SERVER
crtcs = reallocarray(pScrPriv->crtcs,
pScrPriv->numCrtcs + 1, sizeof(RRCrtcPtr));
-#else /* !defined(NXAGENT_SERVER) */
- crtcs = realloc(pScrPriv->crtcs,
- (pScrPriv->numCrtcs + 1) * sizeof(RRCrtcPtr));
-#endif /* !defined(NXAGENT_SERVER) */
else
crtcs = malloc(sizeof(RRCrtcPtr));
if (!crtcs)
@@ -206,13 +201,8 @@ RRCrtcNotify(RRCrtcPtr crtc,
if (numOutputs) {
if (crtc->numOutputs)
-#ifndef NXAGENT_SERVER
newoutputs = reallocarray(crtc->outputs,
numOutputs, sizeof(RROutputPtr));
-#else /* !defined(NXAGENT_SERVER) */
- newoutputs = realloc(crtc->outputs,
- numOutputs * sizeof(RROutputPtr));
-#endif /* !defined(NXAGENT_SERVER) */
else
#ifndef NXAGENT_SERVER
newoutputs = xallocarray(numOutputs, sizeof(RROutputPtr));
diff --git a/nx-X11/programs/Xserver/randr/rrinfo.c b/nx-X11/programs/Xserver/randr/rrinfo.c
index bea921436..24245b7b6 100644
--- a/nx-X11/programs/Xserver/randr/rrinfo.c
+++ b/nx-X11/programs/Xserver/randr/rrinfo.c
@@ -55,13 +55,8 @@ RROldModeAdd(RROutputPtr output, RRScreenSizePtr size, int refresh)
}
if (output->numModes)
-#ifndef NXAGENT_SERVER
modes = reallocarray(output->modes,
output->numModes + 1, sizeof(RRModePtr));
-#else /* !defined(NXAGENT_SERVER) */
- modes = realloc(output->modes,
- (output->numModes + 1) * sizeof(RRModePtr));
-#endif /* !defined(NXAGENT_SERVER) */
else
modes = malloc(sizeof(RRModePtr));
if (!modes) {
@@ -271,13 +266,8 @@ RRRegisterSize(ScreenPtr pScreen,
for (i = 0; i < pScrPriv->nSizes; i++)
if (RRScreenSizeMatches(&tmp, &pScrPriv->pSizes[i]))
return &pScrPriv->pSizes[i];
-#ifndef NXAGENT_SERVER
pNew = reallocarray(pScrPriv->pSizes,
pScrPriv->nSizes + 1, sizeof(RRScreenSize));
-#else /* !defined(NXAGENT_SERVER) */
- pNew = realloc(pScrPriv->pSizes,
- (pScrPriv->nSizes + 1) * sizeof(RRScreenSize));
-#endif /* !defined(NXAGENT_SERVER) */
if (!pNew)
return 0;
pNew[pScrPriv->nSizes++] = tmp;
@@ -299,11 +289,7 @@ RRRegisterRate(ScreenPtr pScreen, RRScreenSizePtr pSize, int rate)
if (pSize->pRates[i].rate == rate)
return TRUE;
-#ifndef NXAGENT_SERVER
pNew = reallocarray(pSize->pRates, pSize->nRates + 1, sizeof(RRScreenRate));
-#else /* !defined(NXAGENT_SERVER) */
- pNew = realloc(pSize->pRates, (pSize->nRates + 1) * sizeof(RRScreenRate));
-#endif /* !defined(NXAGENT_SERVER) */
if (!pNew)
return FALSE;
pRate = &pNew[pSize->nRates++];
diff --git a/nx-X11/programs/Xserver/randr/rrmode.c b/nx-X11/programs/Xserver/randr/rrmode.c
index 876ebea42..f4c12062e 100644
--- a/nx-X11/programs/Xserver/randr/rrmode.c
+++ b/nx-X11/programs/Xserver/randr/rrmode.c
@@ -104,11 +104,7 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen)
mode->userScreen = userScreen;
if (num_modes)
-#ifndef NXAGENT_SERVER
newModes = reallocarray(modes, num_modes + 1, sizeof(RRModePtr));
-#else /* !defined(NXAGENT_SERVER) */
- newModes = realloc(modes, (num_modes + 1) * sizeof(RRModePtr));
-#endif /* !defined(NXAGENT_SERVER) */
else
newModes = malloc(sizeof(RRModePtr));
diff --git a/nx-X11/programs/Xserver/randr/rrmonitor.c b/nx-X11/programs/Xserver/randr/rrmonitor.c
index 13b061c35..e9031a567 100644
--- a/nx-X11/programs/Xserver/randr/rrmonitor.c
+++ b/nx-X11/programs/Xserver/randr/rrmonitor.c
@@ -507,14 +507,9 @@ RRMonitorAdd(ClientPtr client, ScreenPtr screen, RRMonitorPtr monitor)
* needs to not have any side-effects on failure
*/
if (pScrPriv->numMonitors)
-#ifndef NXAGENT_SERVER
monitors = reallocarray(pScrPriv->monitors,
pScrPriv->numMonitors + 1,
sizeof(RRMonitorPtr));
-#else /* !defined(NXAGENT_SERVER) */
- monitors = realloc(pScrPriv->monitors,
- (pScrPriv->numMonitors + 1) * sizeof(RRMonitorPtr));
-#endif /* !defined(NXAGENT_SERVER) */
else
monitors = malloc(sizeof(RRMonitorPtr));
diff --git a/nx-X11/programs/Xserver/randr/rroutput.c b/nx-X11/programs/Xserver/randr/rroutput.c
index 5235f39d7..2b44b7f4d 100644
--- a/nx-X11/programs/Xserver/randr/rroutput.c
+++ b/nx-X11/programs/Xserver/randr/rroutput.c
@@ -75,13 +75,8 @@ RROutputCreate(ScreenPtr pScreen,
pScrPriv = rrGetScrPriv(pScreen);
if (pScrPriv->numOutputs)
-#ifndef NXAGENT_SERVER
outputs = reallocarray(pScrPriv->outputs,
pScrPriv->numOutputs + 1, sizeof(RROutputPtr));
-#else /* !defined(NXAGENT_SERVER) */
- outputs = realloc(pScrPriv->outputs,
- (pScrPriv->numOutputs + 1) * sizeof(RROutputPtr));
-#endif /* !defined(NXAGENT_SERVER) */
else
outputs = malloc(sizeof(RROutputPtr));
if (!outputs)
@@ -228,13 +223,8 @@ RROutputAddUserMode(RROutputPtr output, RRModePtr mode)
return BadMatch;
if (output->userModes)
-#ifndef NXAGENT_SERVER
newModes = reallocarray(output->userModes,
output->numUserModes + 1, sizeof(RRModePtr));
-#else /* !defined(NXAGENT_SERVER) */
- newModes = realloc(output->userModes,
- (output->numUserModes + 1) * sizeof(RRModePtr));
-#endif /* !defined(NXAGENT_SERVER) */
else
newModes = malloc(sizeof(RRModePtr));
if (!newModes)