Unverified Commit abf37413 authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/various' into 3.6.x

parents c0754a35 c8a5e33f
...@@ -88,7 +88,7 @@ static XrmQuark nextUniq = -1; /* next quark from XrmUniqueQuark */ ...@@ -88,7 +88,7 @@ static XrmQuark nextUniq = -1; /* next quark from XrmUniqueQuark */
#define STRQUANTSIZE (sizeof(XrmString) * (QUANTUMMASK + 1)) #define STRQUANTSIZE (sizeof(XrmString) * (QUANTUMMASK + 1))
#ifdef PERMQ #ifdef PERMQ
#define QUANTSIZE (STRQUANTSIZE + \ #define QUANTSIZE (STRQUANTSIZE + \
(sizeof(Bits) * ((QUANTUMMASK + 1) >> 3)) (sizeof(Bits) * ((QUANTUMMASK + 1) >> 3)))
#else #else
#define QUANTSIZE STRQUANTSIZE #define QUANTSIZE STRQUANTSIZE
#endif #endif
......
...@@ -64,6 +64,7 @@ static void ResetClientState(int clientIndex) ...@@ -64,6 +64,7 @@ static void ResetClientState(int clientIndex)
if (cl->returnBuf) free(cl->returnBuf); if (cl->returnBuf) free(cl->returnBuf);
if (cl->largeCmdBuf) free(cl->largeCmdBuf); if (cl->largeCmdBuf) free(cl->largeCmdBuf);
if (cl->currentContexts) free(cl->currentContexts); if (cl->currentContexts) free(cl->currentContexts);
if (cl->GLClientextensions) free(cl->GLClientextensions);
memset(cl, 0, sizeof(__GLXclientState)); memset(cl, 0, sizeof(__GLXclientState));
/* /*
** By default, assume that the client supports ** By default, assume that the client supports
...@@ -71,9 +72,6 @@ static void ResetClientState(int clientIndex) ...@@ -71,9 +72,6 @@ static void ResetClientState(int clientIndex)
*/ */
cl->GLClientmajorVersion = 1; cl->GLClientmajorVersion = 1;
cl->GLClientminorVersion = 0; cl->GLClientminorVersion = 0;
if (cl->GLClientextensions)
free(cl->GLClientextensions);
} }
/* /*
......
...@@ -153,11 +153,9 @@ ProcXChangeKeyboardDevice(register ClientPtr client) ...@@ -153,11 +153,9 @@ ProcXChangeKeyboardDevice(register ClientPtr client)
df->time = xf->time; df->time = xf->time;
df->traceGood = xf->traceGood; df->traceGood = xf->traceGood;
if (df->traceSize != xf->traceSize) { if (df->traceSize != xf->traceSize) {
Must_have_memory = TRUE; /* XXX */
df->trace = (WindowPtr *) realloc(df->trace, df->trace = (WindowPtr *) realloc(df->trace,
xf->traceSize * xf->traceSize *
sizeof(WindowPtr)); sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
} }
df->traceSize = xf->traceSize; df->traceSize = xf->traceSize;
for (i = 0; i < df->traceSize; i++) for (i = 0; i < df->traceSize; i++)
......
...@@ -203,7 +203,15 @@ CloseDevice(register DeviceIntPtr dev) ...@@ -203,7 +203,15 @@ CloseDevice(register DeviceIntPtr dev)
if (dev->inited) if (dev->inited)
(void)(*dev->deviceProc)(dev, DEVICE_CLOSE); (void)(*dev->deviceProc)(dev, DEVICE_CLOSE);
#ifdef XKB
while (dev->xkb_interest) {
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
}
#endif
free(dev->name); free(dev->name);
if (dev->key) if (dev->key)
{ {
#ifdef XKB #ifdef XKB
...@@ -267,11 +275,6 @@ CloseDevice(register DeviceIntPtr dev) ...@@ -267,11 +275,6 @@ CloseDevice(register DeviceIntPtr dev)
#endif #endif
free(l); free(l);
} }
#ifdef XKB
while (dev->xkb_interest) {
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
}
#endif
free(dev->sync.event); free(dev->sync.event);
free(dev); free(dev);
} }
......
...@@ -4150,7 +4150,10 @@ AddScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ , ...@@ -4150,7 +4150,10 @@ AddScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ ,
pScreen->devPrivates = (DevUnion *)calloc(sizeof(DevUnion), pScreen->devPrivates = (DevUnion *)calloc(sizeof(DevUnion),
screenPrivateCount); screenPrivateCount);
if (!pScreen->devPrivates && screenPrivateCount) if (!pScreen->devPrivates && screenPrivateCount)
{
free(pScreen);
return -1; return -1;
}
ret = init_screen(pScreen, i); ret = init_screen(pScreen, i);
if (ret != 0) { if (ret != 0) {
......
...@@ -1938,10 +1938,8 @@ XYToWindow(int x, int y) ...@@ -1938,10 +1938,8 @@ XYToWindow(int x, int y)
if (spriteTraceGood >= spriteTraceSize) if (spriteTraceGood >= spriteTraceSize)
{ {
spriteTraceSize += 10; spriteTraceSize += 10;
Must_have_memory = TRUE; /* XXX */ spriteTrace = realloc(
spriteTrace = (WindowPtr *)realloc(
spriteTrace, spriteTraceSize*sizeof(WindowPtr)); spriteTrace, spriteTraceSize*sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
} }
spriteTrace[spriteTraceGood++] = pWin; spriteTrace[spriteTraceGood++] = pWin;
pWin = pWin->firstChild; pWin = pWin->firstChild;
...@@ -2455,11 +2453,9 @@ CheckPassiveGrabsOnWindow( ...@@ -2455,11 +2453,9 @@ CheckPassiveGrabsOnWindow(
{ {
if (device->sync.evcount < count) if (device->sync.evcount < count)
{ {
Must_have_memory = TRUE; /* XXX */ device->sync.event = realloc(device->sync.event,
device->sync.event = (xEvent *)realloc(device->sync.event, count*
count* sizeof(xEvent));
sizeof(xEvent));
Must_have_memory = FALSE; /* XXX */
} }
device->sync.evcount = count; device->sync.evcount = count;
for (dxE = device->sync.event; --count >= 0; dxE++, xE++) for (dxE = device->sync.event; --count >= 0; dxE++, xE++)
...@@ -2627,10 +2623,8 @@ DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev, ...@@ -2627,10 +2623,8 @@ DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev,
FreezeThaw(thisDev, TRUE); FreezeThaw(thisDev, TRUE);
if (thisDev->sync.evcount < count) if (thisDev->sync.evcount < count)
{ {
Must_have_memory = TRUE; /* XXX */ thisDev->sync.event = realloc(thisDev->sync.event,
thisDev->sync.event = (xEvent *)realloc(thisDev->sync.event, count*sizeof(xEvent));
count*sizeof(xEvent));
Must_have_memory = FALSE; /* XXX */
} }
thisDev->sync.evcount = count; thisDev->sync.evcount = count;
for (dxE = thisDev->sync.event; --count >= 0; dxE++, xE++) for (dxE = thisDev->sync.event; --count >= 0; dxE++, xE++)
...@@ -3505,11 +3499,8 @@ SetInputFocus( ...@@ -3505,11 +3499,8 @@ SetInputFocus(
if (depth > focus->traceSize) if (depth > focus->traceSize)
{ {
focus->traceSize = depth+1; focus->traceSize = depth+1;
Must_have_memory = TRUE; /* XXX */ focus->trace = realloc(focus->trace,
focus->trace = (WindowPtr *)realloc(focus->trace, focus->traceSize * sizeof(WindowPtr));
focus->traceSize *
sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
} }
focus->traceGood = depth; focus->traceGood = depth;
for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--) for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--)
......
...@@ -410,16 +410,20 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen, ...@@ -410,16 +410,20 @@ fbOverlayFinishScreenInit(ScreenPtr pScreen,
if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &depth1, if (!fbInitVisuals (&visuals, &depths, &nvisuals, &ndepths, &depth1,
&defaultVisual, ((unsigned long)1<<(bpp1-1)) | &defaultVisual, ((unsigned long)1<<(bpp1-1)) |
((unsigned long)1<<(bpp2-1)), 8)) ((unsigned long)1<<(bpp2-1)), 8)) {
free(pScrPriv);
return FALSE; return FALSE;
}
if (! miScreenInit(pScreen, 0, xsize, ysize, dpix, dpiy, 0, if (! miScreenInit(pScreen, 0, xsize, ysize, dpix, dpiy, 0,
depth1, ndepths, depths, depth1, ndepths, depths,
defaultVisual, nvisuals, visuals defaultVisual, nvisuals, visuals
#ifdef FB_OLD_MISCREENINIT #ifdef FB_OLD_MISCREENINIT
, (miBSFuncPtr) 0 , (miBSFuncPtr) 0
#endif #endif
)) )) {
free(pScrPriv);
return FALSE; return FALSE;
}
/* MI thinks there's no frame buffer */ /* MI thinks there's no frame buffer */
#ifdef MITSHM #ifdef MITSHM
ShmRegisterFbFuncs(pScreen); ShmRegisterFbFuncs(pScreen);
......
...@@ -1964,14 +1964,14 @@ FIXME: Don't enqueue the KeyRelease event if the key was ...@@ -1964,14 +1964,14 @@ FIXME: Don't enqueue the KeyRelease event if the key was
} }
case UnmapNotify: case UnmapNotify:
{ {
WindowPtr pWin;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentDispatchEvents: Going to handle new UnmapNotify event.\n"); fprintf(stderr, "nxagentDispatchEvents: Going to handle new UnmapNotify event.\n");
#endif #endif
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless) == 1)
{ {
WindowPtr pWin;
if ((pWin = nxagentRootlessTopLevelWindow(X.xunmap.window)) != NULL || if ((pWin = nxagentRootlessTopLevelWindow(X.xunmap.window)) != NULL ||
((pWin = nxagentWindowPtr(X.xunmap.window)) != NULL && ((pWin = nxagentWindowPtr(X.xunmap.window)) != NULL &&
nxagentWindowTopLevel(pWin) == 1)) nxagentWindowTopLevel(pWin) == 1))
...@@ -1995,22 +1995,19 @@ FIXME: Don't enqueue the KeyRelease event if the key was ...@@ -1995,22 +1995,19 @@ FIXME: Don't enqueue the KeyRelease event if the key was
} }
case MapNotify: case MapNotify:
{ {
WindowPtr pWin;
ClientPtr pClient;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentDispatchEvents: Going to handle new MapNotify event.\n"); fprintf(stderr, "nxagentDispatchEvents: Going to handle new MapNotify event.\n");
#endif #endif
if (nxagentOption(Rootless) == 1) if (nxagentOption(Rootless) == 1)
{ {
Bool value = 1; WindowPtr pWin;
if ((pWin = nxagentRootlessTopLevelWindow(X.xmap.window)) != NULL || if ((pWin = nxagentRootlessTopLevelWindow(X.xmap.window)) != NULL ||
((pWin = nxagentWindowPtr(X.xmap.window)) != NULL && ((pWin = nxagentWindowPtr(X.xmap.window)) != NULL &&
nxagentWindowTopLevel(pWin) == 1)) nxagentWindowTopLevel(pWin) == 1))
{ {
pClient = wClient(pWin); ClientPtr pClient = wClient(pWin);
nxagentScreenTrap = 1; nxagentScreenTrap = 1;
...@@ -2021,6 +2018,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was ...@@ -2021,6 +2018,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was
if (pWin != NULL) if (pWin != NULL)
{ {
Bool value = 1;
TraverseTree(pWin, nxagentChangeMapPrivate, &value); TraverseTree(pWin, nxagentChangeMapPrivate, &value);
} }
} }
...@@ -2355,8 +2354,6 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) ...@@ -2355,8 +2354,6 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result)
int nxagentHandlePropertyNotify(XEvent *X) int nxagentHandlePropertyNotify(XEvent *X)
{ {
int resource;
if (nxagentOption(Rootless) && !nxagentNotifyMatchChangeProperty((XPropertyEvent *) X)) if (nxagentOption(Rootless) && !nxagentNotifyMatchChangeProperty((XPropertyEvent *) X))
{ {
#ifdef TEST #ifdef TEST
...@@ -2366,7 +2363,7 @@ int nxagentHandlePropertyNotify(XEvent *X) ...@@ -2366,7 +2363,7 @@ int nxagentHandlePropertyNotify(XEvent *X)
if (nxagentWindowPtr(X -> xproperty.window) != NULL) if (nxagentWindowPtr(X -> xproperty.window) != NULL)
{ {
resource = NXGetCollectPropertyResource(nxagentDisplay); int resource = NXGetCollectPropertyResource(nxagentDisplay);
if (resource == -1) if (resource == -1)
{ {
...@@ -2643,8 +2640,6 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X) ...@@ -2643,8 +2640,6 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result) int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
{ {
WindowPtr pWin;
*result = doNothing; *result = doNothing;
#ifdef TEST #ifdef TEST
...@@ -2680,7 +2675,7 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result) ...@@ -2680,7 +2675,7 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
return 0; return 0;
} }
pWin = nxagentWindowPtr(X -> xclient.window); WindowPtr pWin = nxagentWindowPtr(X -> xclient.window);
if (pWin == NULL) if (pWin == NULL)
{ {
...@@ -2886,7 +2881,6 @@ int nxagentHandleXkbKeyboardStateEvent(XEvent *X) ...@@ -2886,7 +2881,6 @@ int nxagentHandleXkbKeyboardStateEvent(XEvent *X)
int nxagentHandleXFixesSelectionNotify(XEvent *X) int nxagentHandleXFixesSelectionNotify(XEvent *X)
{ {
int i;
Atom local; Atom local;
XFixesSelectionEvent *xfixesEvent = (XFixesSelectionEvent *) X; XFixesSelectionEvent *xfixesEvent = (XFixesSelectionEvent *) X;
...@@ -2915,7 +2909,7 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) ...@@ -2915,7 +2909,7 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X)
if (SelectionCallback) if (SelectionCallback)
{ {
i = 0; int i = 0;
while ((i < NumCurrentSelections) && while ((i < NumCurrentSelections) &&
CurrentSelections[i].selection != local) CurrentSelections[i].selection != local)
...@@ -4011,21 +4005,23 @@ void nxagentDeactivatePointerGrab(void) ...@@ -4011,21 +4005,23 @@ void nxagentDeactivatePointerGrab(void)
if (grab) if (grab)
{ {
XButtonEvent X; XButtonEvent X = {
memset(&X, 0, sizeof(XButtonEvent)); .type = ButtonRelease,
.serial = 0,
X.type = ButtonRelease; .send_event = FALSE,
X.serial = 0; .time = currentTime.milliseconds,
X.send_event = FALSE; .display = nxagentDisplay,
X.time = currentTime.milliseconds; .window = nxagentWindow(grab -> window),
X.display = nxagentDisplay; .root = RootWindow(nxagentDisplay, 0),
X.window = nxagentWindow(grab -> window); .subwindow = 0,
X.root = RootWindow(nxagentDisplay, 0); .x = 0,
X.subwindow = 0; .y = 0,
X.x = X.y = X.x_root = X.y_root = 0; .x_root = 0,
X.state = 0x100; .y_root = 0,
X.button = 1; .state = 0x100,
X.same_screen = TRUE; .button = 1,
.same_screen = TRUE,
};
XPutBackEvent(nxagentDisplay, (XEvent*)&X); XPutBackEvent(nxagentDisplay, (XEvent*)&X);
} }
......
...@@ -98,13 +98,12 @@ void nxagentInitGlxExtension(VisualPtr *visuals, DepthPtr *depths, ...@@ -98,13 +98,12 @@ void nxagentInitGlxExtension(VisualPtr *visuals, DepthPtr *depths,
int *numVisuals, int *numDepths, int *rootDepth, int *numVisuals, int *numDepths, int *rootDepth,
VisualID *defaultVisual) VisualID *defaultVisual)
{ {
miInitVisualsProcPtr initVisuals;
/* /*
* Initialize the visuals to use the GLX extension. * Initialize the visuals to use the GLX extension.
*/ */
initVisuals = NULL; miInitVisualsProcPtr initVisuals = NULL;
GlxWrapInitVisuals(&initVisuals); GlxWrapInitVisuals(&initVisuals);
...@@ -372,15 +371,13 @@ static int nxagentRandRInitSizes(ScreenPtr pScreen) ...@@ -372,15 +371,13 @@ static int nxagentRandRInitSizes(ScreenPtr pScreen)
int nxagentRandRSetConfig(ScreenPtr pScreen, Rotation rotation, int nxagentRandRSetConfig(ScreenPtr pScreen, Rotation rotation,
int rate, RRScreenSizePtr pSize) int rate, RRScreenSizePtr pSize)
{ {
int r;
UpdateCurrentTime(); UpdateCurrentTime();
/* /*
* Whatever size is OK for us. * Whatever size is OK for us.
*/ */
r = nxagentResizeScreen(pScreen, pSize -> width, pSize -> height, int r = nxagentResizeScreen(pScreen, pSize -> width, pSize -> height,
pSize -> mmWidth, pSize -> mmHeight); pSize -> mmWidth, pSize -> mmHeight);
nxagentMoveViewport(pScreen, 0, 0); nxagentMoveViewport(pScreen, 0, 0);
...@@ -430,8 +427,6 @@ void nxagentRandRSetWindowsSize(int width, int height) ...@@ -430,8 +427,6 @@ void nxagentRandRSetWindowsSize(int width, int height)
int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
CARD32 mmWidth, CARD32 mmHeight) CARD32 mmWidth, CARD32 mmHeight)
{ {
int result;
UpdateCurrentTime(); UpdateCurrentTime();
if (nxagentOption(DesktopResize) == 1 && if (nxagentOption(DesktopResize) == 1 &&
...@@ -453,7 +448,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, ...@@ -453,7 +448,7 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
nxagentChangeOption(Height, height); nxagentChangeOption(Height, height);
} }
result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight); int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight);
if (result == 1 && nxagentOption(DesktopResize) == 1 && if (result == 1 && nxagentOption(DesktopResize) == 1 &&
nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0) nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0)
......
...@@ -165,8 +165,6 @@ static struct _nxagentFailedToReconnectFonts ...@@ -165,8 +165,6 @@ static struct _nxagentFailedToReconnectFonts
void nxagentFreeFontCache(void) void nxagentFreeFontCache(void)
{ {
int i;
#ifdef NXAGENT_FONTCACHE_DEBUG #ifdef NXAGENT_FONTCACHE_DEBUG
fprintf(stderr, "Font: Freeing nxagent font cache\n"); fprintf(stderr, "Font: Freeing nxagent font cache\n");
#endif #endif
...@@ -178,7 +176,7 @@ void nxagentFreeFontCache(void) ...@@ -178,7 +176,7 @@ void nxagentFreeFontCache(void)
fprintf(stderr, "Font: Freeing nxagent font cache, there are [%d] entries.\n", CACHE_INDEX); fprintf(stderr, "Font: Freeing nxagent font cache, there are [%d] entries.\n", CACHE_INDEX);
#endif #endif
for (i = 0; i < CACHE_INDEX; i++) for (int i = 0; i < CACHE_INDEX; i++)
{ {
#ifdef NXAGENT_FONTCACHE_DEBUG #ifdef NXAGENT_FONTCACHE_DEBUG
fprintf(stderr, "Font: Freeing nxagent font cache entry [%d] entry pointer is [%p], name [%s]\n", fprintf(stderr, "Font: Freeing nxagent font cache entry [%d] entry pointer is [%p], name [%s]\n",
...@@ -208,8 +206,6 @@ void nxagentFreeFontCache(void) ...@@ -208,8 +206,6 @@ void nxagentFreeFontCache(void)
void nxagentListRemoteFonts(const char *searchPattern, const int maxNames) void nxagentListRemoteFonts(const char *searchPattern, const int maxNames)
{ {
int i, q, p;
char **xList; char **xList;
int xLen = 0; int xLen = 0;
...@@ -241,7 +237,7 @@ void nxagentListRemoteFonts(const char *searchPattern, const int maxNames) ...@@ -241,7 +237,7 @@ void nxagentListRemoteFonts(const char *searchPattern, const int maxNames)
* other one will select the 'real' fonts. * other one will select the 'real' fonts.
*/ */
for (p = 0; p < patternsQt; p++) for (int p = 0; p < patternsQt; p++)
{ {
xList = XListFonts(nxagentDisplay, patterns[p], maxNames, &xLen); xList = XListFonts(nxagentDisplay, patterns[p], maxNames, &xLen);
...@@ -256,11 +252,9 @@ void nxagentListRemoteFonts(const char *searchPattern, const int maxNames) ...@@ -256,11 +252,9 @@ void nxagentListRemoteFonts(const char *searchPattern, const int maxNames)
nxagentListRemoteAddName(searchPattern, maxNames); nxagentListRemoteAddName(searchPattern, maxNames);
for (i = 0; i < xLen; i++) for (int i = 0; i < xLen; i++)
{ {
q = 1; nxagentListRemoteAddName(xList[i], 1);
nxagentListRemoteAddName(xList[i], q);
} }
XFreeFontNames(xList); XFreeFontNames(xList);
...@@ -270,7 +264,7 @@ void nxagentListRemoteFonts(const char *searchPattern, const int maxNames) ...@@ -270,7 +264,7 @@ void nxagentListRemoteFonts(const char *searchPattern, const int maxNames)
fprintf(stderr, "nxagentListRemoteFonts: Printing remote font list.\n"); fprintf(stderr, "nxagentListRemoteFonts: Printing remote font list.\n");
for (i = 0; i < nxagentRemoteFontList.length; i++) for (int i = 0; i < nxagentRemoteFontList.length; i++)
{ {
fprintf(stderr, "Font# %d, \"%s\"\n", i, nxagentRemoteFontList.list[i]->name); fprintf(stderr, "Font# %d, \"%s\"\n", i, nxagentRemoteFontList.list[i]->name);
} }
...@@ -353,9 +347,7 @@ void nxagentListRemoteAddName(const char *name, int status) ...@@ -353,9 +347,7 @@ void nxagentListRemoteAddName(const char *name, int status)
static void nxagentFreeRemoteFontList(nxagentFontList *listRec) static void nxagentFreeRemoteFontList(nxagentFontList *listRec)
{ {
int l; for (int l = 0; l < listRec -> length; l++)
for (l = 0; l < listRec -> length; l++)
{ {
if (listRec -> list[l]) if (listRec -> list[l])
{ {
...@@ -377,18 +369,16 @@ static void nxagentFreeRemoteFontList(nxagentFontList *listRec) ...@@ -377,18 +369,16 @@ static void nxagentFreeRemoteFontList(nxagentFontList *listRec)
Bool nxagentFontFind(const char *name, int *pos) Bool nxagentFontFind(const char *name, int *pos)
{ {
int low,high,res,iter,lpos;
if (!nxagentRemoteFontList.length) if (!nxagentRemoteFontList.length)
{ {
*pos=0; *pos=0;
return False; return False;
} }
low = 0; int low = 0;
high = nxagentRemoteFontList.length - 1; int high = nxagentRemoteFontList.length - 1;
iter = 0; int iter = 0;
res = 1; int res = 1;
lpos = nxagentRemoteFontList.length; int lpos = nxagentRemoteFontList.length;
while (low <= high) while (low <= high)
{ {
*pos = (high + low)/2; *pos = (high + low)/2;
...@@ -424,18 +414,15 @@ Bool nxagentFontFind(const char *name, int *pos) ...@@ -424,18 +414,15 @@ Bool nxagentFontFind(const char *name, int *pos)
Bool nxagentFontLookUp(const char *name) Bool nxagentFontLookUp(const char *name)
{ {
int i; int i;
int result;
char *scalable;
if (name != NULL && strlen(name) == 0) if (name != NULL && strlen(name) == 0)
{ {
return 0; return 0;
} }
result = nxagentFontFind(name, &i); int result = nxagentFontFind(name, &i);
scalable = NULL; char *scalable = NULL;
/* /*
* Let's try with the scalable font description. * Let's try with the scalable font description.
...@@ -443,9 +430,7 @@ Bool nxagentFontLookUp(const char *name) ...@@ -443,9 +430,7 @@ Bool nxagentFontLookUp(const char *name)
if (result == 0) if (result == 0)
{ {
scalable = nxagentMakeScalableFontName(name, 0); if ((scalable = nxagentMakeScalableFontName(name, 0)) != NULL)
if (scalable != NULL)
{ {
result = nxagentFontFind(scalable, &i); result = nxagentFontFind(scalable, &i);
...@@ -459,9 +444,7 @@ Bool nxagentFontLookUp(const char *name) ...@@ -459,9 +444,7 @@ Bool nxagentFontLookUp(const char *name)
if (result == 0) if (result == 0)
{ {
scalable = nxagentMakeScalableFontName(name, 1); if ((scalable = nxagentMakeScalableFontName(name, 1)) != NULL)
if (scalable != NULL)
{ {
result = nxagentFontFind(scalable, &i); result = nxagentFontFind(scalable, &i);
...@@ -857,7 +840,6 @@ static void nxagentFontDisconnect(FontPtr pFont, XID param1, void * param2) ...@@ -857,7 +840,6 @@ static void nxagentFontDisconnect(FontPtr pFont, XID param1, void * param2)
{ {
nxagentPrivFont *privFont; nxagentPrivFont *privFont;
Bool *pBool = (Bool*)param2; Bool *pBool = (Bool*)param2;
int i;
if (pFont == NULL || !*pBool) if (pFont == NULL || !*pBool)
return; return;
...@@ -869,7 +851,7 @@ static void nxagentFontDisconnect(FontPtr pFont, XID param1, void * param2) ...@@ -869,7 +851,7 @@ static void nxagentFontDisconnect(FontPtr pFont, XID param1, void * param2)
(void *) pFont, privFont -> font_struct ? nxagentFont(pFont) : 0); (void *) pFont, privFont -> font_struct ? nxagentFont(pFont) : 0);
#endif #endif
for (i = 0; i < CACHE_INDEX; i++) for (int i = 0; i < CACHE_INDEX; i++)
{ {
if (strcasecmp(CACHE_NAME(i), privFont -> fontName) == 0) if (strcasecmp(CACHE_NAME(i), privFont -> fontName) == 0)
{ {
...@@ -897,7 +879,6 @@ static void nxagentFontDisconnect(FontPtr pFont, XID param1, void * param2) ...@@ -897,7 +879,6 @@ static void nxagentFontDisconnect(FontPtr pFont, XID param1, void * param2)
static void nxagentCollectFailedFont(FontPtr fpt, XID id) static void nxagentCollectFailedFont(FontPtr fpt, XID id)
{ {
if (nxagentFailedToReconnectFonts.font == NULL) if (nxagentFailedToReconnectFonts.font == NULL)
{ {
nxagentFailedToReconnectFonts.size = 8; nxagentFailedToReconnectFonts.size = 8;
...@@ -1043,13 +1024,11 @@ static void nxagentFontReconnect(FontPtr pFont, XID param1, void * param2) ...@@ -1043,13 +1024,11 @@ static void nxagentFontReconnect(FontPtr pFont, XID param1, void * param2)
static void nxagentFreeCacheBeforeReconnect(void) static void nxagentFreeCacheBeforeReconnect(void)
{ {
int i;
#ifdef NXAGENT_RECONNECT_FONT_DEBUG #ifdef NXAGENT_RECONNECT_FONT_DEBUG
printFontCacheDump("nxagentFreeCacheBeforeReconnect"); printFontCacheDump("nxagentFreeCacheBeforeReconnect");
#endif #endif
for (i = 0; i < CACHE_INDEX; i++) for (int i = 0; i < CACHE_INDEX; i++)
{ {
if (CACHE_FSTRUCT(i)) if (CACHE_FSTRUCT(i))
{ {
...@@ -1061,15 +1040,13 @@ static void nxagentFreeCacheBeforeReconnect(void) ...@@ -1061,15 +1040,13 @@ static void nxagentFreeCacheBeforeReconnect(void)
static void nxagentCleanCacheAfterReconnect(void) static void nxagentCleanCacheAfterReconnect(void)
{ {
int i, j;
int real_size = CACHE_INDEX; int real_size = CACHE_INDEX;
nxCacheFontEntryRecPtr swapEntryPtr;
#ifdef NXAGENT_RECONNECT_FONT_DEBUG #ifdef NXAGENT_RECONNECT_FONT_DEBUG
printFontCacheDump("nxagentCleanCacheAfterReconnect"); printFontCacheDump("nxagentCleanCacheAfterReconnect");
#endif #endif
for (i = 0; i < CACHE_INDEX; i++) for (int i = 0; i < CACHE_INDEX; i++)
{ {
if(CACHE_FSTRUCT(i) == NULL) if(CACHE_FSTRUCT(i) == NULL)
{ {
...@@ -1078,8 +1055,11 @@ static void nxagentCleanCacheAfterReconnect(void) ...@@ -1078,8 +1055,11 @@ static void nxagentCleanCacheAfterReconnect(void)
} }
} }
for (i = 0; i < real_size; i++) for (int i = 0; i < real_size; i++)
{ {
int j;
nxCacheFontEntryRecPtr swapEntryPtr;
/* Find - first bad occurrence if exist. */ /* Find - first bad occurrence if exist. */
while ((i < real_size) && CACHE_FSTRUCT(i)) i++; while ((i < real_size) && CACHE_FSTRUCT(i)) i++;
...@@ -1108,11 +1088,9 @@ static void nxagentCleanCacheAfterReconnect(void) ...@@ -1108,11 +1088,9 @@ static void nxagentCleanCacheAfterReconnect(void)
#ifdef NXAGENT_RECONNECT_FONT_DEBUG #ifdef NXAGENT_RECONNECT_FONT_DEBUG
static void printFontCacheDump(char* msg) static void printFontCacheDump(char* msg)
{ {
int i;
fprintf(stderr, "%s - begin -\n", msg); fprintf(stderr, "%s - begin -\n", msg);
for (i = 0; i < CACHE_INDEX; i++) for (int i = 0; i < CACHE_INDEX; i++)
{ {
if (CACHE_FSTRUCT(i)) if (CACHE_FSTRUCT(i))
{ {
...@@ -1129,7 +1107,6 @@ static void printFontCacheDump(char* msg) ...@@ -1129,7 +1107,6 @@ static void printFontCacheDump(char* msg)
Bool nxagentReconnectAllFonts(void *p0) Bool nxagentReconnectAllFonts(void *p0)
{ {
int cid;
Bool fontSuccess = True; Bool fontSuccess = True;
reconnectFlexibility = *((int *) p0); reconnectFlexibility = *((int *) p0);
...@@ -1147,7 +1124,7 @@ Bool nxagentReconnectAllFonts(void *p0) ...@@ -1147,7 +1124,7 @@ Bool nxagentReconnectAllFonts(void *p0)
FindClientResourcesByType(clients[serverClient -> index], RT_NX_FONT, FindClientResourcesByType(clients[serverClient -> index], RT_NX_FONT,
(FindResType) nxagentFontReconnect, &fontSuccess); (FindResType) nxagentFontReconnect, &fontSuccess);
for (cid = 0; cid < MAXCLIENTS; cid++) for (int cid = 0; cid < MAXCLIENTS; cid++)
{ {
if (clients[cid]) if (clients[cid])
{ {
...@@ -1258,7 +1235,6 @@ static void nxagentFreeFailedToReconnectFonts(void) ...@@ -1258,7 +1235,6 @@ static void nxagentFreeFailedToReconnectFonts(void)
Bool nxagentReconnectFailedFonts(void *p0) Bool nxagentReconnectFailedFonts(void *p0)
{ {
int i;
int attempt = 1; int attempt = 1;
const int maxAttempt = 5; const int maxAttempt = 5;
...@@ -1312,7 +1288,7 @@ Bool nxagentReconnectFailedFonts(void *p0) ...@@ -1312,7 +1288,7 @@ Bool nxagentReconnectFailedFonts(void *p0)
nxagentFreeRemoteFontList(&nxagentRemoteFontList); nxagentFreeRemoteFontList(&nxagentRemoteFontList);
nxagentListRemoteFonts("*", nxagentMaxFontNames); nxagentListRemoteFonts("*", nxagentMaxFontNames);
for(i = 0; i < nxagentFailedToReconnectFonts.index; i++) for(int i = 0; i < nxagentFailedToReconnectFonts.index; i++)
{ {
fontSuccess = True; fontSuccess = True;
...@@ -1365,7 +1341,6 @@ Bool nxagentReconnectFailedFonts(void *p0) ...@@ -1365,7 +1341,6 @@ Bool nxagentReconnectFailedFonts(void *p0)
Bool nxagentDisconnectAllFonts(void) Bool nxagentDisconnectAllFonts(void)
{ {
int cid;
Bool fontSuccess = True; Bool fontSuccess = True;
#if defined(NXAGENT_RECONNECT_DEBUG) || defined(NXAGENT_RECONNECT_FONT_DEBUG) #if defined(NXAGENT_RECONNECT_DEBUG) || defined(NXAGENT_RECONNECT_FONT_DEBUG)
...@@ -1384,7 +1359,7 @@ Bool nxagentDisconnectAllFonts(void) ...@@ -1384,7 +1359,7 @@ Bool nxagentDisconnectAllFonts(void)
FindClientResourcesByType(clients[serverClient -> index], RT_NX_FONT, FindClientResourcesByType(clients[serverClient -> index], RT_NX_FONT,
(FindResType) nxagentFontDisconnect, &fontSuccess); (FindResType) nxagentFontDisconnect, &fontSuccess);
for(cid = 0; cid < MAXCLIENTS; cid++) for(int cid = 0; cid < MAXCLIENTS; cid++)
{ {
if( clients[cid] && fontSuccess ) if( clients[cid] && fontSuccess )
{ {
...@@ -1647,7 +1622,6 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo ...@@ -1647,7 +1622,6 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
int nxagentFreeFont(XFontStruct *fs) int nxagentFreeFont(XFontStruct *fs)
{ {
if (fs -> per_char) if (fs -> per_char)
{ {
#ifdef USE_XF86BIGFONT #ifdef USE_XF86BIGFONT
......
...@@ -553,10 +553,11 @@ void nxagentChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl) ...@@ -553,10 +553,11 @@ void nxagentChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
value_mask = KBLed | KBLedMode; value_mask = KBLed | KBLedMode;
for (int i = 1; i <= 32; i++) for (int i = 1; i <= XkbNumIndicators; i++)
{ {
unsigned int mask = (unsigned int)1 << (i - 1);
values.led = i; values.led = i;
values.led_mode = (ctrl->leds & (1 << (i - 1))) ? LedModeOn : LedModeOff; values.led_mode = (ctrl->leds & mask) ? LedModeOn : LedModeOff;
XChangeKeyboardControl(nxagentDisplay, value_mask, &values); XChangeKeyboardControl(nxagentDisplay, value_mask, &values);
} }
...@@ -945,6 +946,10 @@ XkbError: ...@@ -945,6 +946,10 @@ XkbError:
{ {
NXShadowInitKeymap(&(pDev->key->curKeySyms)); NXShadowInitKeymap(&(pDev->key->curKeySyms));
} }
free(rules);
free(variant);
free(options);
} }
if (xkb) if (xkb)
...@@ -1025,11 +1030,18 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -1025,11 +1030,18 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
break; break;
case DEVICE_CLOSE: case DEVICE_CLOSE:
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentKeyboardProc: Called for [DEVICE_CLOSE].\n"); fprintf(stderr, "nxagentKeyboardProc: Called for [DEVICE_CLOSE].\n");
#endif #endif
for (int i = 0; i < pDev->nPrivates; i++)
{
free(pDev->devPrivates[i].ptr);
pDev->devPrivates[i].ptr = NULL;
}
free(pDev->devPrivates);
pDev->devPrivates = NULL;
break; break;
} }
...@@ -1292,8 +1304,6 @@ static int nxagentRestoreKeyboardDeviceData(DeviceIntPtr devBackup, DeviceIntPtr ...@@ -1292,8 +1304,6 @@ static int nxagentRestoreKeyboardDeviceData(DeviceIntPtr devBackup, DeviceIntPtr
static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev) static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
{ {
KbdFeedbackPtr k, knext;
if (!dev) if (!dev)
{ {
#ifdef PANIC #ifdef PANIC
...@@ -1327,14 +1337,18 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev) ...@@ -1327,14 +1337,18 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
dev->focus = NULL; dev->focus = NULL;
} }
for (k = dev->kbdfeed; k; k = knext) if (dev->kbdfeed)
{ {
knext = k->next; for (KbdFeedbackPtr k = dev->kbdfeed, knext; k; k = knext)
#ifdef XKB {
if (k->xkb_sli) knext = k->next;
XkbFreeSrvLedInfo(k->xkb_sli); #ifdef XKB
#endif if (k->xkb_sli)
free(k); XkbFreeSrvLedInfo(k->xkb_sli);
#endif
free(k);
}
dev->kbdfeed = NULL;
} }
#ifdef DEBUG #ifdef DEBUG
...@@ -1683,7 +1697,10 @@ static char* getKeyboardFilePath(void) ...@@ -1683,7 +1697,10 @@ static char* getKeyboardFilePath(void)
free(sessionpath); free(sessionpath);
FatalError("malloc for keyboard file path failed."); FatalError("malloc for keyboard file path failed.");
} }
free(sessionpath); else
{
free(sessionpath);
}
} }
else else
{ {
......
...@@ -1216,7 +1216,7 @@ nxdoListFontsAndAliases(client, fss) ...@@ -1216,7 +1216,7 @@ nxdoListFontsAndAliases(client, fss)
if (c->savedName) if (c->savedName)
{ {
memcpy(tmp,c->savedName,c->savedNameLen>255?255:c->savedNameLen); memcpy(tmp,c->savedName,c->savedNameLen>255?255:c->savedNameLen);
tmp[c->savedNameLen>255?256:c->savedNameLen]=0; tmp[c->savedNameLen>255?255:c->savedNameLen]=0;
if (nxagentFontLookUp(tmp)) if (nxagentFontLookUp(tmp))
break; break;
else tmp[0]=0; else tmp[0]=0;
...@@ -1225,7 +1225,7 @@ nxdoListFontsAndAliases(client, fss) ...@@ -1225,7 +1225,7 @@ nxdoListFontsAndAliases(client, fss)
else else
{ {
memcpy(tmp,name,namelen>255?255:namelen); memcpy(tmp,name,namelen>255?255:namelen);
tmp[namelen>255?256:namelen]=0; tmp[namelen>255?255:namelen]=0;
if (nxagentFontLookUp(tmp)) if (nxagentFontLookUp(tmp))
break; break;
else tmp[0]=0; else tmp[0]=0;
......
...@@ -367,10 +367,8 @@ XYToWindow(int x, int y) ...@@ -367,10 +367,8 @@ XYToWindow(int x, int y)
if (spriteTraceGood >= spriteTraceSize) if (spriteTraceGood >= spriteTraceSize)
{ {
spriteTraceSize += 10; spriteTraceSize += 10;
Must_have_memory = TRUE; /* XXX */ spriteTrace = realloc(
spriteTrace = (WindowPtr *)realloc(
spriteTrace, spriteTraceSize*sizeof(WindowPtr)); spriteTrace, spriteTraceSize*sizeof(WindowPtr));
Must_have_memory = FALSE; /* XXX */
} }
spriteTrace[spriteTraceGood++] = pWin; spriteTrace[spriteTraceGood++] = pWin;
pWin = pWin->firstChild; pWin = pWin->firstChild;
......
...@@ -59,6 +59,67 @@ ...@@ -59,6 +59,67 @@
#endif #endif
GlyphRefPtr
FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare)
{
CARD32 elt, step, s;
GlyphPtr glyph;
GlyphRefPtr table, gr, del;
CARD32 tableSize = hash->hashSet->size;
table = hash->table;
elt = signature % tableSize;
step = 0;
del = 0;
for (;;)
{
gr = &table[elt];
s = gr->signature;
glyph = gr->glyph;
if (!glyph)
{
if (del)
gr = del;
break;
}
if (glyph == DeletedGlyph)
{
if (!del)
del = gr;
else if (gr == del)
break;
}
#ifdef NXAGENT_SERVER
else if (s == signature && match && glyph->size != compare->size)
{
/*
* if the glyphsize is different there's no need to do a memcmp
* because it will surely report difference. And even worse:
* it will read beyond the end of glyph under some
* circumstances, which can be detected when compiling with
* -fsanitize=address.
*/
}
#endif
else if (s == signature &&
(!match ||
memcmp (&compare->info, &glyph->info, compare->size) == 0))
{
break;
}
if (!step)
{
step = signature % hash->hashSet->rehash;
if (!step)
step = 1;
}
elt += step;
if (elt >= tableSize)
elt -= tableSize;
}
return gr;
}
void void
AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id)
{ {
...@@ -138,12 +199,6 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global) ...@@ -138,12 +199,6 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global)
int oldSize; int oldSize;
CARD32 s; CARD32 s;
#ifdef NXAGENT_SERVER
CARD32 c;
#endif
tableEntries = hash->tableEntries + change; tableEntries = hash->tableEntries + change;
hashSet = FindGlyphHashSet (tableEntries); hashSet = FindGlyphHashSet (tableEntries);
if (hashSet == hash->hashSet) if (hashSet == hash->hashSet)
...@@ -164,7 +219,7 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global) ...@@ -164,7 +219,7 @@ ResizeGlyphHash (GlyphHashPtr hash, CARD32 change, Bool global)
#ifdef NXAGENT_SERVER #ifdef NXAGENT_SERVER
c = hash->table[i].corruptedGlyph; CARD32 c = hash->table[i].corruptedGlyph;
#endif #endif
......
...@@ -303,33 +303,25 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error) ...@@ -303,33 +303,25 @@ CreateSolidPicture (Picture pid, xRenderColor *color, int *error)
static PicturePtr createSourcePicture(void) static PicturePtr createSourcePicture(void)
{ {
PicturePtr pPicture;
extern int nxagentPicturePrivateIndex; extern int nxagentPicturePrivateIndex;
unsigned int totalPictureSize;
DevUnion *ppriv;
char *privPictureRecAddr;
int i;
/* /*
* Compute size of entire PictureRect, plus privates. * Compute size of entire PictureRect, plus privates.
*/ */
totalPictureSize = sizeof(PictureRec) + unsigned int totalPictureSize = sizeof(PictureRec) +
picturePrivateCount * sizeof(DevUnion) + picturePrivateCount * sizeof(DevUnion) +
sizeof(nxagentPrivPictureRec); sizeof(nxagentPrivPictureRec);
pPicture = (PicturePtr) calloc(1, totalPictureSize); PicturePtr pPicture = (PicturePtr) calloc(1, totalPictureSize);
if (!pPicture)
return 0;
if (pPicture != NULL) if (pPicture != NULL)
{ {
ppriv = (DevUnion *) (pPicture + 1); DevUnion *ppriv = (DevUnion *) (pPicture + 1);
for (i = 0; i < picturePrivateCount; ++i) for (int i = 0; i < picturePrivateCount; ++i)
{ {
/* /*
* Other privates are inaccessible. * Other privates are inaccessible.
...@@ -338,7 +330,7 @@ static PicturePtr createSourcePicture(void) ...@@ -338,7 +330,7 @@ static PicturePtr createSourcePicture(void)
ppriv[i].ptr = NULL; ppriv[i].ptr = NULL;
} }
privPictureRecAddr = (char *) &ppriv[picturePrivateCount]; char *privPictureRecAddr = (char *) &ppriv[picturePrivateCount];
ppriv[nxagentPicturePrivateIndex].ptr = (void *) privPictureRecAddr; ppriv[nxagentPicturePrivateIndex].ptr = (void *) privPictureRecAddr;
......
...@@ -1004,7 +1004,11 @@ ProcRenderCompositeGlyphs (ClientPtr client) ...@@ -1004,7 +1004,11 @@ ProcRenderCompositeGlyphs (ClientPtr client)
elementsBase = malloc(nlist * sizeof(XGlyphElt8)); elementsBase = malloc(nlist * sizeof(XGlyphElt8));
if (!elementsBase) if (!elementsBase)
return BadAlloc; {
free(glyphsBase);
free(listsBase);
return BadAlloc;
}
buffer = (CARD8 *) (stuff + 1); buffer = (CARD8 *) (stuff + 1);
glyphs = glyphsBase; glyphs = glyphsBase;
......
...@@ -387,8 +387,8 @@ ProcShmPutImage(client) ...@@ -387,8 +387,8 @@ ProcShmPutImage(client)
((stuff->format != ZPixmap) && ((stuff->format != ZPixmap) &&
(stuff->srcX < screenInfo.bitmapScanlinePad) && (stuff->srcX < screenInfo.bitmapScanlinePad) &&
((stuff->format == XYBitmap) || ((stuff->format == XYBitmap) ||
- ((stuff->srcY == 0) && ((stuff->srcY == 0) &&
- (stuff->srcHeight == stuff->totalHeight))))) && (stuff->srcHeight == stuff->totalHeight))))) &&
((stuff->srcX + stuff->srcWidth) == stuff->totalWidth)) ((stuff->srcX + stuff->srcWidth) == stuff->totalWidth))
(*pGC->ops->PutImage) (pDraw, pGC, stuff->depth, (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth,
stuff->dstX, stuff->dstY, stuff->dstX, stuff->dstY,
...@@ -396,7 +396,7 @@ ProcShmPutImage(client) ...@@ -396,7 +396,7 @@ ProcShmPutImage(client)
stuff->srcX, stuff->format, stuff->srcX, stuff->format,
shmdesc->addr + stuff->offset + shmdesc->addr + stuff->offset +
(stuff->srcY * length)); (stuff->srcY * length));
- else else
#endif #endif
{ {
#ifdef TEST #ifdef TEST
......
...@@ -296,7 +296,7 @@ InitRootWindow(WindowPtr pWin) ...@@ -296,7 +296,7 @@ InitRootWindow(WindowPtr pWin)
#ifdef NXAGENT_ARTSD #ifdef NXAGENT_ARTSD
{ {
char artsd_port[10]; char artsd_port[10];
int nPort; short int nPort;
extern void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port); extern void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port);
nPort = atoi(display) + 7000; nPort = atoi(display) + 7000;
sprintf(artsd_port,"%d", nPort); sprintf(artsd_port,"%d", nPort);
......
...@@ -700,7 +700,6 @@ static void nxagentPixmapMatchID(void *p0, XID x1, void *p2) ...@@ -700,7 +700,6 @@ static void nxagentPixmapMatchID(void *p0, XID x1, void *p2)
PixmapPtr nxagentPixmapPtr(Pixmap pixmap) PixmapPtr nxagentPixmapPtr(Pixmap pixmap)
{ {
int i;
struct nxagentPixmapPair pair; struct nxagentPixmapPair pair;
if (pixmap == None) if (pixmap == None)
...@@ -714,7 +713,7 @@ PixmapPtr nxagentPixmapPtr(Pixmap pixmap) ...@@ -714,7 +713,7 @@ PixmapPtr nxagentPixmapPtr(Pixmap pixmap)
FindClientResourcesByType(clients[serverClient -> index], RT_NX_PIXMAP, FindClientResourcesByType(clients[serverClient -> index], RT_NX_PIXMAP,
nxagentPixmapMatchID, &pair); nxagentPixmapMatchID, &pair);
for (i = 0; (pair.pMap == NULL) && (i < MAXCLIENTS); i++) for (int i = 0; (pair.pMap == NULL) && (i < MAXCLIENTS); i++)
{ {
if (clients[i]) if (clients[i])
{ {
...@@ -790,8 +789,8 @@ void nxagentDisconnectPixmap(void *p0, XID x1, void *p2) ...@@ -790,8 +789,8 @@ void nxagentDisconnectPixmap(void *p0, XID x1, void *p2)
Bool nxagentDisconnectAllPixmaps(void) Bool nxagentDisconnectAllPixmaps(void)
{ {
int r = 1;
int i; int i;
int r = 1;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentDisconnectAllPixmaps: Going to iterate through pixmap resources.\n"); fprintf(stderr, "nxagentDisconnectAllPixmaps: Going to iterate through pixmap resources.\n");
...@@ -958,8 +957,6 @@ Bool nxagentReconnectAllPixmaps(void *p0) ...@@ -958,8 +957,6 @@ Bool nxagentReconnectAllPixmaps(void *p0)
{ {
Bool result = 1; Bool result = 1;
int i;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentReconnectAllPixmaps: Going to recreate all pixmaps.\n"); fprintf(stderr, "nxagentReconnectAllPixmaps: Going to recreate all pixmaps.\n");
#endif #endif
...@@ -991,7 +988,7 @@ Bool nxagentReconnectAllPixmaps(void *p0) ...@@ -991,7 +988,7 @@ Bool nxagentReconnectAllPixmaps(void *p0)
#endif #endif
for (i = 0, result = 1; i < MAXCLIENTS; result = 1, i++) for (int i = 0, result = 1; i < MAXCLIENTS; result = 1, i++)
{ {
if (clients[i] != NULL) if (clients[i] != NULL)
{ {
...@@ -1138,10 +1135,9 @@ Bool nxagentCheckPixmapIntegrity(PixmapPtr pPixmap) ...@@ -1138,10 +1135,9 @@ Bool nxagentCheckPixmapIntegrity(PixmapPtr pPixmap)
if (!integrity) if (!integrity)
{ {
int i;
char *p, *q; char *p, *q;
for (i = 0, p = image -> data, q = data; i < length; i++) for (int i = 0, p = image -> data, q = data; i < length; i++)
{ {
if (p[i] != q[i]) if (p[i] != q[i])
{ {
...@@ -1187,7 +1183,6 @@ Bool nxagentCheckPixmapIntegrity(PixmapPtr pPixmap) ...@@ -1187,7 +1183,6 @@ Bool nxagentCheckPixmapIntegrity(PixmapPtr pPixmap)
Bool nxagentCheckAllPixmapIntegrity(void) Bool nxagentCheckAllPixmapIntegrity(void)
{ {
int i;
Bool imageIsGood = True; Bool imageIsGood = True;
#ifdef TEST #ifdef TEST
...@@ -1197,7 +1192,7 @@ Bool nxagentCheckAllPixmapIntegrity(void) ...@@ -1197,7 +1192,7 @@ Bool nxagentCheckAllPixmapIntegrity(void)
FindClientResourcesByType(clients[serverClient -> index], RT_NX_PIXMAP, FindClientResourcesByType(clients[serverClient -> index], RT_NX_PIXMAP,
nxagentCheckOnePixmapIntegrity, &imageIsGood); nxagentCheckOnePixmapIntegrity, &imageIsGood);
for (i = 0; (i < MAXCLIENTS) && (imageIsGood); i++) for (int i = 0; (i < MAXCLIENTS) && (imageIsGood); i++)
{ {
if (clients[i]) if (clients[i])
{ {
...@@ -1355,7 +1350,7 @@ Bool nxagentPixmapOnShadowDisplay(PixmapPtr pMap) ...@@ -1355,7 +1350,7 @@ Bool nxagentPixmapOnShadowDisplay(PixmapPtr pMap)
/* /*
FIXME: If the pixmap has a different depth from the window, the FIXME: If the pixmap has a different depth from the window, the
XPutImage returns a BadMatch. For example this may happens if XPutImage returns a BadMatch. For example this may happen if
the Render extension is enabled. the Render extension is enabled.
Can we fix this creating a new pixmap? Can we fix this creating a new pixmap?
*/ */
...@@ -1372,7 +1367,7 @@ FIXME: If the pixmap has a different depth from the window, the ...@@ -1372,7 +1367,7 @@ FIXME: If the pixmap has a different depth from the window, the
/* /*
* If the framebuffer is updated continuously, the nxagent * If the framebuffer is updated continuously, the nxagent
* visualization become too much slow. * visualization becomes much too slow.
*/ */
if ((GetTimeInMillis() - showTime) < 500) if ((GetTimeInMillis() - showTime) < 500)
...@@ -1630,11 +1625,10 @@ void nxagentPrintResourcePredicate(void *value, XID id, XID type, void *cdata) ...@@ -1630,11 +1625,10 @@ void nxagentPrintResourcePredicate(void *value, XID id, XID type, void *cdata)
void nxagentPrintResources(void) void nxagentPrintResources(void)
{ {
Bool result; Bool result;
int i;
nxagentPrintResourceTypes(); nxagentPrintResourceTypes();
for (i = 0; i < MAXCLIENTS; i++) for (int i = 0; i < MAXCLIENTS; i++)
{ {
if (clients[i]) if (clients[i])
{ {
......
...@@ -40,7 +40,7 @@ is" without express or implied warranty. ...@@ -40,7 +40,7 @@ is" without express or implied warranty.
#include "X.h" #include "X.h"
#include "Xproto.h" #include "Xproto.h"
#include "screenint.h" #include "screenint.h"
#include "input.h" #include "inputstr.h"
#include "misc.h" #include "misc.h"
#include "scrnintstr.h" #include "scrnintstr.h"
#include "servermd.h" #include "servermd.h"
...@@ -162,11 +162,18 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) ...@@ -162,11 +162,18 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
break; break;
case DEVICE_CLOSE: case DEVICE_CLOSE:
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentPointerProc: Called for [DEVICE_CLOSE].\n"); fprintf(stderr, "nxagentPointerProc: Called for [DEVICE_CLOSE].\n");
#endif #endif
for (int i = 0; i < pDev->nPrivates; i++)
{
free(pDev->devPrivates[i].ptr);
pDev->devPrivates[i].ptr = NULL;
}
free(pDev->devPrivates);
pDev->devPrivates = NULL;
break; break;
} }
......
...@@ -120,12 +120,10 @@ static void nxagentPrintRootlessTopLevelWindowMap(void); ...@@ -120,12 +120,10 @@ static void nxagentPrintRootlessTopLevelWindowMap(void);
void nxagentPrintRootlessTopLevelWindowMap(void) void nxagentPrintRootlessTopLevelWindowMap(void)
{ {
int i;
fprintf(stderr, "nxagentPrintRootlessTopLevelWindowMap: Map size is [%d] num of entry [%d].\n", fprintf(stderr, "nxagentPrintRootlessTopLevelWindowMap: Map size is [%d] num of entry [%d].\n",
topLevelParentMap.size, topLevelParentMap.next); topLevelParentMap.size, topLevelParentMap.next);
for (i = 0; i < topLevelParentMap.next; i++) for (int i = 0; i < topLevelParentMap.next; i++)
{ {
fprintf(stderr, "nxagentPrintRootlessTopLevelWindowMap: [%d] pWin at [%p] XID at [%ld].\n", fprintf(stderr, "nxagentPrintRootlessTopLevelWindowMap: [%d] pWin at [%p] XID at [%ld].\n",
i, (void *) topLevelParentMap.elt[i].pWin, (long int) topLevelParentMap.elt[i].xid); i, (void *) topLevelParentMap.elt[i].pWin, (long int) topLevelParentMap.elt[i].xid);
...@@ -136,9 +134,7 @@ void nxagentPrintRootlessTopLevelWindowMap(void) ...@@ -136,9 +134,7 @@ void nxagentPrintRootlessTopLevelWindowMap(void)
void nxagentRootlessAddTopLevelWindow(WindowPtr pWin, Window w) void nxagentRootlessAddTopLevelWindow(WindowPtr pWin, Window w)
{ {
int i; for (int i = 0; i < topLevelParentMap.next; i++)
for (i = 0; i < topLevelParentMap.next; i++)
{ {
if (topLevelParentMap.elt[i].pWin == pWin) if (topLevelParentMap.elt[i].pWin == pWin)
{ {
...@@ -181,9 +177,7 @@ void nxagentRootlessAddTopLevelWindow(WindowPtr pWin, Window w) ...@@ -181,9 +177,7 @@ void nxagentRootlessAddTopLevelWindow(WindowPtr pWin, Window w)
WindowPtr nxagentRootlessTopLevelWindow(Window w) WindowPtr nxagentRootlessTopLevelWindow(Window w)
{ {
int i; for (int i = 0; i < topLevelParentMap.next; i++)
for (i = 0; i < topLevelParentMap.next; i++)
{ {
if (w == topLevelParentMap.elt[i].xid) if (w == topLevelParentMap.elt[i].xid)
{ {
...@@ -196,9 +190,7 @@ WindowPtr nxagentRootlessTopLevelWindow(Window w) ...@@ -196,9 +190,7 @@ WindowPtr nxagentRootlessTopLevelWindow(Window w)
void nxagentRootlessDelTopLevelWindow(WindowPtr pWin) void nxagentRootlessDelTopLevelWindow(WindowPtr pWin)
{ {
int i; for (int i = 0; i < topLevelParentMap.next; i++)
for (i = 0; i < topLevelParentMap.next; i++)
{ {
if (pWin == topLevelParentMap.elt[i].pWin) if (pWin == topLevelParentMap.elt[i].pWin)
{ {
...@@ -485,7 +477,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -485,7 +477,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentExportProperty: WARNING! Ignored ChangeProperty " fprintf(stderr, "nxagentExportProperty: WARNING! Ignored ChangeProperty "
"on %swindow %lx property %s type %s nUnits %ld format %d\n", "on %swindow [0x%lx] property [%s] type [%s] nUnits [%ld] format [%d]\n",
nxagentWindowTopLevel(pWin) ? "toplevel " : "", nxagentWindow(pWin), nxagentWindowTopLevel(pWin) ? "toplevel " : "", nxagentWindow(pWin),
validateString(propertyS), validateString(typeS), nUnits, format); validateString(propertyS), validateString(typeS), nUnits, format);
#endif #endif
...@@ -506,7 +498,6 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -506,7 +498,6 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
/* FIXME: is it okay here to ignore malloc fails? */ /* FIXME: is it okay here to ignore malloc fails? */
unsigned long *buffer = malloc(nUnits * sizeof(*buffer)); unsigned long *buffer = malloc(nUnits * sizeof(*buffer));
int *input = value; int *input = value;
int i;
if (buffer) if (buffer)
{ {
...@@ -514,7 +505,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -514,7 +505,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
export = True; export = True;
output = (char*) buffer; output = (char*) buffer;
for (i = 0; i < nUnits; i++) for (int i = 0; i < nUnits; i++)
{ {
buffer[i] = input[i]; buffer[i] = input[i];
} }
...@@ -565,8 +556,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -565,8 +556,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
propHints.flags &= ~IconPixmapHint; propHints.flags &= ~IconPixmapHint;
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon pixmap %x from hint " fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon pixmap [0x%x] from hint "
"exporting property %s type %s on window %p.\n", "exporting property [%s] type [%s] on window [%p].\n",
(unsigned int) wmHints.icon_pixmap, propertyS, typeS, (unsigned int) wmHints.icon_pixmap, propertyS, typeS,
(void *) pWin); (void *) pWin);
#endif #endif
...@@ -587,8 +578,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -587,8 +578,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
propHints.flags &= ~IconWindowHint; propHints.flags &= ~IconWindowHint;
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon window %x from hint " fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon window [0x%x] from hint "
"exporting property %s type %s on window %p.\n", "exporting property [%s] type [%s] on window [%p].\n",
(unsigned int) wmHints.icon_window, propertyS, typeS, (unsigned int) wmHints.icon_window, propertyS, typeS,
(void *) pWin); (void *) pWin);
#endif #endif
...@@ -609,8 +600,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -609,8 +600,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
propHints.flags &= ~IconMaskHint; propHints.flags &= ~IconMaskHint;
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon mask %x from hint " fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon mask [0x%x] from hint "
"exporting property %s type %s on window %p.\n", "exporting property [%s] type [%s] on window [%p].\n",
(unsigned int) wmHints.icon_mask, propertyS, typeS, (unsigned int) wmHints.icon_mask, propertyS, typeS,
(void *) pWin); (void *) pWin);
#endif #endif
...@@ -631,8 +622,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -631,8 +622,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
propHints.flags &= ~WindowGroupHint; propHints.flags &= ~WindowGroupHint;
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up window group %x from hint " fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up window group [0x%x] from hint "
"exporting property %s type %s on window %p.\n", "exporting property [%s] type [%s] on window [%p].\n",
(unsigned int) wmHints.window_group, propertyS, typeS, (unsigned int) wmHints.window_group, propertyS, typeS,
(void *) pWin); (void *) pWin);
#endif #endif
...@@ -644,13 +635,12 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -644,13 +635,12 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
XlibAtom *atoms = malloc(nUnits * sizeof(*atoms)); XlibAtom *atoms = malloc(nUnits * sizeof(*atoms));
Atom *input = value; Atom *input = value;
const char *atomName = NULL; const char *atomName = NULL;
int i;
int j = 0; int j = 0;
if (!atoms) if (!atoms)
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! malloc() failed for '%s'- bailing out.\n", typeS); fprintf(stderr, "nxagentExportProperty: WARNING! malloc() failed for '[%s]'- bailing out.\n", typeS);
#endif #endif
return False; return False;
} }
...@@ -659,7 +649,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -659,7 +649,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
export = True; export = True;
output = (char *) atoms; output = (char *) atoms;
for (i = 0; i < nUnits; i++) for (int i = 0; i < nUnits; i++)
{ {
/* /*
* Exporting the _NET_WM_PING property could * Exporting the _NET_WM_PING property could
...@@ -679,7 +669,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -679,7 +669,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
if (atoms[j] == None) if (atoms[j] == None)
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to convert local atom %ld [%s].\n", fprintf(stderr, "nxagentExportProperty: WARNING! Failed to convert local atom [%ld] [%s].\n",
(long int) input[i], validateString(atomName)); (long int) input[i], validateString(atomName));
#endif #endif
} }
...@@ -703,12 +693,11 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -703,12 +693,11 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
XlibWindow *wind = malloc(nUnits * sizeof(*wind)); XlibWindow *wind = malloc(nUnits * sizeof(*wind));
ClientPtr pClient = wClient(pWin); ClientPtr pClient = wClient(pWin);
WindowPtr pWindow; WindowPtr pWindow;
int i;
if (!wind) if (!wind)
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! malloc() failed for '%s' - bailing out.\n", typeS); fprintf(stderr, "nxagentExportProperty: WARNING! malloc() failed for '[%s]' - bailing out.\n", typeS);
#endif #endif
return False; return False;
} }
...@@ -717,7 +706,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -717,7 +706,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
export = True; export = True;
output = (char*) wind; output = (char*) wind;
for (i = 0; i < nUnits; i++) for (int i = 0; i < nUnits; i++)
{ {
pWindow = (WindowPtr)SecurityLookupWindow(input[i], pClient, pWindow = (WindowPtr)SecurityLookupWindow(input[i], pClient,
DixDestroyAccess); DixDestroyAccess);
...@@ -728,8 +717,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -728,8 +717,8 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
else else
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up window %ld " fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up window [%ld] "
"exporting property %s type %s on window %p.\n", "exporting property [%s] type [%s] on window [%p].\n",
(long int) input[i], propertyS, typeS, (void *) pWin); (long int) input[i], propertyS, typeS, (void *) pWin);
#endif #endif
...@@ -774,15 +763,14 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -774,15 +763,14 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
} }
else if (mode == PropModeReplace) else if (mode == PropModeReplace)
{ {
int n; char * data = (char *) output;
char *data;
XDeleteProperty(nxagentDisplay, nxagentWindow(pWin), propertyX); XDeleteProperty(nxagentDisplay, nxagentWindow(pWin), propertyX);
data = (char *) output;
while (nUnits > 0) while (nUnits > 0)
{ {
int n;
if ((format >> 3) * nUnits + sizeof(xChangePropertyReq) < if ((format >> 3) * nUnits + sizeof(xChangePropertyReq) <
(MAX_REQUEST_SIZE << 2)) (MAX_REQUEST_SIZE << 2))
{ {
...@@ -819,7 +807,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -819,7 +807,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentExportProperty: WARNING! Ignored ChangeProperty " fprintf(stderr, "nxagentExportProperty: WARNING! Ignored ChangeProperty "
"on %swindow %x property %s type %s nUnits %ld format %d\n", "on %swindow [0x%x] property [%s] type [%s] nUnits [%ld] format [%d]\n",
nxagentWindowTopLevel(pWin) ? "toplevel " : "", nxagentWindowTopLevel(pWin) ? "toplevel " : "",
nxagentWindow(pWin), validateString(propertyS), validateString(typeS), nxagentWindow(pWin), validateString(propertyS), validateString(typeS),
nUnits, format); nUnits, format);
...@@ -866,7 +854,7 @@ void nxagentImportProperty(Window window, ...@@ -866,7 +854,7 @@ void nxagentImportProperty(Window window,
if (pWin == NULL) if (pWin == NULL)
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentImportProperty: Failed to look up remote window %lx property [%ld] exiting.\n", fprintf(stderr, "nxagentImportProperty: Failed to look up remote window [0x%lx] property [%ld] exiting.\n",
window, property); window, property);
#endif #endif
...@@ -885,7 +873,7 @@ void nxagentImportProperty(Window window, ...@@ -885,7 +873,7 @@ void nxagentImportProperty(Window window,
} }
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentImportProperty: Window %lx property [%ld]: %s\n", fprintf(stderr, "nxagentImportProperty: Window [0x%lx] property [%ld]: [%s]\n",
window, property, validateString(NameForAtom(propertyL))); window, property, validateString(NameForAtom(propertyL)));
#endif #endif
...@@ -900,7 +888,7 @@ void nxagentImportProperty(Window window, ...@@ -900,7 +888,7 @@ void nxagentImportProperty(Window window,
if (buffer == NULL && (nitems > 0)) if (buffer == NULL && (nitems > 0))
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentImportProperty: Failed to retrieve remote property [%ld] %s on Window %ld\n", fprintf(stderr, "nxagentImportProperty: Failed to retrieve remote property [%ld] [%s] on Window [%ld]\n",
(long int) property, validateString(NameForAtom(propertyL)), (long int) window); (long int) property, validateString(NameForAtom(propertyL)), (long int) window);
#endif #endif
} }
...@@ -956,8 +944,8 @@ void nxagentImportProperty(Window window, ...@@ -956,8 +944,8 @@ void nxagentImportProperty(Window window,
else if (wmState.icon) else if (wmState.icon)
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! Failed to convert remote window %ld" fprintf(stderr, "nxagentImportProperty: WARNING! Failed to convert remote window [%ld]"
" importing property %ld of type WM_STATE", (long int) wmState.icon, " importing property [%ld] of type WM_STATE", (long int) wmState.icon,
(long int) property); (long int) property);
#endif #endif
} }
...@@ -982,7 +970,7 @@ void nxagentImportProperty(Window window, ...@@ -982,7 +970,7 @@ void nxagentImportProperty(Window window,
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote icon " fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote icon "
"pixmap %d from hint importing property [%ld] type %s on window %p.\n", "pixmap [%d] from hint importing property [%ld] type [%s] on window [%p].\n",
(unsigned int) wmHints.icon_pixmap, (long int) property, (unsigned int) wmHints.icon_pixmap, (long int) property,
typeS, (void *) pWin); typeS, (void *) pWin);
#endif #endif
...@@ -1003,7 +991,7 @@ void nxagentImportProperty(Window window, ...@@ -1003,7 +991,7 @@ void nxagentImportProperty(Window window,
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote icon " fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote icon "
"window %x from hint importing property [%ld] type %s on window %p.\n", "window [0x%x] from hint importing property [%ld] type [%s] on window [%p].\n",
(unsigned int) wmHints.icon_window, (unsigned int) wmHints.icon_window,
(long int) property, typeS, (void *) pWin); (long int) property, typeS, (void *) pWin);
#endif #endif
...@@ -1024,7 +1012,7 @@ void nxagentImportProperty(Window window, ...@@ -1024,7 +1012,7 @@ void nxagentImportProperty(Window window,
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote icon " fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote icon "
"mask %x from hint importing property [%ld] type %s on window %p.\n", "mask [0x%x] from hint importing property [%ld] type [%s] on window [%p].\n",
(unsigned int) wmHints.icon_mask, (long int) property, typeS, (void *) pWin); (unsigned int) wmHints.icon_mask, (long int) property, typeS, (void *) pWin);
#endif #endif
} }
...@@ -1044,7 +1032,7 @@ void nxagentImportProperty(Window window, ...@@ -1044,7 +1032,7 @@ void nxagentImportProperty(Window window,
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote window " fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote window "
"group %x from hint importing property [%ld] type %s on window %p.\n", "group [0x%x] from hint importing property [%ld] type [%s] on window [%p].\n",
(unsigned int) wmHints.window_group, (unsigned int) wmHints.window_group,
(long int) property, typeS, (void *) pWin); (long int) property, typeS, (void *) pWin);
#endif #endif
...@@ -1055,12 +1043,11 @@ void nxagentImportProperty(Window window, ...@@ -1055,12 +1043,11 @@ void nxagentImportProperty(Window window,
{ {
Atom *atoms = malloc(nitems * sizeof(Atom)); Atom *atoms = malloc(nitems * sizeof(Atom));
Atom *input = (Atom*) buffer; Atom *input = (Atom*) buffer;
int i;
if (atoms == NULL) if (atoms == NULL)
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! malloc() failed for '%s' - bailing out.\n", typeS); fprintf(stderr, "nxagentImportProperty: WARNING! malloc() failed for '[%s]' - bailing out.\n", typeS);
#endif #endif
return; return;
...@@ -1070,14 +1057,14 @@ void nxagentImportProperty(Window window, ...@@ -1070,14 +1057,14 @@ void nxagentImportProperty(Window window,
import = True; import = True;
output = (char *) atoms; output = (char *) atoms;
for (i = 0; i < nitems; i++) for (int i = 0; i < nitems; i++)
{ {
atoms[i] = nxagentRemoteToLocalAtom(input[i]); atoms[i] = nxagentRemoteToLocalAtom(input[i]);
if (atoms[i] == None) if (atoms[i] == None)
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! Failed to convert remote atom %ld.\n", fprintf(stderr, "nxagentImportProperty: WARNING! Failed to convert remote atom [%ld].\n",
(long int) input[i]); (long int) input[i]);
#endif #endif
} }
...@@ -1088,12 +1075,11 @@ void nxagentImportProperty(Window window, ...@@ -1088,12 +1075,11 @@ void nxagentImportProperty(Window window,
Window *input = (Window*) buffer; Window *input = (Window*) buffer;
Window *wind = malloc(nitems * sizeof(Window)); Window *wind = malloc(nitems * sizeof(Window));
WindowPtr pWindow; WindowPtr pWindow;
int i;
if (!wind) if (!wind)
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! malloc() failed for '%s' - bailing out.\n", typeS); fprintf(stderr, "nxagentImportProperty: WARNING! malloc() failed for '[%s]' - bailing out.\n", typeS);
#endif #endif
return; return;
...@@ -1102,7 +1088,7 @@ void nxagentImportProperty(Window window, ...@@ -1102,7 +1088,7 @@ void nxagentImportProperty(Window window,
import = True; import = True;
output = (char*) wind; output = (char*) wind;
for (i = 0; i < nitems; i++) for (int i = 0; i < nitems; i++)
{ {
pWindow = nxagentWindowPtr(input[i]); pWindow = nxagentWindowPtr(input[i]);
...@@ -1113,8 +1099,8 @@ void nxagentImportProperty(Window window, ...@@ -1113,8 +1099,8 @@ void nxagentImportProperty(Window window,
else else
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote window %lx " fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote window [0x%lx] "
"importing property [%ld] type %s on window %p.\n", "importing property [%ld] type [%s] on window [%p].\n",
(long int) input[i], (long int) property, typeS, (void*)pWin); (long int) input[i], (long int) property, typeS, (void*)pWin);
#endif #endif
...@@ -1127,7 +1113,7 @@ void nxagentImportProperty(Window window, ...@@ -1127,7 +1113,7 @@ void nxagentImportProperty(Window window,
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentImportProperty: ChangeProperty " fprintf(stderr, "nxagentImportProperty: ChangeProperty "
"on window %lx property [%ld] type %s nitems %ld format %d\n", "on window [0x%lx] property [%ld] type [%s] nitems [%ld] format [%d]\n",
window, property, typeS, nitems, format); window, property, typeS, nitems, format);
#endif #endif
...@@ -1138,7 +1124,7 @@ void nxagentImportProperty(Window window, ...@@ -1138,7 +1124,7 @@ void nxagentImportProperty(Window window,
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentImportProperty: WARNING! Ignored ChangeProperty " fprintf(stderr, "nxagentImportProperty: WARNING! Ignored ChangeProperty "
"on window %lx property [%ld] type %s ntems %ld format %d\n", "on window [0x%lx] property [%ld] type [%s] ntems [%ld] format [%d]\n",
window, property, validateString(typeS), nitems, format); window, property, validateString(typeS), nitems, format);
#endif #endif
} }
...@@ -1183,7 +1169,7 @@ void nxagentRemovePropertyFromList(void) ...@@ -1183,7 +1169,7 @@ void nxagentRemovePropertyFromList(void)
struct nxagentPropertyRec *tmp = nxagentPropertyList.first; struct nxagentPropertyRec *tmp = nxagentPropertyList.first;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentRemovePropertyFromList: Property %ld on Window %lx to list, list size is %d.\n\n", fprintf(stderr, "nxagentRemovePropertyFromList: Property [%ld] on Window [0x%lx] to list, list size is [%d].\n\n",
nxagentPropertyList.first -> property, nxagentPropertyList.first -> window, nxagentPropertyList.first -> property, nxagentPropertyList.first -> window,
nxagentPropertyList.size); nxagentPropertyList.size);
#endif #endif
...@@ -1220,8 +1206,8 @@ void nxagentAddPropertyToList(Atom property, WindowPtr pWin) ...@@ -1220,8 +1206,8 @@ void nxagentAddPropertyToList(Atom property, WindowPtr pWin)
} }
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentAddPropertyToList: Adding record Property %ld - Window %lx[%p]" fprintf(stderr, "nxagentAddPropertyToList: Adding record Property [%ld] - Window [0x%lx][%p]"
"to list, list size is %d.\n", property, nxagentWindow(pWin), (void*) pWin, "to list, list size is [%d].\n", property, nxagentWindow(pWin), (void*) pWin,
nxagentPropertyList.size); nxagentPropertyList.size);
#endif #endif
...@@ -1262,12 +1248,12 @@ Bool nxagentNotifyMatchChangeProperty(void *p) ...@@ -1262,12 +1248,12 @@ Bool nxagentNotifyMatchChangeProperty(void *p)
XPropertyEvent *X = p; XPropertyEvent *X = p;
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentNotifyMatchChangeProperty: Property notify on window %lx property %ld.\n", fprintf(stderr, "nxagentNotifyMatchChangeProperty: Property notify on window [0x%lx] property [%ld].\n",
X -> window, X -> atom); X -> window, X -> atom);
if (first) if (first)
{ {
fprintf(stderr, "nxagentNotifyMatchChangeProperty: First element on list is window %lx property %ld list size is %d.\n", fprintf(stderr, "nxagentNotifyMatchChangeProperty: First element on list is window [0x%lx] property [%ld] list size is [%d].\n",
first -> window, first -> property, nxagentPropertyList.size); first -> window, first -> property, nxagentPropertyList.size);
} }
else else
......
...@@ -844,6 +844,19 @@ static int nxagentColorOffset(unsigned long mask) ...@@ -844,6 +844,19 @@ static int nxagentColorOffset(unsigned long mask)
return count; return count;
} }
void freeDepths(DepthPtr depths, int num)
{
for (int i = 0; i < num; i++)
{
#ifdef DEBUG
fprintf(stderr, "%s: freeing depth [%d] index [%d] vids [%p]\n", __func__, depths[i].depth, i, (void*) depths[i].vids);
#endif
free(depths[i].vids);
depths[i].vids = NULL;
}
free(depths);
}
Bool nxagentOpenScreen(ScreenPtr pScreen, Bool nxagentOpenScreen(ScreenPtr pScreen,
int argc, char *argv[]) int argc, char *argv[])
{ {
...@@ -1335,6 +1348,8 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -1335,6 +1348,8 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
if (!pFrameBufferBits) if (!pFrameBufferBits)
{ {
freeDepths(depths, numDepths);
free(visuals);
return FALSE; return FALSE;
} }
...@@ -1356,6 +1371,8 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -1356,6 +1371,8 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
if (!fbScreenInit(pScreen, pFrameBufferBits, nxagentOption(RootWidth), nxagentOption(RootHeight), if (!fbScreenInit(pScreen, pFrameBufferBits, nxagentOption(RootWidth), nxagentOption(RootHeight),
monitorResolution, monitorResolution, PixmapBytePad(nxagentOption(RootWidth), rootDepth), bitsPerPixel)) monitorResolution, monitorResolution, PixmapBytePad(nxagentOption(RootWidth), rootDepth), bitsPerPixel))
{ {
freeDepths(depths, numDepths);
free(visuals);
return FALSE; return FALSE;
} }
...@@ -1391,22 +1408,15 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, ...@@ -1391,22 +1408,15 @@ Bool nxagentOpenScreen(ScreenPtr pScreen,
* by fbScreenInit with our own. * by fbScreenInit with our own.
*/ */
free(pScreen -> visuals); freeDepths(pScreen->allowedDepths, pScreen->numDepths);
free(pScreen -> allowedDepths);
pScreen -> visuals = visuals;
pScreen -> allowedDepths = depths; pScreen -> allowedDepths = depths;
pScreen -> numVisuals = numVisuals;
pScreen -> numDepths = numDepths; pScreen -> numDepths = numDepths;
pScreen -> rootVisual = defaultVisual;
pScreen -> rootDepth = rootDepth; pScreen -> rootDepth = rootDepth;
/* free(pScreen -> visuals);
* Complete the initialization of the RANDR pScreen -> visuals = visuals;
* extension. pScreen -> numVisuals = numVisuals;
*/ pScreen -> rootVisual = defaultVisual;
nxagentInitRandRExtension(pScreen);
/* /*
* Set up the internal structures used for * Set up the internal structures used for
...@@ -1694,6 +1704,13 @@ N/A ...@@ -1694,6 +1704,13 @@ N/A
nxagentOption(Height)) / 32) nxagentOption(Height)) / 32)
} }
/*
* Complete the initialization of the RANDR
* extension.
*/
nxagentInitRandRExtension(pScreen);
#ifdef TEST #ifdef TEST
nxagentPrintAgentGeometry(NULL, "nxagentOpenScreen:"); nxagentPrintAgentGeometry(NULL, "nxagentOpenScreen:");
#endif #endif
...@@ -2135,26 +2152,31 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -2135,26 +2152,31 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
Bool nxagentCloseScreen(ScreenPtr pScreen) Bool nxagentCloseScreen(ScreenPtr pScreen)
{ {
int i;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "running nxagentCloseScreen()\n"); fprintf(stderr, "running nxagentCloseScreen()\n");
#endif #endif
for (i = 0; i < pScreen->numDepths; i++) /*
{ * We have called fbScreenInit() in nxagenOpenScreen, which in turn
free(pScreen->allowedDepths[i].vids); * called fbOpenScreen. But we are not using the data as created by
} * fbOpenScreen but have freed it and replaced by our own. So we free
* our own stuff here and take care that fbCloseScreen will not free
* them again.
*/
freeDepths(pScreen->allowedDepths, pScreen->numDepths);
pScreen->allowedDepths = NULL;
pScreen->numDepths = 0;
/* /*
* Free the frame buffer. * Free the frame buffer.
*/ */
free(((PixmapPtr)pScreen -> devPrivate) -> devPrivate.ptr); free(((PixmapPtr)pScreen -> devPrivate) -> devPrivate.ptr);
free(pScreen->devPrivate);pScreen->devPrivate = NULL;
free(pScreen->visuals); pScreen->visuals = NULL;
free(pScreen->allowedDepths); fbCloseScreen(pScreen);
free(pScreen->visuals);
free(pScreen->devPrivate);
/* /*
* Reset the geometry and alpha information * Reset the geometry and alpha information
......
...@@ -727,7 +727,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y) ...@@ -727,7 +727,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y)
(void *) pWin, nxagentWindow(pWin), x, y); (void *) pWin, nxagentWindow(pWin), x, y);
#endif #endif
nxagentAddConfiguredWindow(pWin, CWParent | CWX | CWY | CWWidth | nxagentAddConfiguredWindow(pWin, CWSibling | CWX | CWY | CWWidth |
CWHeight | CWBorderWidth); CWHeight | CWBorderWidth);
return True; return True;
...@@ -1284,7 +1284,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) ...@@ -1284,7 +1284,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
{ {
if (mask & CW_RootlessRestack) if (mask & CW_RootlessRestack)
{ {
mask = CWStackingOrder; mask = CWStackMode;
} }
} }
...@@ -1299,7 +1299,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) ...@@ -1299,7 +1299,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
if (mask & CW_Update) if (mask & CW_Update)
{ {
mask |= CWX | CWY | CWWidth | CWHeight | CWBorderWidth | CWStackingOrder; mask |= CWX | CWY | CWWidth | CWHeight | CWBorderWidth | CWStackMode;
} }
if (mask & CWX) if (mask & CWX)
...@@ -1378,7 +1378,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) ...@@ -1378,7 +1378,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
MAKE_SYNC_CONFIGURE_WINDOW; MAKE_SYNC_CONFIGURE_WINDOW;
} }
if (mask & CWStackingOrder && if (mask & CWStackMode &&
nxagentWindowPriv(pWin)->siblingAbove != nxagentWindowSiblingAbove(pWin)) nxagentWindowPriv(pWin)->siblingAbove != nxagentWindowSiblingAbove(pWin))
{ {
WindowPtr pSib; WindowPtr pSib;
...@@ -1478,7 +1478,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) ...@@ -1478,7 +1478,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
* really needed? * really needed?
* *
* *
* else if (mask & CWStackingOrder) * else if (mask & CWStackMode)
* { * {
* if (nxagentSplashWindow) * if (nxagentSplashWindow)
* { * {
...@@ -1920,12 +1920,12 @@ Bool nxagentRealizeWindow(WindowPtr pWin) ...@@ -1920,12 +1920,12 @@ Bool nxagentRealizeWindow(WindowPtr pWin)
/* /*
* Not needed. * Not needed.
* *
* nxagentConfigureWindow(pWin, CWStackingOrder); * nxagentConfigureWindow(pWin, CWStackMode);
* *
* nxagentFlushConfigureWindow(); * nxagentFlushConfigureWindow();
*/ */
nxagentAddConfiguredWindow(pWin, CWStackingOrder); nxagentAddConfiguredWindow(pWin, CWStackMode);
nxagentAddConfiguredWindow(pWin, CW_Shape); nxagentAddConfiguredWindow(pWin, CW_Shape);
/* add by dimbor */ /* add by dimbor */
...@@ -1942,20 +1942,6 @@ Bool nxagentRealizeWindow(WindowPtr pWin) ...@@ -1942,20 +1942,6 @@ Bool nxagentRealizeWindow(WindowPtr pWin)
#endif #endif
*/ */
/*
* Mapping of the root window is called by
* InitRootWindow in DIX. Skip the operation
* if we are in rootless mode.
*/
/*
* if (!nxagentOption(Rootless) ||
* nxagentRootlessWindow != pWin)
* {
* XMapWindow(nxagentDisplay, nxagentWindow(pWin));
* }
*/
#ifdef TEST #ifdef TEST
if (nxagentOption(Rootless) && nxagentLastWindowDestroyed) if (nxagentOption(Rootless) && nxagentLastWindowDestroyed)
{ {
...@@ -2130,10 +2116,10 @@ void nxagentCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion) ...@@ -2130,10 +2116,10 @@ void nxagentCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion)
void nxagentClipNotify(WindowPtr pWin, int dx, int dy) void nxagentClipNotify(WindowPtr pWin, int dx, int dy)
{ {
/* /*
* nxagentConfigureWindow(pWin, CWStackingOrder); * nxagentConfigureWindow(pWin, CWStackMode);
*/ */
nxagentAddConfiguredWindow(pWin, CWStackingOrder); nxagentAddConfiguredWindow(pWin, CWStackMode);
nxagentAddConfiguredWindow(pWin, CW_Shape); nxagentAddConfiguredWindow(pWin, CW_Shape);
#ifndef NXAGENT_SHAPE #ifndef NXAGENT_SHAPE
...@@ -3484,6 +3470,12 @@ void nxagentSetTopLevelEventMask(WindowPtr pWin) ...@@ -3484,6 +3470,12 @@ void nxagentSetTopLevelEventMask(WindowPtr pWin)
} }
/* /*
* Run nxagentConfigureWindow() on all windows in
* nxagentConfiguredWindowList and move them from the list
* afterwards. The list will be empty then.
*
* This is also taking care of entries in nxagentExposeQueue that need
* to be synchronized with the real X server.
*/ */
void nxagentFlushConfigureWindow(void) void nxagentFlushConfigureWindow(void)
{ {
...@@ -3586,10 +3578,10 @@ void nxagentAddConfiguredWindow(WindowPtr pWin, unsigned int valuemask) ...@@ -3586,10 +3578,10 @@ void nxagentAddConfiguredWindow(WindowPtr pWin, unsigned int valuemask)
{ {
unsigned int mask; unsigned int mask;
mask = valuemask & (CWParent | CWX | CWY | CWWidth | CWHeight | mask = valuemask & (CWSibling | CWX | CWY | CWWidth | CWHeight |
CWBorderWidth | CWStackingOrder | CW_Map | CW_Update | CW_Shape); CWBorderWidth | CWStackMode | CW_Map | CW_Update | CW_Shape);
valuemask &= ~(CWParent | CWX | CWY | CWWidth | CWHeight | CWBorderWidth | CWStackingOrder); valuemask &= ~(CWSibling | CWX | CWY | CWWidth | CWHeight | CWBorderWidth | CWStackMode);
if (mask & CWX && if (mask & CWX &&
nxagentWindowPriv(pWin)->x != nxagentWindowPriv(pWin)->x !=
...@@ -3626,11 +3618,11 @@ void nxagentAddConfiguredWindow(WindowPtr pWin, unsigned int valuemask) ...@@ -3626,11 +3618,11 @@ void nxagentAddConfiguredWindow(WindowPtr pWin, unsigned int valuemask)
valuemask |= CWBorderWidth; valuemask |= CWBorderWidth;
} }
if (mask & CWStackingOrder && if (mask & CWStackMode &&
nxagentWindowPriv(pWin)->siblingAbove != nxagentWindowPriv(pWin)->siblingAbove !=
nxagentWindowSiblingAbove(pWin)) nxagentWindowSiblingAbove(pWin))
{ {
valuemask |= CWStackingOrder; valuemask |= CWStackMode;
} }
{ {
...@@ -3952,16 +3944,16 @@ int nxagentEmptyBSPixmapList(void) ...@@ -3952,16 +3944,16 @@ int nxagentEmptyBSPixmapList(void)
StoringPixmapPtr nxagentFindItemBSPixmapList(unsigned long pixmapId) StoringPixmapPtr nxagentFindItemBSPixmapList(unsigned long pixmapId)
{ {
int i; for (int i = 0; i < BSPIXMAPLIMIT; i++)
for (i = 0; i < BSPIXMAPLIMIT; i++)
{ {
if ((nxagentBSPixmapList[i] != NULL) && if ((nxagentBSPixmapList[i] != NULL) &&
(nxagentBSPixmapList[i] -> storingPixmapId == pixmapId)) (nxagentBSPixmapList[i] -> storingPixmapId == pixmapId))
{ {
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentFindItemBSPixmapList: pixmapId [%lu].\n", pixmapId); fprintf(stderr, "%s: pixmapId [%lu].\n", __func__, pixmapId);
fprintf(stderr, "nxagentFindItemBSPixmapList: nxagentBSPixmapList[%d] -> storingPixmapId [%lu].\n", fprintf(stderr, "%s: nxagentBSPixmapList[%d] = [%p].\n", __func__,
i, (void *) nxagentBSPixmapList[i]);
fprintf(stderr, "%s: nxagentBSPixmapList[%d] -> storingPixmapId [%lu].\n", __func__,
i, nxagentBSPixmapList[i] -> storingPixmapId); i, nxagentBSPixmapList[i] -> storingPixmapId);
#endif #endif
...@@ -3969,15 +3961,13 @@ StoringPixmapPtr nxagentFindItemBSPixmapList(unsigned long pixmapId) ...@@ -3969,15 +3961,13 @@ StoringPixmapPtr nxagentFindItemBSPixmapList(unsigned long pixmapId)
} }
} }
#ifdef TEST #ifdef WARNING
fprintf(stderr, "nxagentFindItemBSPixmapList: WARNING! Item not found.\n"); fprintf(stderr, "%s: WARNING! Item not found.\n", __func__);
#endif #endif
#ifdef TEST #ifdef TEST
fprintf(stderr, "nxagentFindItemBSPixmapList: Pixmap with id [%lu] not found.\n", fprintf(stderr, "%s: Pixmap with id [%lu] not found.\n", __func__,
pixmapId); pixmapId);
fprintf(stderr, "nxagentBSPixmapList[%d] = [%p].\n",
i, (void *) nxagentBSPixmapList[i]);
#endif #endif
return NULL; return NULL;
......
...@@ -159,9 +159,6 @@ extern int nxagentWindowPrivateIndex; ...@@ -159,9 +159,6 @@ extern int nxagentWindowPrivateIndex;
#define nxagentDefaultWindowIsVisible() \ #define nxagentDefaultWindowIsVisible() \
(nxagentVisibility != VisibilityFullyObscured) (nxagentVisibility != VisibilityFullyObscured)
#define CWParent CWSibling
#define CWStackingOrder CWStackMode
#define CW_Map (1 << 15) #define CW_Map (1 << 15)
#define CW_Update (1 << 16) #define CW_Update (1 << 16)
#define CW_Shape (1 << 17) #define CW_Shape (1 << 17)
......
...@@ -253,17 +253,6 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -253,17 +253,6 @@ char *PngCompressData(XImage *image, int *compressed_size)
NXColorTable color_table[NB_COLOR_MAX]; NXColorTable color_table[NB_COLOR_MAX];
CARD8 *image_index; CARD8 *image_index;
image_index = (CARD8 *) malloc((image -> height) * (image -> width) * sizeof(CARD8));
/*
* TODO: Be sure the padded bytes are cleaned.
* It would be better to set to zero the bytes
* that are not aligned to the word boundary
* at the end of the procedure.
*/
memset(image_index, 0, (image -> height) * (image -> width) * sizeof(CARD8));
*compressed_size = 0; *compressed_size = 0;
pngDataLen = 0; pngDataLen = 0;
...@@ -283,7 +272,6 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -283,7 +272,6 @@ char *PngCompressData(XImage *image, int *compressed_size)
bitsPerPixel); bitsPerPixel);
#endif #endif
free(image_index);
return NULL; return NULL;
} }
...@@ -316,7 +304,6 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -316,7 +304,6 @@ char *PngCompressData(XImage *image, int *compressed_size)
fprintf(stderr, "******PngCompressData: PANIC! Failed creating the png_create_write_struct.\n"); fprintf(stderr, "******PngCompressData: PANIC! Failed creating the png_create_write_struct.\n");
#endif #endif
free(image_index);
return NULL; return NULL;
} }
...@@ -329,7 +316,6 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -329,7 +316,6 @@ char *PngCompressData(XImage *image, int *compressed_size)
#endif #endif
png_destroy_write_struct(&png_ptr, NULL); png_destroy_write_struct(&png_ptr, NULL);
free(image_index);
return NULL; return NULL;
} }
...@@ -341,7 +327,6 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -341,7 +327,6 @@ char *PngCompressData(XImage *image, int *compressed_size)
#endif #endif
png_destroy_write_struct(&png_ptr, &info_ptr); png_destroy_write_struct(&png_ptr, &info_ptr);
free(image_index);
return NULL; return NULL;
} }
...@@ -364,8 +349,6 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -364,8 +349,6 @@ char *PngCompressData(XImage *image, int *compressed_size)
PNG_DEST_SIZE(w, h)); PNG_DEST_SIZE(w, h));
#endif #endif
free(image_index);
return NULL; return NULL;
} }
...@@ -383,6 +366,24 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -383,6 +366,24 @@ char *PngCompressData(XImage *image, int *compressed_size)
return NULL; return NULL;
} }
image_index = (CARD8 *) calloc(1, (image -> height) * (image -> width) * sizeof(CARD8));
if (image_index == NULL)
{
#ifdef PANIC
fprintf(stderr, "******PngCompressData: PANIC! Could not alloc image_index.\n");
#endif
free(pngCompBuf);
return NULL;
}
/*
* TODO: Be sure the padded bytes are cleaned.
* It would be better to set to zero the bytes
* that are not aligned to the word boundary
* at the end of the procedure.
*/
png_set_compression_level(png_ptr, PNG_Z_LEVEL); png_set_compression_level(png_ptr, PNG_Z_LEVEL);
if (bitsPerPixel == 16) if (bitsPerPixel == 16)
...@@ -480,47 +481,23 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -480,47 +481,23 @@ char *PngCompressData(XImage *image, int *compressed_size)
return NULL; return NULL;
} }
int count;
if (color_type == PNG_COLOR_TYPE_PALETTE) if (color_type == PNG_COLOR_TYPE_PALETTE)
{ {
srcBuf = (CARD8 *) malloc(w * sizeof(CARD8)); count = w;
if (srcBuf == NULL)
{
#ifdef PANIC
fprintf(stderr, "******PngCompressData: PANIC! Cannot allocate [%d] bytes.\n",
(int) (w * sizeof(CARD8)));
#endif
free(image_index);
return NULL;
}
/*
* TODO: Be sure the padded bytes are cleaned.
* It would be better to set to zero the bytes
* that are not aligned to the word boundary
* at the end of the procedure.
*/
memset(srcBuf, 0, w * sizeof(CARD8));
} }
else else
{ {
srcBuf = (CARD8 *) malloc(w * 3 * sizeof(CARD8)); count = 3 * w;
/*
* TODO: See above.
*/
memset(srcBuf, 0, w * 3 * sizeof(CARD8));
} }
srcBuf = (CARD8 *) calloc(count, sizeof(CARD8));
if (srcBuf == NULL) if (srcBuf == NULL)
{ {
#ifdef PANIC #ifdef PANIC
fprintf(stderr, "******PngCompressData: PANIC! Cannot allocate [%d] bytes.\n", fprintf(stderr, "******PngCompressData: PANIC! Cannot allocate [%d] bytes.\n",
w * 3); (int) (count * sizeof(CARD8)));
#endif #endif
free(pngCompBuf); free(pngCompBuf);
...@@ -529,6 +506,13 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -529,6 +506,13 @@ char *PngCompressData(XImage *image, int *compressed_size)
return NULL; return NULL;
} }
/*
* TODO: Be sure the padded bytes are cleaned.
* It would be better to set to zero the bytes
* that are not aligned to the word boundary
* at the end of the procedure.
*/
for (dy = 0; dy < h; dy++) for (dy = 0; dy < h; dy++)
{ {
if (color_type == PNG_COLOR_TYPE_RGB) if (color_type == PNG_COLOR_TYPE_RGB)
...@@ -548,8 +532,8 @@ char *PngCompressData(XImage *image, int *compressed_size) ...@@ -548,8 +532,8 @@ char *PngCompressData(XImage *image, int *compressed_size)
dy, h); dy, h);
#endif #endif
free(srcBuf); free(srcBuf); srcBuf = NULL;
free(image_index); free(image_index); image_index = NULL;
if (setjmp(png_jmpbuf(png_ptr))) if (setjmp(png_jmpbuf(png_ptr)))
{ {
......
...@@ -20,7 +20,6 @@ extern int monitorResolution; ...@@ -20,7 +20,6 @@ extern int monitorResolution;
extern Bool loadableFonts; extern Bool loadableFonts;
extern int defaultColorVisualClass; extern int defaultColorVisualClass;
extern Bool Must_have_memory;
extern int GrabInProgress; extern int GrabInProgress;
extern char *ConnectionInfo; extern char *ConnectionInfo;
extern Bool noTestExtensions; extern Bool noTestExtensions;
......
...@@ -53,8 +53,6 @@ SOFTWARE. ...@@ -53,8 +53,6 @@ SOFTWARE.
#include "misc.h" #include "misc.h"
#include "mi.h" #include "mi.h"
extern Bool Must_have_memory;
void void
miRecolorCursor( pScr, pCurs, displayed) miRecolorCursor( pScr, pCurs, displayed)
ScreenPtr pScr; ScreenPtr pScr;
...@@ -65,11 +63,9 @@ miRecolorCursor( pScr, pCurs, displayed) ...@@ -65,11 +63,9 @@ miRecolorCursor( pScr, pCurs, displayed)
* This is guaranteed to correct any color-dependent state which may have * This is guaranteed to correct any color-dependent state which may have
* been bound up in private state created by RealizeCursor * been bound up in private state created by RealizeCursor
*/ */
(* pScr->UnrealizeCursor)( pScr, pCurs); pScr->UnrealizeCursor(pScr, pCurs);
Must_have_memory = TRUE; /* XXX */ pScr->RealizeCursor(pScr, pCurs);
(* pScr->RealizeCursor)( pScr, pCurs); if (displayed)
Must_have_memory = FALSE; /* XXX */ pScr->DisplayCursor(pScr, pCurs);
if ( displayed)
(* pScr->DisplayCursor)( pScr, pCurs);
} }
...@@ -151,7 +151,7 @@ miHandleExposures(pSrcDrawable, pDstDrawable, ...@@ -151,7 +151,7 @@ miHandleExposures(pSrcDrawable, pDstDrawable,
the window background the window background
*/ */
WindowPtr pSrcWin; WindowPtr pSrcWin;
BoxRec expBox; BoxRec expBox = { 0, };
Bool extents; Bool extents;
/* This prevents warning about pscr not being used. */ /* This prevents warning about pscr not being used. */
...@@ -757,7 +757,10 @@ int what; ...@@ -757,7 +757,10 @@ int what;
if (screenContext[i] == (GCPtr)NULL) if (screenContext[i] == (GCPtr)NULL)
{ {
if (!ResType && !(ResType = CreateNewResourceType(tossGC))) if (!ResType && !(ResType = CreateNewResourceType(tossGC)))
{
free(prect);
return; return;
}
screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0, screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0,
(XID *)NULL, &status); (XID *)NULL, &status);
if (!screenContext[i]) if (!screenContext[i])
......
...@@ -68,11 +68,9 @@ miCreateGCOps(prototype) ...@@ -68,11 +68,9 @@ miCreateGCOps(prototype)
{ {
GCOpsPtr ret; GCOpsPtr ret;
/* XXX */ Must_have_memory = TRUE; ret = malloc(sizeof(GCOps));
ret = (GCOpsPtr) malloc(sizeof(GCOps));
/* XXX */ Must_have_memory = FALSE;
if (!ret) if (!ret)
return 0; return NULL;
*ret = *prototype; *ret = *prototype;
ret->devPrivate.val = 1; ret->devPrivate.val = 1;
return ret; return ret;
......
...@@ -228,7 +228,6 @@ extern void GlxPushProvider(__GLXprovider *impl); ...@@ -228,7 +228,6 @@ extern void GlxPushProvider(__GLXprovider *impl);
*/ */
#ifndef __DARWIN__ #ifndef __DARWIN__
extern void GlxExtensionInit(void); extern void GlxExtensionInit(void);
extern void GlxWrapInitVisuals(miInitVisualsProcPtr *);
#else #else
extern void DarwinGlxExtensionInit(void); extern void DarwinGlxExtensionInit(void);
extern void DarwinGlxWrapInitVisuals(miInitVisualsProcPtr *); extern void DarwinGlxWrapInitVisuals(miInitVisualsProcPtr *);
...@@ -474,9 +473,7 @@ InitVisualWrap() ...@@ -474,9 +473,7 @@ InitVisualWrap()
{ {
miResetInitVisuals(); miResetInitVisuals();
#ifdef GLXEXT #ifdef GLXEXT
#ifndef __DARWIN__ #ifdef __DARWIN__
GlxWrapInitVisuals(&miInitVisualsProc);
#else
DarwinGlxWrapInitVisuals(&miInitVisualsProc); DarwinGlxWrapInitVisuals(&miInitVisualsProc);
#endif #endif
#endif #endif
......
...@@ -1052,6 +1052,7 @@ miSetShape(pWin) ...@@ -1052,6 +1052,7 @@ miSetShape(pWin)
* pointer to the parent, so maybe doesn't change * pointer to the parent, so maybe doesn't change
* the attribute of the window itself. This is to * the attribute of the window itself. This is to
* be better investigated. * be better investigated.
* Update: Red Hat fixed this bug the same way (BZ 676270).
*/ */
if (WasViewable && pOldClip) if (WasViewable && pOldClip)
......
...@@ -1348,6 +1348,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec **lccp) ...@@ -1348,6 +1348,7 @@ GetLocalClientCreds(ClientPtr client, LocalClientCredRec **lccp)
if (getpeerucred(fd, &peercred) < 0) { if (getpeerucred(fd, &peercred) < 0) {
FreeLocalClientCreds(lcc); FreeLocalClientCreds(lcc);
return -1; return -1;
}
lcc->euid = ucred_geteuid(peercred); lcc->euid = ucred_geteuid(peercred);
if (lcc->euid != -1) if (lcc->euid != -1)
lcc->fieldsSet |= LCC_UID_SET; lcc->fieldsSet |= LCC_UID_SET;
......
...@@ -257,8 +257,6 @@ Bool PanoramiXExtensionDisabledHack = FALSE; ...@@ -257,8 +257,6 @@ Bool PanoramiXExtensionDisabledHack = FALSE;
int auditTrailLevel = 1; int auditTrailLevel = 1;
Bool Must_have_memory = FALSE;
#if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED) #if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED)
#define HAS_SAVED_IDS_AND_SETEUID #define HAS_SAVED_IDS_AND_SETEUID
#endif #endif
......
...@@ -357,7 +357,8 @@ IntervalListCreateSet(RecordSetInterval *pIntervals, int nIntervals, ...@@ -357,7 +357,8 @@ IntervalListCreateSet(RecordSetInterval *pIntervals, int nIntervals,
if (!prls) goto bailout; if (!prls) goto bailout;
prls->baseSet.ops = &IntervalListSetOperations; prls->baseSet.ops = &IntervalListSetOperations;
} }
memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval)); if (nIntervals > 0)
memcpy(&prls[1], stackIntervals, nIntervals * sizeof(RecordSetInterval));
prls->nIntervals = nIntervals; prls->nIntervals = nIntervals;
bailout: bailout:
if (stackIntervals) free(stackIntervals); if (stackIntervals) free(stackIntervals);
......
...@@ -144,6 +144,7 @@ GlyphInit (ScreenPtr pScreen) ...@@ -144,6 +144,7 @@ GlyphInit (ScreenPtr pScreen)
return TRUE; return TRUE;
} }
#ifndef NXAGENT_SERVER
GlyphRefPtr GlyphRefPtr
FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare) FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare)
{ {
...@@ -192,6 +193,7 @@ FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare) ...@@ -192,6 +193,7 @@ FindGlyphRef (GlyphHashPtr hash, CARD32 signature, Bool match, GlyphPtr compare)
} }
return gr; return gr;
} }
#endif
CARD32 CARD32
HashGlyph (GlyphPtr glyph) HashGlyph (GlyphPtr glyph)
......
...@@ -979,6 +979,8 @@ static PicturePtr createSourcePicture(void) ...@@ -979,6 +979,8 @@ static PicturePtr createSourcePicture(void)
{ {
PicturePtr pPicture; PicturePtr pPicture;
pPicture = (PicturePtr) malloc(sizeof(PictureRec)); pPicture = (PicturePtr) malloc(sizeof(PictureRec));
if (!pPicture)
return 0;
pPicture->pDrawable = 0; pPicture->pDrawable = 0;
pPicture->pFormat = 0; pPicture->pFormat = 0;
pPicture->pNext = 0; pPicture->pNext = 0;
......
...@@ -37,12 +37,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -37,12 +37,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <xkbsrv.h> #include <xkbsrv.h>
#include "xkbgeom.h" #include "xkbgeom.h"
#ifdef X_NOT_POSIX
#define Size_t unsigned int
#else
#define Size_t size_t
#endif
/***====================================================================***/ /***====================================================================***/
static void static void
...@@ -463,7 +457,7 @@ _XkbGeomAlloc( XPointer * old, ...@@ -463,7 +457,7 @@ _XkbGeomAlloc( XPointer * old,
unsigned short * num, unsigned short * num,
unsigned short * total, unsigned short * total,
int num_new, int num_new,
Size_t sz_elem) size_t sz_elem)
{ {
if (num_new<1) if (num_new<1)
return Success; return Success;
...@@ -708,7 +702,8 @@ register XkbKeyAliasPtr alias; ...@@ -708,7 +702,8 @@ register XkbKeyAliasPtr alias;
for (i=0,alias=geom->key_aliases;i<geom->num_key_aliases;i++,alias++) { for (i=0,alias=geom->key_aliases;i<geom->num_key_aliases;i++,alias++) {
if (strncmp(alias->alias,aliasStr,XkbKeyNameLength)==0) { if (strncmp(alias->alias,aliasStr,XkbKeyNameLength)==0) {
bzero(alias->real,XkbKeyNameLength); bzero(alias->real,XkbKeyNameLength);
strncpy(alias->real,realStr,XkbKeyNameLength); memcpy(alias->real, realStr,
min(XkbKeyNameLength, strlen(realStr)));
return alias; return alias;
} }
} }
...@@ -718,8 +713,8 @@ register XkbKeyAliasPtr alias; ...@@ -718,8 +713,8 @@ register XkbKeyAliasPtr alias;
} }
alias= &geom->key_aliases[geom->num_key_aliases]; alias= &geom->key_aliases[geom->num_key_aliases];
bzero(alias,sizeof(XkbKeyAliasRec)); bzero(alias,sizeof(XkbKeyAliasRec));
strncpy(alias->alias,aliasStr,XkbKeyNameLength); memcpy(alias->alias, aliasStr, min(XkbKeyNameLength, strlen(aliasStr)));
strncpy(alias->real,realStr,XkbKeyNameLength); memcpy(alias->real, realStr, min(XkbKeyNameLength, strlen(realStr)));
geom->num_key_aliases++; geom->num_key_aliases++;
return alias; return alias;
} }
...@@ -936,8 +931,8 @@ Bool found; ...@@ -936,8 +931,8 @@ Bool found;
if ((row->num_keys>=row->sz_keys)&&(_XkbAllocOverlayKeys(row,1)!=Success)) if ((row->num_keys>=row->sz_keys)&&(_XkbAllocOverlayKeys(row,1)!=Success))
return NULL; return NULL;
key= &row->keys[row->num_keys]; key= &row->keys[row->num_keys];
strncpy(key->under.name,under,XkbKeyNameLength); memcpy(key->under.name, under, min(XkbKeyNameLength, strlen(under)));
strncpy(key->over.name,over,XkbKeyNameLength); memcpy(key->over.name, over, min(XkbKeyNameLength, strlen(over)));
row->num_keys++; row->num_keys++;
return key; return key;
} }
......
...@@ -52,10 +52,8 @@ XkbClientMapPtr map; ...@@ -52,10 +52,8 @@ XkbClientMapPtr map;
((!XkbIsLegalKeycode(xkb->min_key_code))|| ((!XkbIsLegalKeycode(xkb->min_key_code))||
(!XkbIsLegalKeycode(xkb->max_key_code))|| (!XkbIsLegalKeycode(xkb->max_key_code))||
(xkb->max_key_code<xkb->min_key_code))) { (xkb->max_key_code<xkb->min_key_code))) {
#ifdef DEBUG DebugF("bad keycode (%d,%d) in XkbAllocClientMap\n",
fprintf(stderr,"bad keycode (%d,%d) in XkbAllocClientMap\n",
xkb->min_key_code,xkb->max_key_code); xkb->min_key_code,xkb->max_key_code);
#endif
return BadValue; return BadValue;
} }
......
...@@ -413,10 +413,7 @@ unsigned changed,tmp; ...@@ -413,10 +413,7 @@ unsigned changed,tmp;
if (((explicit&XkbExplicitAutoRepeatMask)==0)&&(xkb->ctrls)) { if (((explicit&XkbExplicitAutoRepeatMask)==0)&&(xkb->ctrls)) {
CARD8 old; CARD8 old;
old= xkb->ctrls->per_key_repeat[key/8]; old= xkb->ctrls->per_key_repeat[key/8];
#ifdef RETURN_SHOULD_REPEAT xkb->ctrls->per_key_repeat[key/8]|= (1<<(key%8));
if (*XkbKeySymsPtr(xkb,key) != XK_Return)
#endif
xkb->ctrls->per_key_repeat[key/8]|= (1<<(key%8));
if (changes && (old!=xkb->ctrls->per_key_repeat[key/8])) if (changes && (old!=xkb->ctrls->per_key_repeat[key/8]))
changes->ctrls.changed_ctrls|= XkbPerKeyRepeatMask; changes->ctrls.changed_ctrls|= XkbPerKeyRepeatMask;
} }
......
...@@ -142,10 +142,6 @@ Atom name; ...@@ -142,10 +142,6 @@ Atom name;
next= 0; next= 0;
pitch= oldPitch= ctrl->bell_pitch; pitch= oldPitch= ctrl->bell_pitch;
duration= oldDuration= ctrl->bell_duration; duration= oldDuration= ctrl->bell_duration;
#ifdef DEBUG
if (xkbDebugFlags>1)
ErrorF("beep: %d (count= %d)\n",xkbInfo->beepType,xkbInfo->beepCount);
#endif
name= None; name= None;
switch (xkbInfo->beepType) { switch (xkbInfo->beepType) {
default: default:
......
...@@ -46,12 +46,6 @@ int realRepeat; ...@@ -46,12 +46,6 @@ int realRepeat;
realRepeat= ctrl->autoRepeat; realRepeat= ctrl->autoRepeat;
if ((dev->kbdfeed)&&(XkbDDXUsesSoftRepeat(dev))) if ((dev->kbdfeed)&&(XkbDDXUsesSoftRepeat(dev)))
ctrl->autoRepeat= 0; ctrl->autoRepeat= 0;
#ifdef DEBUG
if (xkbDebugFlags&0x4) {
ErrorF("XkbDDXKeybdCtrlProc: setting repeat to %d (real repeat is %d)\n",
ctrl->autoRepeat,realRepeat);
}
#endif
if (dev->key && dev->key->xkbInfo && dev->key->xkbInfo->kbdProc) if (dev->key && dev->key->xkbInfo && dev->key->xkbInfo->kbdProc)
(*dev->key->xkbInfo->kbdProc)(dev,ctrl); (*dev->key->xkbInfo->kbdProc)(dev,ctrl);
ctrl->autoRepeat= realRepeat; ctrl->autoRepeat= realRepeat;
...@@ -92,23 +86,6 @@ unsigned changed, i; ...@@ -92,23 +86,6 @@ unsigned changed, i;
unsigned char *rep_old, *rep_new, *rep_fb; unsigned char *rep_old, *rep_new, *rep_fb;
changed= new->enabled_ctrls^old->enabled_ctrls; changed= new->enabled_ctrls^old->enabled_ctrls;
#ifdef NOTDEF
if (changed&XkbRepeatKeysMask) {
if (dev->kbdfeed) {
int realRepeat;
if (new->enabled_ctrls&XkbRepeatKeysMask)
dev->kbdfeed->ctrl.autoRepeat= realRepeat= 1;
else dev->kbdfeed->ctrl.autoRepeat= realRepeat= 0;
if (XkbDDXUsesSoftRepeat(dev))
dev->kbdfeed->ctrl.autoRepeat= FALSE;
if (dev->kbdfeed->CtrlProc)
(*dev->kbdfeed->CtrlProc)(dev,&dev->kbdfeed->ctrl);
dev->kbdfeed->ctrl.autoRepeat= realRepeat;
}
}
#endif
for (rep_old = old->per_key_repeat, for (rep_old = old->per_key_repeat,
rep_new = new->per_key_repeat, rep_new = new->per_key_repeat,
rep_fb = dev->kbdfeed->ctrl.autoRepeats, rep_fb = dev->kbdfeed->ctrl.autoRepeats,
......
...@@ -41,14 +41,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -41,14 +41,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <xkbsrv.h> #include <xkbsrv.h>
#include <nx-X11/extensions/XI.h> #include <nx-X11/extensions/XI.h>
#ifndef PATH_MAX
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 1024
#endif
#endif
#ifdef WIN32 #ifdef WIN32
/* from ddxLoad.c */ /* from ddxLoad.c */
extern const char* Win32TempDir(); extern const char* Win32TempDir();
...@@ -210,9 +202,8 @@ char tmpname[PATH_MAX]; ...@@ -210,9 +202,8 @@ char tmpname[PATH_MAX];
#ifndef WIN32 #ifndef WIN32
in= Popen(buf,"r"); in= Popen(buf,"r");
#else #else
#ifdef DEBUG_CMD if (xkbDebugFlags)
ErrorF("xkb executes: %s\n",buf); DebugF("xkb executes: %s\n",buf);
#endif
if (System(buf) < 0) if (System(buf) < 0)
ErrorF("Could not invoke keymap compiler\n"); ErrorF("Could not invoke keymap compiler\n");
else else
......
...@@ -57,14 +57,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -57,14 +57,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <paths.h> #include <paths.h>
#endif #endif
#ifndef PATH_MAX
#ifdef MAXPATHLEN
#define PATH_MAX MAXPATHLEN
#else
#define PATH_MAX 1024
#endif
#endif
/* /*
* If XKM_OUTPUT_DIR specifies a path without a leading slash, it is * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is
* relative to the top-level XKB configuration directory. * relative to the top-level XKB configuration directory.
...@@ -166,44 +158,19 @@ Win32System(const char *cmdline) ...@@ -166,44 +158,19 @@ Win32System(const char *cmdline)
#define System(x) Win32System(x) #define System(x) Win32System(x)
#endif #endif
#ifdef MAKE_XKM_OUTPUT_DIR
/* Borrow trans_mkdir from Xtransutil.c to more safely make directories */
# undef X11_t
# define TRANS_SERVER
# define PRMSG(lvl,x,a,b,c) \
if (lvl <= 1) { LogMessage(X_ERROR,x,a,b,c); } else ((void)0)
# include <nx-X11/Xtrans/Xtransutil.c>
# ifndef XKM_OUTPUT_DIR_MODE
# define XKM_OUTPUT_DIR_MODE 0755
# endif
#endif
static void static void
OutputDirectory( OutputDirectory(
char* outdir, char* outdir,
size_t size) size_t size)
{ {
#ifndef WIN32 #ifndef WIN32
if (getuid() == 0 && (strlen(XKM_OUTPUT_DIR) < size) if (getuid() == 0 && (strlen(XKM_OUTPUT_DIR) < size))
#ifdef MAKE_XKM_OUTPUT_DIR
&& (trans_mkdir(XKM_OUTPUT_DIR, XKM_OUTPUT_DIR_MODE) == 0)
#endif
)
{ {
/* if server running as root it *may* be able to write */ /* if server running as root it *may* be able to write */
/* FIXME: check whether directory is writable at all */ /* FIXME: check whether directory is writable at all */
(void) strcpy (outdir, XKM_OUTPUT_DIR); (void) strcpy (outdir, XKM_OUTPUT_DIR);
} else } else
#endif #else
#ifdef _PATH_VARTMP
if ((strlen(_PATH_VARTMP) + 1) < size)
{
(void) strcpy (outdir, _PATH_VARTMP);
if (outdir[strlen(outdir) - 1] != '/') /* Hi IBM, Digital */
(void) strcat (outdir, "/");
} else
#endif
#ifdef WIN32
if (strlen(Win32TempDir()) + 1 < size) if (strlen(Win32TempDir()) + 1 < size)
{ {
(void) strcpy(outdir, Win32TempDir()); (void) strcpy(outdir, Win32TempDir());
...@@ -264,15 +231,10 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile; ...@@ -264,15 +231,10 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile;
xkm_output_dir,outFile) == -1) xkm_output_dir,outFile) == -1)
cmd = NULL; cmd = NULL;
} }
#ifdef DEBUG
if (xkbDebugFlags) { if (xkbDebugFlags) {
ErrorF("XkbDDXCompileNamedKeymap compiling keymap using:\n"); DebugF("XkbDDXCompileNamedKeymap compiling keymap using:\n");
ErrorF(" \"cmd\"\n"); DebugF(" \"cmd\"\n");
} }
#endif
#ifdef DEBUG_CMD
ErrorF("xkb executes: %s\n",cmd);
#endif
if (System(cmd)==0) { if (System(cmd)==0) {
if (nameRtrn) { if (nameRtrn) {
strncpy(nameRtrn,outFile,nameRtrnLen); strncpy(nameRtrn,outFile,nameRtrnLen);
...@@ -284,9 +246,7 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile; ...@@ -284,9 +246,7 @@ char *cmd = NULL,file[PATH_MAX],xkm_output_dir[PATH_MAX],*map,*outFile;
free(cmd); free(cmd);
return True; return True;
} }
#ifdef DEBUG DebugF("Error compiling keymap (%s)\n",names->keymap);
ErrorF("Error compiling keymap (%s)\n",names->keymap);
#endif
if (outFile!=NULL) if (outFile!=NULL)
_XkbFree(outFile); _XkbFree(outFile);
if (cmd!=NULL) if (cmd!=NULL)
...@@ -399,12 +359,8 @@ char tmpname[PATH_MAX]; ...@@ -399,12 +359,8 @@ char tmpname[PATH_MAX];
if (fclose(out)==0 && System(buf) >= 0) if (fclose(out)==0 && System(buf) >= 0)
#endif #endif
{ {
#ifdef DEBUG_CMD if (xkbDebugFlags)
ErrorF("xkb executes: %s\n",buf); DebugF("xkb executes: %s\n",buf);
ErrorF("xkbcomp input:\n");
XkbWriteXKBKeymapForNames(stderr,names,NULL,xkb,want,need);
ErrorF("end xkbcomp input\n");
#endif
if (nameRtrn) { if (nameRtrn) {
strncpy(nameRtrn,keymap,nameRtrnLen); strncpy(nameRtrn,keymap,nameRtrnLen);
nameRtrn[nameRtrnLen-1]= '\0'; nameRtrn[nameRtrnLen-1]= '\0';
...@@ -413,24 +369,20 @@ char tmpname[PATH_MAX]; ...@@ -413,24 +369,20 @@ char tmpname[PATH_MAX];
free (buf); free (buf);
return True; return True;
} }
#ifdef DEBUG
else else
ErrorF("Error compiling keymap (%s)\n",keymap); DebugF("Error compiling keymap (%s)\n",keymap);
#endif
#ifdef WIN32 #ifdef WIN32
/* remove the temporary file */ /* remove the temporary file */
unlink(tmpname); unlink(tmpname);
#endif #endif
} }
#ifdef DEBUG
else { else {
#ifndef WIN32 #ifndef WIN32
ErrorF("Could not invoke keymap compiler\n"); DebugF("Could not invoke keymap compiler\n");
#else #else
ErrorF("Could not open file %s\n", tmpname); DebugF("Could not open file %s\n", tmpname);
#endif #endif
} }
#endif
if (nameRtrn) if (nameRtrn)
nameRtrn[0]= '\0'; nameRtrn[0]= '\0';
if (buf != NULL) if (buf != NULL)
...@@ -452,15 +404,16 @@ FILE * file; ...@@ -452,15 +404,16 @@ FILE * file;
&&(!isalpha(xkm_output_dir[0]) || xkm_output_dir[1]!=':') &&(!isalpha(xkm_output_dir[0]) || xkm_output_dir[1]!=':')
#endif #endif
) { ) {
if (strlen(XkbBaseDirectory)+strlen(xkm_output_dir) if (snprintf(buf, PATH_MAX, "%s/%s%s.xkm", XkbBaseDirectory,
+strlen(mapName)+6 <= PATH_MAX) xkm_output_dir, mapName) >= PATH_MAX)
{ buf[0] = '\0';
sprintf(buf,"%s/%s%s.xkm",XkbBaseDirectory, }
xkm_output_dir,mapName); else
} {
if (snprintf(buf, PATH_MAX, "%s%s.xkm", xkm_output_dir, mapName)
>= PATH_MAX)
buf[0] = '\0';
} }
else if (strlen(xkm_output_dir)+strlen(mapName)+5 <= PATH_MAX)
sprintf(buf,"%s%s.xkm",xkm_output_dir,mapName);
if (buf[0] != '\0') if (buf[0] != '\0')
file= fopen(buf,"rb"); file= fopen(buf,"rb");
else file= NULL; else file= NULL;
...@@ -505,17 +458,13 @@ unsigned missing; ...@@ -505,17 +458,13 @@ unsigned missing;
return 0; return 0;
} }
else if (!XkbDDXCompileNamedKeymap(xkb,names,nameRtrn,nameRtrnLen)) { else if (!XkbDDXCompileNamedKeymap(xkb,names,nameRtrn,nameRtrnLen)) {
#ifdef NOISY DebugF("Couldn't compile keymap file\n");
ErrorF("Couldn't compile keymap file\n");
#endif
return 0; return 0;
} }
} }
else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need, else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need,
nameRtrn,nameRtrnLen)){ nameRtrn,nameRtrnLen)){
#ifdef NOISY DebugF("Couldn't compile keymap file\n");
ErrorF("Couldn't compile keymap file\n");
#endif
return 0; return 0;
} }
file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX); file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX);
...@@ -530,11 +479,9 @@ unsigned missing; ...@@ -530,11 +479,9 @@ unsigned missing;
(void) unlink (fileName); (void) unlink (fileName);
return 0; return 0;
} }
#ifdef DEBUG
else if (xkbDebugFlags) { else if (xkbDebugFlags) {
ErrorF("Loaded %s, defined=0x%x\n",fileName,finfoRtrn->defined); DebugF("Loaded %s, defined=0x%x\n",fileName,finfoRtrn->defined);
} }
#endif
fclose(file); fclose(file);
(void) unlink (fileName); (void) unlink (fileName);
return (need|want)&(~missing); return (need|want)&(~missing);
...@@ -559,9 +506,9 @@ XkbRF_RulesPtr rules; ...@@ -559,9 +506,9 @@ XkbRF_RulesPtr rules;
sprintf(buf,"rules/%s",rules_name); sprintf(buf,"rules/%s",rules_name);
} }
else { else {
if (strlen(XkbBaseDirectory)+strlen(rules_name)+8 > PATH_MAX) if (snprintf(buf, PATH_MAX, "%s/rules/%s", XkbBaseDirectory, rules_name)
>= PATH_MAX)
return False; return False;
sprintf(buf,"%s/rules/%s",XkbBaseDirectory,rules_name);
} }
if ((file= fopen(buf,"r"))==NULL) if ((file= fopen(buf,"r"))==NULL)
return False; return False;
......
...@@ -48,16 +48,6 @@ ...@@ -48,16 +48,6 @@
#include "xkbstr.h" #include "xkbstr.h"
#include <xkbsrv.h> #include <xkbsrv.h>
#ifdef DEBUG
#define PR_DEBUG(s) fprintf(stderr,s)
#define PR_DEBUG1(s,a) fprintf(stderr,s,a)
#define PR_DEBUG2(s,a,b) fprintf(stderr,s,a,b)
#else
#define PR_DEBUG(s)
#define PR_DEBUG1(s,a)
#define PR_DEBUG2(s,a,b)
#endif
/***====================================================================***/ /***====================================================================***/
#define DFLT_LINE_SIZE 128 #define DFLT_LINE_SIZE 128
...@@ -169,8 +159,8 @@ Bool endOfFile,spacePending,slashPending,inComment; ...@@ -169,8 +159,8 @@ Bool endOfFile,spacePending,slashPending,inComment;
} }
if (checkbang && ch=='!') { if (checkbang && ch=='!') {
if (line->num_line!=0) { if (line->num_line!=0) {
PR_DEBUG("The '!' legal only at start of line\n"); DebugF("The '!' legal only at start of line\n");
PR_DEBUG("Line containing '!' ignored\n"); DebugF("Line containing '!' ignored\n");
line->num_line= 0; line->num_line= 0;
inComment= 0; inComment= 0;
break; break;
...@@ -271,9 +261,7 @@ unsigned present, l_ndx_present, v_ndx_present; ...@@ -271,9 +261,7 @@ unsigned present, l_ndx_present, v_ndx_present;
register int i; register int i;
int len, ndx; int len, ndx;
_Xstrtokparams strtok_buf; _Xstrtokparams strtok_buf;
#ifdef DEBUG
Bool found; Bool found;
#endif
l_ndx_present = v_ndx_present = present= 0; l_ndx_present = v_ndx_present = present= 0;
...@@ -282,9 +270,7 @@ Bool found; ...@@ -282,9 +270,7 @@ Bool found;
bzero((char *)remap,sizeof(RemapSpec)); bzero((char *)remap,sizeof(RemapSpec));
remap->number = len; remap->number = len;
while ((tok=_XStrtok(str," ",strtok_buf))!=NULL) { while ((tok=_XStrtok(str," ",strtok_buf))!=NULL) {
#ifdef DEBUG
found= False; found= False;
#endif
str= NULL; str= NULL;
if (strcmp(tok,"=")==0) if (strcmp(tok,"=")==0)
continue; continue;
...@@ -297,22 +283,20 @@ Bool found; ...@@ -297,22 +283,20 @@ Bool found;
*end != '\0' || ndx == -1) *end != '\0' || ndx == -1)
break; break;
if (ndx < 1 || ndx > XkbNumKbdGroups) { if (ndx < 1 || ndx > XkbNumKbdGroups) {
PR_DEBUG2("Illegal %s index: %d\n", cname[i], ndx); DebugF("Illegal %s index: %d\n", cname[i], ndx);
PR_DEBUG1("Index must be in range 1..%d\n", DebugF("Index must be in range 1..%d\n",
XkbNumKbdGroups); XkbNumKbdGroups);
break; break;
} }
} else { } else {
ndx = 0; ndx = 0;
} }
#ifdef DEBUG
found= True; found= True;
#endif
if (present&(1<<i)) { if (present&(1<<i)) {
if ((i == LAYOUT && l_ndx_present&(1<<ndx)) || if ((i == LAYOUT && l_ndx_present&(1<<ndx)) ||
(i == VARIANT && v_ndx_present&(1<<ndx)) ) { (i == VARIANT && v_ndx_present&(1<<ndx)) ) {
PR_DEBUG1("Component \"%s\" listed twice\n",tok); DebugF("Component \"%s\" listed twice\n",tok);
PR_DEBUG("Second definition ignored\n"); DebugF("Second definition ignored\n");
break; break;
} }
} }
...@@ -326,38 +310,34 @@ Bool found; ...@@ -326,38 +310,34 @@ Bool found;
break; break;
} }
} }
#ifdef DEBUG
if (!found) { if (!found) {
fprintf(stderr,"Unknown component \"%s\" ignored\n",tok); fprintf(stderr,"Unknown component \"%s\" ignored\n",tok);
} }
#endif
} }
if ((present&PART_MASK)==0) { if ((present&PART_MASK)==0) {
#ifdef DEBUG
unsigned mask= PART_MASK; unsigned mask= PART_MASK;
fprintf(stderr,"Mapping needs at least one of "); ErrorF("Mapping needs at least one of ");
for (i=0; (i<MAX_WORDS); i++) { for (i=0; (i<MAX_WORDS); i++) {
if ((1L<<i)&mask) { if ((1L<<i)&mask) {
mask&= ~(1L<<i); mask&= ~(1L<<i);
if (mask) fprintf(stderr,"\"%s,\" ",cname[i]); if (mask) DebugF("\"%s,\" ",cname[i]);
else fprintf(stderr,"or \"%s\"\n",cname[i]); else DebugF("or \"%s\"\n",cname[i]);
} }
} }
fprintf(stderr,"Illegal mapping ignored\n"); DebugF("Illegal mapping ignored\n");
#endif
remap->num_remap= 0; remap->num_remap= 0;
return; return;
} }
if ((present&COMPONENT_MASK)==0) { if ((present&COMPONENT_MASK)==0) {
PR_DEBUG("Mapping needs at least one component\n"); DebugF("Mapping needs at least one component\n");
PR_DEBUG("Illegal mapping ignored\n"); DebugF("Illegal mapping ignored\n");
remap->num_remap= 0; remap->num_remap= 0;
return; return;
} }
if (((present&COMPONENT_MASK)&(1<<KEYMAP))&& if (((present&COMPONENT_MASK)&(1<<KEYMAP))&&
((present&COMPONENT_MASK)!=(1<<KEYMAP))) { ((present&COMPONENT_MASK)!=(1<<KEYMAP))) {
PR_DEBUG("Keymap cannot appear with other components\n"); DebugF("Keymap cannot appear with other components\n");
PR_DEBUG("Illegal mapping ignored\n"); DebugF("Illegal mapping ignored\n");
remap->num_remap= 0; remap->num_remap= 0;
return; return;
} }
...@@ -432,8 +412,8 @@ Bool append = False; ...@@ -432,8 +412,8 @@ Bool append = False;
} }
if (remap->num_remap==0) { if (remap->num_remap==0) {
PR_DEBUG("Must have a mapping before first line of data\n"); DebugF("Must have a mapping before first line of data\n");
PR_DEBUG("Illegal line of data ignored\n"); DebugF("Illegal line of data ignored\n");
return False; return False;
} }
bzero((char *)&tmp,sizeof(FileSpec)); bzero((char *)&tmp,sizeof(FileSpec));
...@@ -445,8 +425,8 @@ Bool append = False; ...@@ -445,8 +425,8 @@ Bool append = False;
continue; continue;
} }
if (nread>remap->num_remap) { if (nread>remap->num_remap) {
PR_DEBUG("Too many words on a line\n"); DebugF("Too many words on a line\n");
PR_DEBUG1("Extra word \"%s\" ignored\n",tok); DebugF("Extra word \"%s\" ignored\n",tok);
continue; continue;
} }
tmp.name[remap->remap[nread].word]= tok; tmp.name[remap->remap[nread].word]= tok;
...@@ -454,8 +434,8 @@ Bool append = False; ...@@ -454,8 +434,8 @@ Bool append = False;
append = True; append = True;
} }
if (nread<remap->num_remap) { if (nread<remap->num_remap) {
PR_DEBUG1("Too few words on a line: %s\n", line->line); DebugF("Too few words on a line: %s\n", line->line);
PR_DEBUG("line ignored\n"); DebugF("line ignored\n");
return False; return False;
} }
...@@ -901,9 +881,7 @@ XkbRF_AddRule(XkbRF_RulesPtr rules) ...@@ -901,9 +881,7 @@ XkbRF_AddRule(XkbRF_RulesPtr rules)
} }
if (!rules->rules) { if (!rules->rules) {
rules->sz_rules= rules->num_rules= 0; rules->sz_rules= rules->num_rules= 0;
#ifdef DEBUG DebugF("Allocation failure in XkbRF_AddRule\n");
fprintf(stderr,"Allocation failure in XkbRF_AddRule\n");
#endif
return NULL; return NULL;
} }
bzero((char *)&rules->rules[rules->num_rules],sizeof(XkbRF_RuleRec)); bzero((char *)&rules->rules[rules->num_rules],sizeof(XkbRF_RuleRec));
...@@ -975,9 +953,8 @@ Bool ok; ...@@ -975,9 +953,8 @@ Bool ok;
if ((!base)||(!rules)) if ((!base)||(!rules))
return False; return False;
if (locale) { if (locale) {
if (strlen(base)+strlen(locale)+2 > PATH_MAX) if (snprintf(buf, PATH_MAX, "%s-%s", base, locale) >= PATH_MAX)
return False; return False;
sprintf(buf,"%s-%s", base, locale);
} }
else { else {
if (strlen(base)+1 > PATH_MAX) if (strlen(base)+1 > PATH_MAX)
...@@ -1020,7 +997,7 @@ XkbRF_AddVarDesc(XkbRF_DescribeVarsPtr vars) ...@@ -1020,7 +997,7 @@ XkbRF_AddVarDesc(XkbRF_DescribeVarsPtr vars)
} }
if (!vars->desc) { if (!vars->desc) {
vars->sz_desc= vars->num_desc= 0; vars->sz_desc= vars->num_desc= 0;
PR_DEBUG("Allocation failure in XkbRF_AddVarDesc\n"); DebugF("Allocation failure in XkbRF_AddVarDesc\n");
return NULL; return NULL;
} }
vars->desc[vars->num_desc].name= NULL; vars->desc[vars->num_desc].name= NULL;
...@@ -1057,7 +1034,7 @@ XkbRF_AddVarToDescribe(XkbRF_RulesPtr rules,char *name) ...@@ -1057,7 +1034,7 @@ XkbRF_AddVarToDescribe(XkbRF_RulesPtr rules,char *name)
XkbRF_DescribeVarsRec); XkbRF_DescribeVarsRec);
} }
if ((!rules->extra_names)||(!rules->extra)) { if ((!rules->extra_names)||(!rules->extra)) {
PR_DEBUG("allocation error in extra parts\n"); DebugF("allocation error in extra parts\n");
rules->sz_extra= rules->num_extra= 0; rules->sz_extra= rules->num_extra= 0;
rules->extra_names= NULL; rules->extra_names= NULL;
rules->extra= NULL; rules->extra= NULL;
...@@ -1100,7 +1077,7 @@ int len,headingtype,extra_ndx = 0; ...@@ -1100,7 +1077,7 @@ int len,headingtype,extra_ndx = 0;
} }
if (extra_ndx<0) { if (extra_ndx<0) {
XkbRF_DescribeVarsPtr var; XkbRF_DescribeVarsPtr var;
PR_DEBUG1("Extra heading \"%s\" encountered\n",tok); DebugF("Extra heading \"%s\" encountered\n",tok);
var= XkbRF_AddVarToDescribe(rules,tok); var= XkbRF_AddVarToDescribe(rules,tok);
if (var) if (var)
extra_ndx= var-rules->extra; extra_ndx= var-rules->extra;
...@@ -1111,20 +1088,20 @@ int len,headingtype,extra_ndx = 0; ...@@ -1111,20 +1088,20 @@ int len,headingtype,extra_ndx = 0;
} }
if (headingtype == HEAD_NONE) { if (headingtype == HEAD_NONE) {
PR_DEBUG("Must have a heading before first line of data\n"); DebugF("Must have a heading before first line of data\n");
PR_DEBUG("Illegal line of data ignored\n"); DebugF("Illegal line of data ignored\n");
continue; continue;
} }
len = strlen(line.line); len = strlen(line.line);
if ((tmp.name= strtok(line.line, " \t")) == NULL) { if ((tmp.name= strtok(line.line, " \t")) == NULL) {
PR_DEBUG("Huh? No token on line\n"); DebugF("Huh? No token on line\n");
PR_DEBUG("Illegal line of data ignored\n"); DebugF("Illegal line of data ignored\n");
continue; continue;
} }
if (strlen(tmp.name) == len) { if (strlen(tmp.name) == len) {
PR_DEBUG("No description found\n"); DebugF("No description found\n");
PR_DEBUG("Illegal line of data ignored\n"); DebugF("Illegal line of data ignored\n");
continue; continue;
} }
...@@ -1132,8 +1109,8 @@ int len,headingtype,extra_ndx = 0; ...@@ -1132,8 +1109,8 @@ int len,headingtype,extra_ndx = 0;
while ((*tok!='\n')&&isspace(*tok)) while ((*tok!='\n')&&isspace(*tok))
tok++; tok++;
if (*tok == '\0') { if (*tok == '\0') {
PR_DEBUG("No description found\n"); DebugF("No description found\n");
PR_DEBUG("Illegal line of data ignored\n"); DebugF("Illegal line of data ignored\n");
continue; continue;
} }
tmp.desc= tok; tmp.desc= tok;
......
...@@ -2363,7 +2363,7 @@ ProcXkbSetMap(ClientPtr client) ...@@ -2363,7 +2363,7 @@ ProcXkbSetMap(ClientPtr client)
else first= last= 0; else first= last= 0;
if (change.map.num_modmap_keys>0) { if (change.map.num_modmap_keys>0) {
firstMM= change.map.first_modmap_key; firstMM= change.map.first_modmap_key;
lastMM= first+change.map.num_modmap_keys-1; lastMM= firstMM + change.map.num_modmap_keys - 1;
} }
else firstMM= lastMM= 0; else firstMM= lastMM= 0;
if ((last>0) && (lastMM>0)) { if ((last>0) && (lastMM>0)) {
...@@ -5677,10 +5677,8 @@ char * str; ...@@ -5677,10 +5677,8 @@ char * str;
return status; return status;
} }
else if (length!=0) { else if (length!=0) {
#ifdef DEBUG
ErrorF("Internal Error! BadLength in ProcXkbGetDeviceInfo\n"); ErrorF("Internal Error! BadLength in ProcXkbGetDeviceInfo\n");
ErrorF(" Wrote %d fewer bytes than expected\n",length); ErrorF(" Wrote %d fewer bytes than expected\n",length);
#endif
return BadLength; return BadLength;
} }
if (stuff->wanted&(~supported)) { if (stuff->wanted&(~supported)) {
......
...@@ -126,11 +126,9 @@ xEvent xE; ...@@ -126,11 +126,9 @@ xEvent xE;
xE.u.u.type = type; xE.u.u.type = type;
xE.u.u.detail = keyCode; xE.u.u.detail = keyCode;
xE.u.keyButtonPointer.time = GetTimeInMillis(); xE.u.keyButtonPointer.time = GetTimeInMillis();
#ifdef DEBUG
if (xkbDebugFlags&0x8) { if (xkbDebugFlags&0x8) {
ErrorF("AXKE: Key %d %s\n",keyCode,(xE.u.u.type==KeyPress?"down":"up")); DebugF("AXKE: Key %d %s\n",keyCode,(xE.u.u.type==KeyPress?"down":"up"));
} }
#endif
if (!_XkbIsPressEvent(type) && isRepeat) if (!_XkbIsPressEvent(type) && isRepeat)
XkbLastRepeatEvent= (void *)&xE; XkbLastRepeatEvent= (void *)&xE;
...@@ -524,10 +522,8 @@ KeySym * sym = XkbKeySymsPtr(xkbi->desc,key); ...@@ -524,10 +522,8 @@ KeySym * sym = XkbKeySymsPtr(xkbi->desc,key);
XkbRepeatKeysMask)) { XkbRepeatKeysMask)) {
if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats,key)) if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats,key))
{ {
#ifdef DEBUG
if (xkbDebugFlags&0x10) if (xkbDebugFlags&0x10)
ErrorF("Starting software autorepeat...\n"); DebugF("Starting software autorepeat...\n");
#endif
xkbi->repeatKey = key; xkbi->repeatKey = key;
xkbi->repeatKeyTimer= TimerSet(xkbi->repeatKeyTimer, xkbi->repeatKeyTimer= TimerSet(xkbi->repeatKeyTimer,
0, ctrls->repeat_delay, 0, ctrls->repeat_delay,
......
...@@ -1142,7 +1142,6 @@ XkbSrvInfoPtr xkbi; ...@@ -1142,7 +1142,6 @@ XkbSrvInfoPtr xkbi;
KeyClassPtr keyc; KeyClassPtr keyc;
int changed,sendEvent; int changed,sendEvent;
Bool genStateNotify; Bool genStateNotify;
XkbStateRec oldState;
XkbAction act; XkbAction act;
XkbFilterPtr filter; XkbFilterPtr filter;
Bool keyEvent; Bool keyEvent;
...@@ -1157,7 +1156,7 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); ...@@ -1157,7 +1156,7 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev);
xkbi= keyc->xkbInfo; xkbi= keyc->xkbInfo;
key= xE->u.u.detail; key= xE->u.u.detail;
if ((xkbi->flags&_XkbStateNotifyInProgress)==0) { if ((xkbi->flags&_XkbStateNotifyInProgress)==0) {
oldState= xkbi->state; xkbi->prev_state = xkbi->state;
xkbi->flags|= _XkbStateNotifyInProgress; xkbi->flags|= _XkbStateNotifyInProgress;
genStateNotify= True; genStateNotify= True;
} }
...@@ -1303,11 +1302,10 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); ...@@ -1303,11 +1302,10 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev);
else if (keyEvent) else if (keyEvent)
FixKeyState(xE,dev); FixKeyState(xE,dev);
xkbi->prev_state= oldState;
XkbComputeDerivedState(xkbi); XkbComputeDerivedState(xkbi);
keyc->prev_state= keyc->state; keyc->prev_state= keyc->state;
keyc->state= XkbStateFieldFromRec(&xkbi->state); keyc->state= XkbStateFieldFromRec(&xkbi->state);
changed = XkbStateChangedFlags(&oldState,&xkbi->state); changed = XkbStateChangedFlags(&xkbi->prev_state,&xkbi->state);
if (genStateNotify) { if (genStateNotify) {
if (changed) { if (changed) {
xkbStateNotify sn; xkbStateNotify sn;
......
...@@ -804,21 +804,19 @@ XkbSrvInfoPtr xkbi; ...@@ -804,21 +804,19 @@ XkbSrvInfoPtr xkbi;
xkbi= pXDev->key->xkbInfo; xkbi= pXDev->key->xkbInfo;
if ( pClient->xkbClientFlags & _XkbClientInitialized ) { if ( pClient->xkbClientFlags & _XkbClientInitialized ) {
#ifdef DEBUG
if ((xkbDebugFlags&0x10)&& if ((xkbDebugFlags&0x10)&&
((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease))) { ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease))) {
ErrorF("XKbFilterWriteEvents:\n"); DebugF("XKbFilterWriteEvents:\n");
ErrorF(" Event state= 0x%04x\n",xE[0].u.keyButtonPointer.state); DebugF(" Event state= 0x%04x\n",xE[0].u.keyButtonPointer.state);
ErrorF(" XkbLastRepeatEvent!=xE (0x%x!=0x%x) %s\n", DebugF(" XkbLastRepeatEvent!=xE (0x%x!=0x%x) %s\n",
XkbLastRepeatEvent,xE, XkbLastRepeatEvent,xE,
((XkbLastRepeatEvent!=(void *)xE)?"True":"False")); ((XkbLastRepeatEvent!=(void *)xE)?"True":"False"));
ErrorF(" (xkbClientEventsFlags&XWDA)==0 (0x%x) %s\n", DebugF(" (xkbClientEventsFlags&XWDA)==0 (0x%x) %s\n",
pClient->xkbClientFlags, pClient->xkbClientFlags,
(_XkbWantsDetectableAutoRepeat(pClient)?"True":"False")); (_XkbWantsDetectableAutoRepeat(pClient)?"True":"False"));
ErrorF(" !IsRelease(%d) %s\n",xE[0].u.u.type, DebugF(" !IsRelease(%d) %s\n",xE[0].u.u.type,
(!_XkbIsReleaseEvent(xE[0].u.u.type))?"True":"False"); (!_XkbIsReleaseEvent(xE[0].u.u.type))?"True":"False");
} }
#endif /* DEBUG */
if ( (XkbLastRepeatEvent==(void *)xE) && if ( (XkbLastRepeatEvent==(void *)xE) &&
(_XkbWantsDetectableAutoRepeat(pClient)) && (_XkbWantsDetectableAutoRepeat(pClient)) &&
(_XkbIsReleaseEvent(xE[0].u.u.type)) ) { (_XkbIsReleaseEvent(xE[0].u.u.type)) ) {
...@@ -853,13 +851,11 @@ XkbSrvInfoPtr xkbi; ...@@ -853,13 +851,11 @@ XkbSrvInfoPtr xkbi;
if (xE[0].u.u.type == ButtonPress && if (xE[0].u.u.type == ButtonPress &&
((xE[0].u.keyButtonPointer.state >> 7) & button_mask) == button_mask && ((xE[0].u.keyButtonPointer.state >> 7) & button_mask) == button_mask &&
(xkbi->lockedPtrButtons & button_mask) == button_mask) { (xkbi->lockedPtrButtons & button_mask) == button_mask) {
#ifdef DEBUG
/* If the MouseKeys is pressed, and the "real" mouse is also pressed /* If the MouseKeys is pressed, and the "real" mouse is also pressed
* when the mouse is released, the server does not behave properly. * when the mouse is released, the server does not behave properly.
* Faking a release of the button here solves the problem. * Faking a release of the button here solves the problem.
*/ */
ErrorF("Faking release of button %d\n", xE[0].u.u.detail); DebugF("Faking release of button %d\n", xE[0].u.u.detail);
#endif
XkbDDXFakePointerButton(ButtonRelease, xE[0].u.u.detail); XkbDDXFakePointerButton(ButtonRelease, xE[0].u.u.detail);
} }
} }
...@@ -868,19 +864,16 @@ XkbSrvInfoPtr xkbi; ...@@ -868,19 +864,16 @@ XkbSrvInfoPtr xkbi;
for (i=0;i<nEvents;i++) { for (i=0;i<nEvents;i++) {
type= xE[i].u.u.type; type= xE[i].u.u.type;
#ifdef DEBUG
if ((xkbDebugFlags&0x4)&& if ((xkbDebugFlags&0x4)&&
((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease))) { ((xE[0].u.u.type==KeyPress)||(xE[0].u.u.type==KeyRelease))) {
XkbStatePtr s= &xkbi->state; DebugF("XKbFilterWriteEvents (non-XKB):\n");
ErrorF("XKbFilterWriteEvents (non-XKB):\n"); DebugF("event= 0x%04x\n",xE[0].u.keyButtonPointer.state);
ErrorF("event= 0x%04x\n",xE[0].u.keyButtonPointer.state); DebugF("lookup= 0x%02x, grab= 0x%02x\n",xkbi->state.lookup_mods,
ErrorF("lookup= 0x%02x, grab= 0x%02x\n",s->lookup_mods, xkbi->state.grab_mods);
s->grab_mods); DebugF("compat lookup= 0x%02x, grab= 0x%02x\n",
ErrorF("compat lookup= 0x%02x, grab= 0x%02x\n", xkbi->state.compat_lookup_mods,
s->compat_lookup_mods, xkbi->state.compat_grab_mods);
s->compat_grab_mods);
} }
#endif
if ( (type>=KeyPress)&&(type<=MotionNotify) ) { if ( (type>=KeyPress)&&(type<=MotionNotify) ) {
CARD16 old,new; CARD16 old,new;
...@@ -900,9 +893,7 @@ XkbSrvInfoPtr xkbi; ...@@ -900,9 +893,7 @@ XkbSrvInfoPtr xkbi;
if (type == ButtonPress && if (type == ButtonPress &&
((xE[i].u.keyButtonPointer.state >> 7) & button_mask) == button_mask && ((xE[i].u.keyButtonPointer.state >> 7) & button_mask) == button_mask &&
(xkbi->lockedPtrButtons & button_mask) == button_mask) { (xkbi->lockedPtrButtons & button_mask) == button_mask) {
#ifdef DEBUG DebugF("Faking release of button %d\n", xE[i].u.u.detail);
ErrorF("Faking release of button %d\n", xE[i].u.u.detail);
#endif
XkbDDXFakePointerButton(ButtonRelease, xE[i].u.u.detail); XkbDDXFakePointerButton(ButtonRelease, xE[i].u.u.detail);
} }
} }
......
...@@ -284,10 +284,6 @@ XkbSetRulesDflts(char *rulesFile,char *model,char *layout, ...@@ -284,10 +284,6 @@ XkbSetRulesDflts(char *rulesFile,char *model,char *layout,
/***====================================================================***/ /***====================================================================***/
#if defined(luna)
#define XKB_DDX_PERMANENT_LOCK 1
#endif
#include "xkbDflts.h" #include "xkbDflts.h"
static Bool static Bool
...@@ -394,15 +390,6 @@ Atom unknown; ...@@ -394,15 +390,6 @@ Atom unknown;
names->indicators[LED_COMPOSE-1] = CREATE_ATOM("Compose"); names->indicators[LED_COMPOSE-1] = CREATE_ATOM("Compose");
#endif #endif
} }
#ifdef DEBUG_RADIO_GROUPS
if (names->num_rg<1) {
names->radio_groups= (Atom *)_XkbCalloc(RG_COUNT, sizeof(Atom));
if (names->radio_groups) {
names->num_rg = RG_COUNT;
names->radio_groups[RG_BOGUS_FUNCTION_GROUP]= CREATE_ATOM("BOGUS");
}
}
#endif
if (xkb->geom!=NULL) if (xkb->geom!=NULL)
names->geometry= xkb->geom->name; names->geometry= xkb->geom->name;
else names->geometry= unknown; else names->geometry= unknown;
...@@ -773,9 +760,7 @@ XkbSrvLedInfoPtr sli; ...@@ -773,9 +760,7 @@ XkbSrvLedInfoPtr sli;
sli= XkbFindSrvLedInfo(pXDev,XkbDfltXIClass,XkbDfltXIId,0); sli= XkbFindSrvLedInfo(pXDev,XkbDfltXIClass,XkbDfltXIId,0);
if (sli && xkbi) if (sli && xkbi)
XkbCheckIndicatorMaps(xkbi->device,sli,XkbAllIndicatorsMask); XkbCheckIndicatorMaps(xkbi->device,sli,XkbAllIndicatorsMask);
#ifdef DEBUG else DebugF("No indicator feedback in XkbFinishInit (shouldn't happen)!\n");
else ErrorF("No indicator feedback in XkbFinishInit (shouldn't happen)!\n");
#endif
return softRepeat; return softRepeat;
} }
......
...@@ -52,11 +52,9 @@ unsigned ndx; ...@@ -52,11 +52,9 @@ unsigned ndx;
xkbi= keyc->xkbInfo; xkbi= keyc->xkbInfo;
key= xE->u.u.detail; key= xE->u.u.detail;
#ifdef DEBUG
if (xkbDebugFlags&0x8) { if (xkbDebugFlags&0x8) {
ErrorF("XkbPKE: Key %d %s\n",key,(xE->u.u.type==KeyPress?"down":"up")); DebugF("XkbPKE: Key %d %s\n",key,(xE->u.u.type==KeyPress?"down":"up"));
} }
#endif
if ( (xkbi->repeatKey==key) && (xE->u.u.type==KeyRelease) && if ( (xkbi->repeatKey==key) && (xE->u.u.type==KeyRelease) &&
((xkbi->desc->ctrls->enabled_ctrls&XkbRepeatKeysMask)==0) ) { ((xkbi->desc->ctrls->enabled_ctrls&XkbRepeatKeysMask)==0) ) {
......
...@@ -187,20 +187,10 @@ XkbDescPtr xkb; ...@@ -187,20 +187,10 @@ XkbDescPtr xkb;
unsigned key,nG,explicit; unsigned key,nG,explicit;
KeySymsPtr pCore; KeySymsPtr pCore;
int types[XkbNumKbdGroups]; int types[XkbNumKbdGroups];
KeySym tsyms[XkbMaxSymsPerKey],*syms; KeySym tsyms[XkbMaxSymsPerKey] = {NoSymbol},*syms;
XkbMapChangesPtr mc; XkbMapChangesPtr mc;
xkb= pXDev->key->xkbInfo->desc; xkb= pXDev->key->xkbInfo->desc;
#ifdef NOTYET
if (first<xkb->min_key_code) {
if (first>=XkbMinLegalKeyCode) {
xkb->min_key_code= first;
/* 1/12/95 (ef) -- XXX! should zero out the new maps */
changes->map.changed|= XkbKeycodesMask;
generate a NewKeyboard notify here?
}
}
#endif
if (first+num-1>xkb->max_key_code) { if (first+num-1>xkb->max_key_code) {
/* 1/12/95 (ef) -- XXX! should allow XKB structures to grow */ /* 1/12/95 (ef) -- XXX! should allow XKB structures to grow */
num= xkb->max_key_code-first+1; num= xkb->max_key_code-first+1;
......
...@@ -50,10 +50,6 @@ XkbInternAtom(Display *dpy,char *str,Bool only_if_exists) ...@@ -50,10 +50,6 @@ XkbInternAtom(Display *dpy,char *str,Bool only_if_exists)
return MakeAtom(str,strlen(str),!only_if_exists); return MakeAtom(str,strlen(str),!only_if_exists);
} }
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
/***====================================================================***/ /***====================================================================***/
static XPointer static XPointer
...@@ -547,10 +543,8 @@ FindTypeForKey(XkbDescPtr xkb,Atom name,unsigned width,KeySym *syms) ...@@ -547,10 +543,8 @@ FindTypeForKey(XkbDescPtr xkb,Atom name,unsigned width,KeySym *syms)
register unsigned i; register unsigned i;
for (i=0;i<xkb->map->num_types;i++) { for (i=0;i<xkb->map->num_types;i++) {
if (xkb->map->types[i].name==name) { if (xkb->map->types[i].name==name) {
#ifdef DEBUG
if (xkb->map->types[i].num_levels!=width) if (xkb->map->types[i].num_levels!=width)
fprintf(stderr,"Group width mismatch between key and type\n"); DebugF("Group width mismatch between key and type\n");
#endif
return &xkb->map->types[i]; return &xkb->map->types[i];
} }
} }
...@@ -1072,10 +1066,8 @@ unsigned i,size_toc; ...@@ -1072,10 +1066,8 @@ unsigned i,size_toc;
ignored_result = fread(file_info,SIZEOF(xkmFileInfo),1,file); ignored_result = fread(file_info,SIZEOF(xkmFileInfo),1,file);
size_toc= file_info->num_toc; size_toc= file_info->num_toc;
if (size_toc>max_toc) { if (size_toc>max_toc) {
#ifdef DEBUG DebugF("Warning! Too many TOC entries; last %d ignored\n",
fprintf(stderr,"Warning! Too many TOC entries; last %d ignored\n",
size_toc-max_toc); size_toc-max_toc);
#endif
size_toc= max_toc; size_toc= max_toc;
} }
for (i=0;i<size_toc;i++) { for (i=0;i<size_toc;i++) {
...@@ -1185,8 +1177,12 @@ char name[100]; ...@@ -1185,8 +1177,12 @@ char name[100];
return Xstrdup(name); return Xstrdup(name);
break; break;
default: default:
/* tmpTOC is unitilaoized here, so we use the one from toc for now.
_XkbLibError(_XkbErrBadImplementation, _XkbLibError(_XkbErrBadImplementation,
XkbConfigText(tmpTOC.type,XkbMessage),0); XkbConfigText(tmpTOC.type,XkbMessage),0);
*/
_XkbLibError(_XkbErrBadImplementation,
XkbConfigText(toc->type,XkbMessage),0);
break; break;
} }
return NULL; return NULL;
...@@ -1215,11 +1211,7 @@ unsigned which= need|want; ...@@ -1215,11 +1211,7 @@ unsigned which= need|want;
if (result->xkb==NULL) if (result->xkb==NULL)
result->xkb= XkbAllocKeyboard(); result->xkb= XkbAllocKeyboard();
for (i=0;i<fileInfo.num_toc;i++) { for (i=0;i<fileInfo.num_toc;i++) {
#ifdef SEEK_SET
fseek(file,toc[i].offset,SEEK_SET); fseek(file,toc[i].offset,SEEK_SET);
#else
fseek(file,toc[i].offset,0);
#endif
tmp= fread(&tmpTOC,SIZEOF(xkmSectionInfo),1,file); tmp= fread(&tmpTOC,SIZEOF(xkmSectionInfo),1,file);
nRead= tmp*SIZEOF(xkmSectionInfo); nRead= tmp*SIZEOF(xkmSectionInfo);
if ((tmpTOC.type!=toc[i].type)||(tmpTOC.format!=toc[i].format)|| if ((tmpTOC.type!=toc[i].type)||(tmpTOC.format!=toc[i].format)||
......
...@@ -6,9 +6,9 @@ if [[ "${STATIC_ANALYSIS}" == "yes" ]]; then ...@@ -6,9 +6,9 @@ if [[ "${STATIC_ANALYSIS}" == "yes" ]]; then
echo 'Error: cppcheck is not installed.' >&2 echo 'Error: cppcheck is not installed.' >&2
exit 1 exit 1
fi fi
CPPCHECK_OPTS='--error-exitcode=0 --force --quiet' CPPCHECK_OPTS='--error-exitcode=0 --force --quiet --suppressions-list=./static-analysis-suppressions'
# we exclude some external projects # we exclude some external projects
CPPCHECK_EXCLUDES='-i ./nx-X11/extras/Mesa* -i ./nx-X11/extras/Mesa_* -i nx-X11/programs/Xserver/GL/mesa*' CPPCHECK_EXCLUDES='-i ./nx-X11/extras/ -i nx-X11/programs/Xserver/GL/mesa* -i ./.pc -i ./nx-X11/.build-exports -i ./nx-X11/exports -i ./doc'
echo "$(cppcheck --version):"; echo "$(cppcheck --version):";
cppcheck $CPPCHECK_OPTS $CPPCHECK_EXCLUDES .; cppcheck $CPPCHECK_OPTS $CPPCHECK_EXCLUDES .;
fi fi
memleak:nx-X11/programs/Xserver/dix/gc.c
memleak:nx-X11/lib/include/xtrans/Xtrans.c:982
memleak:nx-X11/lib/include/xtrans/Xtrans.c:987
memleak:nx-X11/lib/include/xtrans/Xtrans.c:1004
memleak:nx-X11/lib/include/xtrans/Xtrans.c:1009
uninitvar:nx-X11/lib/include/xtrans/Xtranssock.c:1107
uninitvar:nx-X11/lib/include/xtrans/Xtranssock.c:1109
uninitvar:nx-X11/lib/include/xtrans/Xtranssock.c:1146
uninitvar:nx-X11/lib/include/xtrans/Xtranssock.c:1148
memleak:nx-X11/lib/include/xtrans/Xtranssock.c:2446
memleak:nx-X11/lib/include/xtrans/Xtranssock.c:2458
nullPointer:nx-X11/programs/Xserver/Xext/security.c
nullPointerArithmetic:nx-X11/programs/Xserver/randr/rrcrtc.c
nullPointerArithmetic:nx-X11/programs/Xserver/randr/rroutput.c
nullPointerArithmetic:nx-X11/programs/Xserver/randr/rrprovider.c
nullPointerArithmetic:nx-X11/programs/Xserver/randr/rrscreen.c
memleak:nx-X11/programs/Xserver/render/render.c:2929
memleak:nx-X11/programs/Xserver/render/render.c:2991
memleak:nx-X11/programs/Xserver/render/render.c:3049
memleak:nx-X11/programs/Xserver/render/render.c:3103
memleak:nx-X11/programs/Xserver/render/render.c:3157
memleak:nx-X11/programs/Xserver/render/render.c:3288
doubleFree:nx-X11/programs/Xserver/hw/nxagent/Keyboard.c:1699
uninitStructMember:nx-X11/programs/Xserver/mi/miwideline.c:190
invalidFree:nxcomp/src/EncodeBuffer.cpp:84
invalidFree:nxcomp/src/EncodeBuffer.cpp:106
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment