From df0fea79bf58b8b1106cd42b90af42ef4aaed52e Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 13 Dec 2016 01:56:10 +0100 Subject: Args.c: Fix missing parentheses --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index a6c21503a..2bc12a3b4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1235,9 +1235,11 @@ static void nxagentParseOptions(char *name, char *value) return; #else if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) + { nxagentChangeOption(Xinerama, 0); fprintf(stderr, "Warning: XINERAMA extension has been disabled on %s startup.\n", __progname); return; + } if (!strcmp(value, "1")) { -- cgit v1.2.3 From fcb5e8a0e5f39351d66061ab4048edd6a5a58ea8 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 13 Dec 2016 01:56:57 +0100 Subject: Rootless.c: Fix wrongly negated comparisons --- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 68c6890d8..34902456d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -965,7 +965,7 @@ void nxagentImportProperty(Window window, } } - if ((wmHints.flags & IconWindowHint) && (wmHints.icon_window =! None)) + if ((wmHints.flags & IconWindowHint) && (wmHints.icon_window != None)) { WindowPtr icon = nxagentWindowPtr(wmHints.icon_window); @@ -986,7 +986,7 @@ void nxagentImportProperty(Window window, } } - if ((wmHints.flags & IconMaskHint) && (wmHints.icon_mask =! None)) + if ((wmHints.flags & IconMaskHint) && (wmHints.icon_mask != None)) { PixmapPtr icon = nxagentPixmapPtr(wmHints.icon_mask); -- cgit v1.2.3 From 4a1095fffb03396fc7eec5a11bc9139ebc831cb6 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 13 Dec 2016 02:00:40 +0100 Subject: Keyboard.c: Simplify if clause --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 88af5d400..208ae0653 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -997,8 +997,7 @@ XkbError: XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap, nxagentBell, nxagentChangeKeyboardControl); - if (!nxagentKeyboard || - (nxagentKeyboard && (strcmp(nxagentKeyboard, "query") == 0))) + if (!nxagentKeyboard || strcmp(nxagentKeyboard, "query") == 0) { goto XkbError; } @@ -1083,8 +1082,7 @@ XkbError: free(nxagentXkbConfigFilePath); - if (!nxagentKeyboard || - (nxagentKeyboard && (strcmp(nxagentKeyboard, "query") == 0))) + if (!nxagentKeyboard || strcmp(nxagentKeyboard, "query") == 0) { goto XkbError; } -- cgit v1.2.3 From 35e41467a2ef4c2ddd4b545c2d68abf47278aa1e Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 13 Dec 2016 02:02:29 +0100 Subject: Window.c: Fix reference before check for null pointer --- nx-X11/programs/Xserver/hw/nxagent/Window.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 982c88314..23e1d5452 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -3122,10 +3122,14 @@ static void nxagentReconfigureWindowCursor(void * param0, XID param1, void * dat WindowPtr pWin = (WindowPtr)param0; Bool *pBool = (Bool*)data_buffer; CursorPtr pCursor; - ScreenPtr pScreen = pWin -> drawable.pScreen; + ScreenPtr pScreen; - if (!pWin || !*pBool || !(pCursor = wCursor(pWin)) || - !(nxagentCursorPriv(pCursor, pScreen))) + if (!pWin || !*pBool || !(pCursor = wCursor(pWin))) + return; + + pScreen = pWin -> drawable.pScreen; + + if (!(nxagentCursorPriv(pCursor, pScreen))) { return; } -- cgit v1.2.3 From 1b6b76b5bfb849586c73a9601a05eda39ca87ada Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Tue, 13 Dec 2016 10:05:40 +0100 Subject: Display.c: pid is always 0, remove check --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 85683503b..f4fc19578 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -407,7 +407,7 @@ static void nxagentSigchldHandler(int signal) * Leave the other children unaffected. */ - if (pid == 0 && nxagentRootlessDialogPid) + if (nxagentRootlessDialogPid) { pid = waitpid(nxagentRootlessDialogPid, &status, options); -- cgit v1.2.3 From 4e545710f9c4d14ed8188e4f89b8d9c2da7975ef Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 14 Dec 2016 11:49:40 +0100 Subject: Rootless.c: fix possible memleak --- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 34902456d..64ad83bba 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -334,6 +334,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) if (!ntoplevel) { + free(toplevel); return; } -- cgit v1.2.3 From a83022a4a97b12904cf5d79f399336fff2d30e43 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 14 Dec 2016 11:50:21 +0100 Subject: Rootless.c: improve malloc failure handling --- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 36 +++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 64ad83bba..7862a5557 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -315,6 +315,13 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) Mask mask; toplevel = malloc(sizeof(WindowPtr) * nchildren); + + if (!toplevel) + { + /* FIXME: Is this too much and we and simply return here? */ + FatalError("nxagentRootlessRestack: malloc() failed."); + } + ntoplevel = 0; for(i = 0; i < nchildren; i++) @@ -497,6 +504,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) #ifdef _XSERVER64 else if (strcmp(typeS, "CARDINAL") == 0 || strcmp(typeS, "WM_SIZE_HINTS") == 0) { + /* FIXME: is it okay here to ignore malloc fails? */ unsigned long *buffer = malloc(nUnits * sizeof(*buffer)); int *input = value; int i; @@ -640,6 +648,14 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) int i; int j = 0; + if (!atoms) + { + #ifdef WARNING + fprintf(stderr, "nxagentExportProperty: WARNING! malloc() failed for '%s'- bailing out.\n", typeS); + #endif + return False; + } + freeMem = True; export = True; output = (char *) atoms; @@ -690,6 +706,14 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) WindowPtr pWindow; int i; + if (!wind) + { + #ifdef WARNING + fprintf(stderr, "nxagentExportProperty: WARNING! malloc() failed for '%s' - bailing out.\n", typeS); + #endif + return False; + } + freeMem = True; export = True; output = (char*) wind; @@ -1037,7 +1061,7 @@ void nxagentImportProperty(Window window, if (atoms == NULL) { #ifdef WARNING - fprintf(stderr, "nxagentImportProperty: WARNING! Malloc failed bailing out.\n"); + fprintf(stderr, "nxagentImportProperty: WARNING! malloc() failed for '%s' - bailing out.\n", typeS); #endif return; @@ -1067,6 +1091,14 @@ void nxagentImportProperty(Window window, WindowPtr pWindow; int i; + if (!wind) + { + #ifdef WARNING + fprintf(stderr, "nxagentImportProperty: WARNING! malloc() failed for '%s' - bailing out.\n", typeS); + #endif + + return; + } freeMem = True; import = True; output = (char*) wind; @@ -1185,7 +1217,7 @@ void nxagentAddPropertyToList(Atom property, WindowPtr pWin) if ((tmp = malloc(sizeof(struct nxagentPropertyRec))) == NULL) { - FatalError("nxagentAddPropertyToList: malloc failed."); + FatalError("nxagentAddPropertyToList: malloc() failed."); } #ifdef TEST -- cgit v1.2.3 From 2a6fcfc142d609339bdeb836b7e3be525967a5f8 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 14 Dec 2016 11:50:47 +0100 Subject: Rootless.c: improve debugging output --- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 7862a5557..f42f9d99d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -351,14 +351,14 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) for (i = 0; i < ntoplevel; i++) { - fprintf(stderr, "[%p]\n", toplevel[i]); + fprintf(stderr, "nxagentRootlessRestack: [%p]\n", toplevel[i]); } fprintf(stderr, "nxagentRootlessRestack: Internal top level windows before restack:"); for (pWin = screenInfo.screens[0]->root -> firstChild; pWin != NULL; pWin = pWin -> nextSib) { - fprintf(stderr, "[%p]\n", pWin); + fprintf(stderr, "nxagentRootlessRestack: [%p]\n", pWin); } #endif @@ -394,14 +394,14 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) for (i = 0; i < ntoplevel; i++) { - fprintf(stderr, "[%p]\n", toplevel[i]); + fprintf(stderr, "nxagentRootlessRestack: [%p]\n", toplevel[i]); } fprintf(stderr, "nxagentRootlessRestack: Internal top level windows after restack:"); for (pWin = screenInfo.screens[0]->root -> firstChild; pWin != NULL; pWin = pWin -> nextSib) { - fprintf(stderr, "[%p]\n", pWin); + fprintf(stderr, "nxagentRootlessRestack: [%p]\n", pWin); } #endif -- cgit v1.2.3 From fe887d68aea4f7f8ae892a9e3fbbdfd80eae1357 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 3 Mar 2017 23:32:52 +0100 Subject: Display.c: remove unused logo code --- nx-X11/programs/Xserver/hw/nxagent/Display.c | 37 ---------------------------- 1 file changed, 37 deletions(-) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index f4fc19578..599b335f6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -169,7 +169,6 @@ Pixmap nxagentIconPixmap; Pixmap nxagentIconShape; Bool useXpmIcon = False; -unsigned int nxagentLogoColor(unsigned int value); Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask); @@ -184,13 +183,6 @@ static int nxagentCheckForPixmapFormatsCompatibility(void); static int nxagentInitAndCheckVisuals(int flexibility); static int nxagentCheckForColormapsCompatibility(int flexibility); -/* - * FIXME: These must definitely become local. - */ - -XVisualInfo pV; -unsigned int r, b, g, or, ob, og, off; - /* * Save Internal implementation Also called in Reconnect.c. */ @@ -217,23 +209,6 @@ int nxagentServerOrder() return MSBFirst; } -unsigned int nxagentLogoColor(unsigned int value) -{ - /* - * Takes a color value in RGB24 (0xff0000, 0x00ff00, - * 0x0000ff) and converts it into an equivalent for - * the current visual. - */ - - int cr=0, cg=0, cb=0; - - cr = (value >> or) &r; - cg = (value >> (og - 8)) &g; - cb = (value >> (ob - 16)) &b; - - return (cr | cg | cb); -} - /* * FIXME: This error handler is not printing anything * in the session log. This is OK once the session is @@ -1412,12 +1387,6 @@ FIXME: Use of nxagentParentWindow is strongly deprecated. DefaultScreen(nxagentDisplay) ); - pV = nxagentVisuals[nxagentDefaultVisualIndex]; - - r = pV.red_mask; - g = pV.green_mask; - b = pV.blue_mask; - nxagentLogoBlack = 0x000000; nxagentLogoRed = 0xff0000; nxagentLogoWhite = 0xffffff; @@ -2880,12 +2849,6 @@ Bool nxagentReconnectDisplay(void *p0) nxagentLogoDepth = DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay)); - pV = nxagentVisuals[nxagentDefaultVisualIndex]; - - r = pV.red_mask; - g = pV.green_mask; - b = pV.blue_mask; - nxagentLogoBlack = 0x000000; nxagentLogoRed = 0xff0000; nxagentLogoWhite = 0xffffff; -- cgit v1.2.3 From e17c42e55fba79c1e265928f85bfd2b6c9908adb Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 3 Mar 2017 23:43:50 +0100 Subject: dix: Fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit devices.c: In function ‘_AddInputDevice’: devices.c:120:22: warning: assignment from incompatible pointer type [enabled by default] dev->devPrivates = dev->unwrapProc = NULL; --- nx-X11/programs/Xserver/dix/devices.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c index 3821d1290..d649a8657 100644 --- a/nx-X11/programs/Xserver/dix/devices.c +++ b/nx-X11/programs/Xserver/dix/devices.c @@ -117,7 +117,8 @@ _AddInputDevice(DeviceProc deviceProc, Bool autoStart) dev->xkb_interest= NULL; #endif dev->nPrivates = 0; - dev->devPrivates = dev->unwrapProc = NULL; + dev->devPrivates = NULL; + dev->unwrapProc = NULL; inputInfo.off_devices = dev; return dev; } -- cgit v1.2.3 From c1ed005694f590497f207f94085da593574c63e5 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 3 Mar 2017 23:52:20 +0100 Subject: fb: fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fbtrap.c: In function ‘fbRasterizeTrapezoid’: fbtrap.c:113:12: warning: variable ‘x_off_fixed’ set but not used [-Wunused-but-set-variable] xFixed x_off_fixed; --- nx-X11/programs/Xserver/fb/fbtrap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/nx-X11/programs/Xserver/fb/fbtrap.c b/nx-X11/programs/Xserver/fb/fbtrap.c index 1940bc209..c9951b00d 100644 --- a/nx-X11/programs/Xserver/fb/fbtrap.c +++ b/nx-X11/programs/Xserver/fb/fbtrap.c @@ -110,7 +110,6 @@ fbRasterizeTrapezoid (PicturePtr pPicture, int height; int pxoff, pyoff; - xFixed x_off_fixed; xFixed y_off_fixed; RenderEdge l, r; xFixed t, b; @@ -125,7 +124,6 @@ fbRasterizeTrapezoid (PicturePtr pPicture, x_off += pxoff; y_off += pyoff; - x_off_fixed = IntToxFixed(x_off); y_off_fixed = IntToxFixed(y_off); t = trap->top + y_off_fixed; if (t < 0) -- cgit v1.2.3 From a9d4a454b82425e49f739efdc6cfd8fa6c268fbd Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 4 Mar 2017 00:10:57 +0100 Subject: record.c: fix compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit record.c: In function ‘RecordAReply’: record.c:714:7: warning: passing argument 4 of ‘RecordAProtocolElement’ discards ‘const’ qualifier from pointer target type [enabled by default] pri->replyData, pri->dataLenBytes, /* continuation */ -1); ^ record.c:286:1: note: expected ‘void *’ but argument is of type ‘const void *’ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, ^ record.c:724:10: warning: passing argument 4 of ‘RecordAProtocolElement’ discards ‘const’ qualifier from pointer target type [enabled by default] pri->replyData, pri->dataLenBytes, pri->bytesRemaining); ^ record.c:286:1: note: expected ‘void *’ but argument is of type ‘const void *’ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, ^ record.c:746:5: warning: passing argument 4 of ‘RecordAProtocolElement’ discards ‘const’ qualifier from pointer target type [enabled by default] pri->dataLenBytes, pri->bytesRemaining); ^ record.c:286:1: note: expected ‘void *’ but argument is of type ‘const void *’ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient, ^ --- nx-X11/programs/Xserver/record/record.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nx-X11/programs/Xserver/record/record.c b/nx-X11/programs/Xserver/record/record.c index bf3f9decb..df9419f22 100644 --- a/nx-X11/programs/Xserver/record/record.c +++ b/nx-X11/programs/Xserver/record/record.c @@ -711,7 +711,7 @@ RecordAReply(pcbl, nulldata, calldata) if (pContext->continuedReply) { RecordAProtocolElement(pContext, client, XRecordFromServer, - pri->replyData, pri->dataLenBytes, /* continuation */ -1); + (void *)pri->replyData, pri->dataLenBytes, /* continuation */ -1); if (!pri->bytesRemaining) pContext->continuedReply = 0; } @@ -721,7 +721,7 @@ RecordAReply(pcbl, nulldata, calldata) if (majorop <= 127) { /* core reply */ RecordAProtocolElement(pContext, client, XRecordFromServer, - pri->replyData, pri->dataLenBytes, pri->bytesRemaining); + (void *)pri->replyData, pri->dataLenBytes, pri->bytesRemaining); if (pri->bytesRemaining) pContext->continuedReply = 1; } @@ -742,7 +742,7 @@ RecordAReply(pcbl, nulldata, calldata) minorop)) { RecordAProtocolElement(pContext, client, - XRecordFromServer, pri->replyData, + XRecordFromServer, (void *)pri->replyData, pri->dataLenBytes, pri->bytesRemaining); if (pri->bytesRemaining) pContext->continuedReply = 1; -- cgit v1.2.3 From e79d3ac6b168e55ffc43ab9afcc5fef35d94f780 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 4 Mar 2017 00:15:08 +0100 Subject: render/filter.c: add missing return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes filter.c: In function ‘SetPicturePictFilter’: filter.c:363:5: warning: ‘return’ with no value, in function returning non-void [enabled by default] return ; ^ --- nx-X11/programs/Xserver/render/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/render/filter.c b/nx-X11/programs/Xserver/render/filter.c index 10e732997..71b893a75 100644 --- a/nx-X11/programs/Xserver/render/filter.c +++ b/nx-X11/programs/Xserver/render/filter.c @@ -360,5 +360,5 @@ SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter, } pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; - return ; + return Success; } -- cgit v1.2.3 From 914f78a23e91f9cb545e122c55c2381f47e3740c Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 4 Mar 2017 00:24:12 +0100 Subject: xfixes: fix compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cursor.c: In function ‘ProcXFixesGetCursorName’: cursor.c:399:6: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] str = NameForAtom (pCursor->name); ^ cursor.c: In function ‘ProcXFixesGetCursorImageAndName’: cursor.c:453:10: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] name = pCursor->name ? NameForAtom (pCursor->name) : ""; ^ --- nx-X11/programs/Xserver/xfixes/cursor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index 67f46f55e..4e87fdd4a 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -390,7 +390,7 @@ ProcXFixesGetCursorName (ClientPtr client) CursorPtr pCursor; xXFixesGetCursorNameReply reply; REQUEST(xXFixesGetCursorNameReq); - char *str; + const char *str; int len; REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); @@ -437,7 +437,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) CursorPtr pCursor; CARD32 *image; int npixels; - char *name; + const char *name; int nbytes, nbytesRound; int width, height; int x, y; -- cgit v1.2.3 From e021bc231fae81137226a74d16f13b8168fe670d Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 4 Mar 2017 00:28:01 +0100 Subject: xfixes: fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cursor.c: In function ‘TestForCursorName’: cursor.c:649:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] return (pCursor->name == (Atom) closure); ^ cursor.c: In function ‘ProcXFixesChangeCursorByName’: cursor.c:665:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] ReplaceCursor (pSource, TestForCursorName, (void *) name); ^ Backport of commit 019ad5acd20e34dc2aa3b89cc426138db5164c48 Author: Eamon Walsh Date: Tue Feb 5 15:44:41 2008 -0500 XFixes: squash a pointer/integer size mismatch warning. --- nx-X11/programs/Xserver/xfixes/cursor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c index 4e87fdd4a..441c4d0b2 100644 --- a/nx-X11/programs/Xserver/xfixes/cursor.c +++ b/nx-X11/programs/Xserver/xfixes/cursor.c @@ -641,7 +641,8 @@ SProcXFixesChangeCursor (ClientPtr client) static Bool TestForCursorName (CursorPtr pCursor, void * closure) { - return (pCursor->name == (Atom) closure); + Atom *pName = closure; + return (pCursor->name == *pName); } int @@ -657,7 +658,7 @@ ProcXFixesChangeCursorByName (ClientPtr client) tchar = (char *) &stuff[1]; name = MakeAtom (tchar, stuff->nbytes, FALSE); if (name) - ReplaceCursor (pSource, TestForCursorName, (void *) name); + ReplaceCursor (pSource, TestForCursorName, &name); return (client->noClientException); } -- cgit v1.2.3 From ee2a933c3d4ad65849443cc917c59ad479083ca8 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Sat, 4 Mar 2017 01:12:24 +0100 Subject: Xext: fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit xf86bigfont.c: In function ‘ProcXF86BigfontQueryFont’: xf86bigfont.c:724:9: warning: ‘pDesc’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (!pDesc) free(pCI); --- nx-X11/programs/Xserver/Xext/xf86bigfont.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nx-X11/programs/Xserver/Xext/xf86bigfont.c b/nx-X11/programs/Xserver/Xext/xf86bigfont.c index 64b65900e..0ad411fc3 100644 --- a/nx-X11/programs/Xserver/Xext/xf86bigfont.c +++ b/nx-X11/programs/Xserver/Xext/xf86bigfont.c @@ -418,7 +418,7 @@ ProcXF86BigfontQueryFont( int nCharInfos; int shmid; #ifdef HAS_SHM - ShmDescPtr pDesc; + ShmDescPtr pDesc = NULL; #else #define pDesc 0 #endif -- cgit v1.2.3