aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r--nx-X11/programs/Xserver/Xext/xf86bigfont.c2
-rw-r--r--nx-X11/programs/Xserver/dix/devices.c3
-rw-r--r--nx-X11/programs/Xserver/fb/fbtrap.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Args.c2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Display.c39
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Rootless.c49
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Window.c10
-rw-r--r--nx-X11/programs/Xserver/record/record.c6
-rw-r--r--nx-X11/programs/Xserver/render/filter.c2
-rw-r--r--nx-X11/programs/Xserver/xfixes/cursor.c9
11 files changed, 65 insertions, 65 deletions
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
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;
}
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)
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"))
{
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c
index 85683503b..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);
@@ -185,13 +184,6 @@ 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
@@ -407,7 +382,7 @@ static void nxagentSigchldHandler(int signal)
* Leave the other children unaffected.
*/
- if (pid == 0 && nxagentRootlessDialogPid)
+ if (nxagentRootlessDialogPid)
{
pid = waitpid(nxagentRootlessDialogPid, &status, options);
@@ -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;
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;
}
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c
index 68c6890d8..f42f9d99d 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++)
@@ -334,6 +341,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
if (!ntoplevel)
{
+ free(toplevel);
return;
}
@@ -343,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
@@ -386,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
@@ -496,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;
@@ -639,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;
@@ -689,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;
@@ -965,7 +990,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 +1011,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);
@@ -1036,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;
@@ -1066,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;
@@ -1184,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
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;
}
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;
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;
}
diff --git a/nx-X11/programs/Xserver/xfixes/cursor.c b/nx-X11/programs/Xserver/xfixes/cursor.c
index 67f46f55e..441c4d0b2 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;
@@ -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);
}