diff options
Diffstat (limited to 'xserver/hw/xnest')
-rw-r--r-- | xserver/hw/xnest/Color.c | 17 | ||||
-rw-r--r-- | xserver/hw/xnest/Display.c | 4 | ||||
-rw-r--r-- | xserver/hw/xnest/Events.c | 2 | ||||
-rw-r--r-- | xserver/hw/xnest/GC.c | 5 | ||||
-rw-r--r-- | xserver/hw/xnest/Keyboard.c | 7 | ||||
-rw-r--r-- | xserver/hw/xnest/Makefile.in | 6 | ||||
-rw-r--r-- | xserver/hw/xnest/Screen.c | 4 | ||||
-rw-r--r-- | xserver/hw/xnest/man/Makefile.in | 6 |
8 files changed, 19 insertions, 32 deletions
diff --git a/xserver/hw/xnest/Color.c b/xserver/hw/xnest/Color.c index 8d9d35621..3a9e42203 100644 --- a/xserver/hw/xnest/Color.c +++ b/xserver/hw/xnest/Color.c @@ -62,7 +62,7 @@ xnestCreateColormap(ColormapPtr pCmap) switch (pVisual->class) { case StaticGray: /* read only */ - colors = (XColor *) malloc(ncolors * sizeof(XColor)); + colors = xallocarray(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 = (XColor *) malloc(ncolors * sizeof(XColor)); + colors = xallocarray(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 = (XColor *) malloc(ncolors * sizeof(XColor)); + colors = xallocarray(ncolors, sizeof(XColor)); red = green = blue = 0L; redInc = lowbit(pVisual->redMask); greenInc = lowbit(pVisual->greenMask); @@ -194,14 +194,12 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen) xnestInstalledColormapWindows icws; int numWindows; - icws.cmapIDs = (Colormap *) malloc(pScreen->maxInstalledCmaps * - sizeof(Colormap)); + icws.cmapIDs = xallocarray(pScreen->maxInstalledCmaps, sizeof(Colormap)); icws.numCmapIDs = xnestListInstalledColormaps(pScreen, icws.cmapIDs); icws.numWindows = 0; WalkTree(pScreen, xnestCountInstalledColormapWindows, (void *) &icws); if (icws.numWindows) { - icws.windows = - (Window *) malloc((icws.numWindows + 1) * sizeof(Window)); + icws.windows = xallocarray(icws.numWindows + 1, sizeof(Window)); icws.index = 0; WalkTree(pScreen, xnestGetInstalledColormapWindows, (void *) &icws); icws.windows[icws.numWindows] = xnestDefaultWindows[pScreen->myNum]; @@ -220,8 +218,7 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen) #ifdef _XSERVER64 { int i; - Window64 *windows = - (Window64 *) malloc(numWindows * sizeof(Window64)); + Window64 *windows = xallocarray(numWindows, sizeof(Window64)); for (i = 0; i < numWindows; ++i) windows[i] = icws.windows[i]; @@ -393,7 +390,7 @@ xnestStoreColors(ColormapPtr pCmap, int nColors, xColorItem * pColors) #ifdef _XSERVER64 { int i; - XColor *pColors64 = (XColor *) malloc(nColors * sizeof(XColor)); + XColor *pColors64 = xallocarray(nColors, sizeof(XColor)); for (i = 0; i < nColors; ++i) { pColors64[i].pixel = pColors[i].pixel; diff --git a/xserver/hw/xnest/Display.c b/xserver/hw/xnest/Display.c index a2f8acbaa..e6d07dfd1 100644 --- a/xserver/hw/xnest/Display.c +++ b/xserver/hw/xnest/Display.c @@ -121,8 +121,8 @@ xnestOpenDisplay(int argc, char *argv[]) } xnestNumDefaultColormaps = xnestNumVisuals; - xnestDefaultColormaps = (Colormap *) malloc(xnestNumDefaultColormaps * - sizeof(Colormap)); + xnestDefaultColormaps = xallocarray(xnestNumDefaultColormaps, + sizeof(Colormap)); for (i = 0; i < xnestNumDefaultColormaps; i++) xnestDefaultColormaps[i] = XCreateColormap(xnestDisplay, DefaultRootWindow diff --git a/xserver/hw/xnest/Events.c b/xserver/hw/xnest/Events.c index 3ff095bb8..f727557ba 100644 --- a/xserver/hw/xnest/Events.c +++ b/xserver/hw/xnest/Events.c @@ -103,7 +103,7 @@ void xnestQueueKeyEvent(int type, unsigned int keycode) { lastEventTime = GetTimeInMillis(); - QueueKeyboardEvents(xnestKeyboardDevice, type, keycode, NULL); + QueueKeyboardEvents(xnestKeyboardDevice, type, keycode); } void diff --git a/xserver/hw/xnest/GC.c b/xserver/hw/xnest/GC.c index 96af6eb91..ecfa61e39 100644 --- a/xserver/hw/xnest/GC.c +++ b/xserver/hw/xnest/GC.c @@ -190,7 +190,7 @@ xnestDestroyGC(GCPtr pGC) void xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects) { - int i, size; + int i; BoxPtr pBox; XRectangle *pRects; @@ -204,8 +204,7 @@ xnestChangeClip(GCPtr pGC, int type, void *pValue, int nRects) case CT_REGION: nRects = RegionNumRects((RegionPtr) pValue); - size = nRects * sizeof(*pRects); - pRects = (XRectangle *) malloc(size); + pRects = xallocarray(nRects, sizeof(*pRects)); pBox = RegionRects((RegionPtr) pValue); for (i = nRects; i-- > 0;) { pRects[i].x = pBox[i].x1; diff --git a/xserver/hw/xnest/Keyboard.c b/xserver/hw/xnest/Keyboard.c index ae8375ee3..85deabab4 100644 --- a/xserver/hw/xnest/Keyboard.c +++ b/xserver/hw/xnest/Keyboard.c @@ -22,7 +22,6 @@ is" without express or implied warranty. #include <X11/X.h> #include <X11/Xproto.h> -#include <xcb/xcb_keysyms.h> #include <X11/keysym.h> #include "screenint.h" #include "inputstr.h" @@ -138,7 +137,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) max_keycode - min_keycode + 1, &mapWidth); len = (max_keycode - min_keycode + 1) * mapWidth; - keymap = (KeySym *) malloc(len * sizeof(KeySym)); + keymap = xallocarray(len, sizeof(KeySym)); for (i = 0; i < len; ++i) keymap[i] = keymap64[i]; XFree(keymap64); @@ -252,7 +251,7 @@ xnestUpdateModifierState(unsigned int state) for (key = 0; key < MAP_LENGTH; key++) if (keyc->xkbInfo->desc->map->modmap[key] & mask) { - if (mask == XCB_MOD_MASK_LOCK) { + if (mask == LockMask) { xnestQueueKeyEvent(KeyPress, key); xnestQueueKeyEvent(KeyRelease, key); } @@ -270,7 +269,7 @@ xnestUpdateModifierState(unsigned int state) for (key = 0; key < MAP_LENGTH; key++) if (keyc->xkbInfo->desc->map->modmap[key] & mask) { xnestQueueKeyEvent(KeyPress, key); - if (mask == XCB_MOD_MASK_LOCK) + if (mask == LockMask) xnestQueueKeyEvent(KeyRelease, key); break; } diff --git a/xserver/hw/xnest/Makefile.in b/xserver/hw/xnest/Makefile.in index 2340b1239..a04316e24 100644 --- a/xserver/hw/xnest/Makefile.in +++ b/xserver/hw/xnest/Makefile.in @@ -58,8 +58,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/xorg-tls.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -266,7 +265,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GLX_SYS_LIBS = @GLX_SYS_LIBS@ -GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GREP = @GREP@ @@ -396,8 +394,6 @@ XEPHYR_INCS = @XEPHYR_INCS@ XEPHYR_LIBS = @XEPHYR_LIBS@ XF86CONFIGDIR = @XF86CONFIGDIR@ XF86CONFIGFILE = @XF86CONFIGFILE@ -XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ -XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ diff --git a/xserver/hw/xnest/Screen.c b/xserver/hw/xnest/Screen.c index abb4d372d..214b55015 100644 --- a/xserver/hw/xnest/Screen.c +++ b/xserver/hw/xnest/Screen.c @@ -158,7 +158,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) if (!dixRegisterPrivateKey(&xnestCursorScreenKeyRec, PRIVATE_SCREEN, 0)) return FALSE; - visuals = (VisualPtr) malloc(xnestNumVisuals * sizeof(VisualRec)); + visuals = xallocarray(xnestNumVisuals, sizeof(VisualRec)); numVisuals = 0; depths = (DepthPtr) malloc(MAXDEPTH * sizeof(DepthRec)); @@ -224,7 +224,7 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) numVisuals++; } - visuals = (VisualPtr) realloc(visuals, numVisuals * sizeof(VisualRec)); + visuals = reallocarray(visuals, numVisuals, sizeof(VisualRec)); defaultVisual = visuals[xnestDefaultVisualIndex].vid; rootDepth = visuals[xnestDefaultVisualIndex].nplanes; diff --git a/xserver/hw/xnest/man/Makefile.in b/xserver/hw/xnest/man/Makefile.in index 879378b13..34bca49af 100644 --- a/xserver/hw/xnest/man/Makefile.in +++ b/xserver/hw/xnest/man/Makefile.in @@ -57,8 +57,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/xorg-tls.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -213,7 +212,6 @@ GLAMOR_LIBS = @GLAMOR_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GLX_SYS_LIBS = @GLX_SYS_LIBS@ -GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GREP = @GREP@ @@ -360,8 +358,6 @@ XEPHYR_INCS = @XEPHYR_INCS@ XEPHYR_LIBS = @XEPHYR_LIBS@ XF86CONFIGDIR = @XF86CONFIGDIR@ XF86CONFIGFILE = @XF86CONFIGFILE@ -XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ -XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ |