diff --git a/hw/xnest/Color.c b/hw/xnest/Color.c index 2ea261178..a91b28790 100644 --- a/hw/xnest/Color.c +++ b/hw/xnest/Color.c @@ -62,7 +62,7 @@ xnestCreateColormap(ColormapPtr pCmap) switch (pVisual->class) { case StaticGray: /* read only */ - colors = xallocarray(ncolors, sizeof(XColor)); + colors = calloc(ncolors, sizeof(XColor)); for (i = 0; i < ncolors; i++) colors[i].pixel = i; XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors); @@ -75,7 +75,7 @@ xnestCreateColormap(ColormapPtr pCmap) break; case StaticColor: /* read only */ - colors = xallocarray(ncolors, sizeof(XColor)); + colors = calloc(ncolors, sizeof(XColor)); for (i = 0; i < ncolors; i++) colors[i].pixel = i; XQueryColors(xnestDisplay, xnestColormap(pCmap), colors, ncolors); @@ -88,7 +88,7 @@ xnestCreateColormap(ColormapPtr pCmap) break; case TrueColor: /* read only */ - colors = xallocarray(ncolors, sizeof(XColor)); + colors = calloc(ncolors, sizeof(XColor)); red = green = blue = 0L; redInc = lowbit(pVisual->redMask); greenInc = lowbit(pVisual->greenMask); @@ -194,12 +194,12 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen) xnestInstalledColormapWindows icws; int numWindows; - icws.cmapIDs = xallocarray(pScreen->maxInstalledCmaps, sizeof(Colormap)); + icws.cmapIDs = calloc(pScreen->maxInstalledCmaps, sizeof(Colormap)); icws.numCmapIDs = xnestListInstalledColormaps(pScreen, icws.cmapIDs); icws.numWindows = 0; WalkTree(pScreen, xnestCountInstalledColormapWindows, (void *) &icws); if (icws.numWindows) { - icws.windows = xallocarray(icws.numWindows + 1, sizeof(Window)); + icws.windows = calloc(icws.numWindows + 1, sizeof(Window)); icws.index = 0; WalkTree(pScreen, xnestGetInstalledColormapWindows, (void *) &icws); icws.windows[icws.numWindows] = xnestDefaultWindows[pScreen->myNum]; @@ -218,7 +218,7 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen) #ifdef _XSERVER64 { int i; - Window64 *windows = xallocarray(numWindows, sizeof(Window64)); + Window64 *windows = calloc(numWindows, sizeof(Window64)); for (i = 0; i < numWindows; ++i) windows[i] = icws.windows[i]; @@ -390,7 +390,7 @@ xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem * pColors) #ifdef _XSERVER64 { int i; - XColor *pColors64 = xallocarray(nColors, sizeof(XColor)); + XColor *pColors64 = calloc(nColors, sizeof(XColor)); for (i = 0; i < nColors; ++i) { pColors64[i].pixel = pColors[i].pixel; diff --git a/hw/xnest/Display.c b/hw/xnest/Display.c index cc909a1a3..c26932b25 100644 --- a/hw/xnest/Display.c +++ b/hw/xnest/Display.c @@ -117,8 +117,7 @@ xnestOpenDisplay(int argc, char *argv[]) } xnestNumDefaultColormaps = xnestNumVisuals; - xnestDefaultColormaps = xallocarray(xnestNumDefaultColormaps, - sizeof(Colormap)); + xnestDefaultColormaps = calloc(xnestNumDefaultColormaps, sizeof(Colormap)); for (i = 0; i < xnestNumDefaultColormaps; i++) xnestDefaultColormaps[i] = XCreateColormap(xnestDisplay, DefaultRootWindow diff --git a/hw/xnest/GC.c b/hw/xnest/GC.c index f9f60177f..85241aee9 100644 --- a/hw/xnest/GC.c +++ b/hw/xnest/GC.c @@ -203,7 +203,7 @@ xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects) case CT_REGION: nRects = RegionNumRects((RegionPtr) pValue); - pRects = xallocarray(nRects, sizeof(*pRects)); + pRects = calloc(nRects, sizeof(*pRects)); pBox = RegionRects((RegionPtr) pValue); for (i = nRects; i-- > 0;) { pRects[i].x = pBox[i].x1; diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c index 92fedfb74..127d6dfad 100644 --- a/hw/xnest/Keyboard.c +++ b/hw/xnest/Keyboard.c @@ -119,7 +119,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) max_keycode - min_keycode + 1, &mapWidth); len = (max_keycode - min_keycode + 1) * mapWidth; - keymap = xallocarray(len, sizeof(KeySym)); + keymap = calloc(len, sizeof(KeySym)); for (i = 0; i < len; ++i) keymap[i] = keymap64[i]; XFree(keymap64); diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index ed7063e44..43cd244f7 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -163,7 +163,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) PRIVATE_CURSOR, 0)) return FALSE; - visuals = xallocarray(xnestNumVisuals, sizeof(VisualRec)); + visuals = calloc(xnestNumVisuals, sizeof(VisualRec)); numVisuals = 0; depths = calloc(MAXDEPTH, sizeof(DepthRec));