Unverified Commit 320cece2 authored by Mihai Moldovan's avatar Mihai Moldovan

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

parents dc8477f7 ee2a933c
...@@ -418,7 +418,7 @@ ProcXF86BigfontQueryFont( ...@@ -418,7 +418,7 @@ ProcXF86BigfontQueryFont(
int nCharInfos; int nCharInfos;
int shmid; int shmid;
#ifdef HAS_SHM #ifdef HAS_SHM
ShmDescPtr pDesc; ShmDescPtr pDesc = NULL;
#else #else
#define pDesc 0 #define pDesc 0
#endif #endif
......
...@@ -117,7 +117,8 @@ _AddInputDevice(DeviceProc deviceProc, Bool autoStart) ...@@ -117,7 +117,8 @@ _AddInputDevice(DeviceProc deviceProc, Bool autoStart)
dev->xkb_interest= NULL; dev->xkb_interest= NULL;
#endif #endif
dev->nPrivates = 0; dev->nPrivates = 0;
dev->devPrivates = dev->unwrapProc = NULL; dev->devPrivates = NULL;
dev->unwrapProc = NULL;
inputInfo.off_devices = dev; inputInfo.off_devices = dev;
return dev; return dev;
} }
......
...@@ -110,7 +110,6 @@ fbRasterizeTrapezoid (PicturePtr pPicture, ...@@ -110,7 +110,6 @@ fbRasterizeTrapezoid (PicturePtr pPicture,
int height; int height;
int pxoff, pyoff; int pxoff, pyoff;
xFixed x_off_fixed;
xFixed y_off_fixed; xFixed y_off_fixed;
RenderEdge l, r; RenderEdge l, r;
xFixed t, b; xFixed t, b;
...@@ -125,7 +124,6 @@ fbRasterizeTrapezoid (PicturePtr pPicture, ...@@ -125,7 +124,6 @@ fbRasterizeTrapezoid (PicturePtr pPicture,
x_off += pxoff; x_off += pxoff;
y_off += pyoff; y_off += pyoff;
x_off_fixed = IntToxFixed(x_off);
y_off_fixed = IntToxFixed(y_off); y_off_fixed = IntToxFixed(y_off);
t = trap->top + y_off_fixed; t = trap->top + y_off_fixed;
if (t < 0) if (t < 0)
......
...@@ -1235,9 +1235,11 @@ static void nxagentParseOptions(char *name, char *value) ...@@ -1235,9 +1235,11 @@ static void nxagentParseOptions(char *name, char *value)
return; return;
#else #else
if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND)
{
nxagentChangeOption(Xinerama, 0); nxagentChangeOption(Xinerama, 0);
fprintf(stderr, "Warning: XINERAMA extension has been disabled on %s startup.\n", __progname); fprintf(stderr, "Warning: XINERAMA extension has been disabled on %s startup.\n", __progname);
return; return;
}
if (!strcmp(value, "1")) if (!strcmp(value, "1"))
{ {
......
...@@ -169,7 +169,6 @@ Pixmap nxagentIconPixmap; ...@@ -169,7 +169,6 @@ Pixmap nxagentIconPixmap;
Pixmap nxagentIconShape; Pixmap nxagentIconShape;
Bool useXpmIcon = False; Bool useXpmIcon = False;
unsigned int nxagentLogoColor(unsigned int value);
Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask); Bool nxagentMakeIcon(Display *display, Pixmap *nxIcon, Pixmap *nxMask);
...@@ -185,13 +184,6 @@ static int nxagentInitAndCheckVisuals(int flexibility); ...@@ -185,13 +184,6 @@ static int nxagentInitAndCheckVisuals(int flexibility);
static int nxagentCheckForColormapsCompatibility(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. * Save Internal implementation Also called in Reconnect.c.
*/ */
...@@ -217,23 +209,6 @@ int nxagentServerOrder() ...@@ -217,23 +209,6 @@ int nxagentServerOrder()
return MSBFirst; 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 * FIXME: This error handler is not printing anything
* in the session log. This is OK once the session is * in the session log. This is OK once the session is
...@@ -407,7 +382,7 @@ static void nxagentSigchldHandler(int signal) ...@@ -407,7 +382,7 @@ static void nxagentSigchldHandler(int signal)
* Leave the other children unaffected. * Leave the other children unaffected.
*/ */
if (pid == 0 && nxagentRootlessDialogPid) if (nxagentRootlessDialogPid)
{ {
pid = waitpid(nxagentRootlessDialogPid, &status, options); pid = waitpid(nxagentRootlessDialogPid, &status, options);
...@@ -1412,12 +1387,6 @@ FIXME: Use of nxagentParentWindow is strongly deprecated. ...@@ -1412,12 +1387,6 @@ FIXME: Use of nxagentParentWindow is strongly deprecated.
DefaultScreen(nxagentDisplay) DefaultScreen(nxagentDisplay)
); );
pV = nxagentVisuals[nxagentDefaultVisualIndex];
r = pV.red_mask;
g = pV.green_mask;
b = pV.blue_mask;
nxagentLogoBlack = 0x000000; nxagentLogoBlack = 0x000000;
nxagentLogoRed = 0xff0000; nxagentLogoRed = 0xff0000;
nxagentLogoWhite = 0xffffff; nxagentLogoWhite = 0xffffff;
...@@ -2880,12 +2849,6 @@ Bool nxagentReconnectDisplay(void *p0) ...@@ -2880,12 +2849,6 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentLogoDepth = DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay)); nxagentLogoDepth = DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay));
pV = nxagentVisuals[nxagentDefaultVisualIndex];
r = pV.red_mask;
g = pV.green_mask;
b = pV.blue_mask;
nxagentLogoBlack = 0x000000; nxagentLogoBlack = 0x000000;
nxagentLogoRed = 0xff0000; nxagentLogoRed = 0xff0000;
nxagentLogoWhite = 0xffffff; nxagentLogoWhite = 0xffffff;
......
...@@ -997,8 +997,7 @@ XkbError: ...@@ -997,8 +997,7 @@ XkbError:
XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap, XkbInitKeyboardDeviceStruct((void *)pDev, &names, &keySyms, modmap,
nxagentBell, nxagentChangeKeyboardControl); nxagentBell, nxagentChangeKeyboardControl);
if (!nxagentKeyboard || if (!nxagentKeyboard || strcmp(nxagentKeyboard, "query") == 0)
(nxagentKeyboard && (strcmp(nxagentKeyboard, "query") == 0)))
{ {
goto XkbError; goto XkbError;
} }
...@@ -1083,8 +1082,7 @@ XkbError: ...@@ -1083,8 +1082,7 @@ XkbError:
free(nxagentXkbConfigFilePath); free(nxagentXkbConfigFilePath);
if (!nxagentKeyboard || if (!nxagentKeyboard || strcmp(nxagentKeyboard, "query") == 0)
(nxagentKeyboard && (strcmp(nxagentKeyboard, "query") == 0)))
{ {
goto XkbError; goto XkbError;
} }
......
...@@ -315,6 +315,13 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) ...@@ -315,6 +315,13 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
Mask mask; Mask mask;
toplevel = malloc(sizeof(WindowPtr) * nchildren); toplevel = malloc(sizeof(WindowPtr) * nchildren);
if (!toplevel)
{
/* FIXME: Is this too much and we and simply return here? */
FatalError("nxagentRootlessRestack: malloc() failed.");
}
ntoplevel = 0; ntoplevel = 0;
for(i = 0; i < nchildren; i++) for(i = 0; i < nchildren; i++)
...@@ -334,6 +341,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) ...@@ -334,6 +341,7 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
if (!ntoplevel) if (!ntoplevel)
{ {
free(toplevel);
return; return;
} }
...@@ -343,14 +351,14 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) ...@@ -343,14 +351,14 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
for (i = 0; i < ntoplevel; i++) 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:"); fprintf(stderr, "nxagentRootlessRestack: Internal top level windows before restack:");
for (pWin = screenInfo.screens[0]->root -> firstChild; pWin != NULL; pWin = pWin -> nextSib) for (pWin = screenInfo.screens[0]->root -> firstChild; pWin != NULL; pWin = pWin -> nextSib)
{ {
fprintf(stderr, "[%p]\n", pWin); fprintf(stderr, "nxagentRootlessRestack: [%p]\n", pWin);
} }
#endif #endif
...@@ -386,14 +394,14 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren) ...@@ -386,14 +394,14 @@ void nxagentRootlessRestack(unsigned long children[], unsigned int nchildren)
for (i = 0; i < ntoplevel; i++) 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:"); fprintf(stderr, "nxagentRootlessRestack: Internal top level windows after restack:");
for (pWin = screenInfo.screens[0]->root -> firstChild; pWin != NULL; pWin = pWin -> nextSib) for (pWin = screenInfo.screens[0]->root -> firstChild; pWin != NULL; pWin = pWin -> nextSib)
{ {
fprintf(stderr, "[%p]\n", pWin); fprintf(stderr, "nxagentRootlessRestack: [%p]\n", pWin);
} }
#endif #endif
...@@ -496,6 +504,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -496,6 +504,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
#ifdef _XSERVER64 #ifdef _XSERVER64
else if (strcmp(typeS, "CARDINAL") == 0 || strcmp(typeS, "WM_SIZE_HINTS") == 0) 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)); unsigned long *buffer = malloc(nUnits * sizeof(*buffer));
int *input = value; int *input = value;
int i; int i;
...@@ -639,6 +648,14 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -639,6 +648,14 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
int i; int i;
int j = 0; int j = 0;
if (!atoms)
{
#ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! malloc() failed for '%s'- bailing out.\n", typeS);
#endif
return False;
}
freeMem = True; freeMem = True;
export = True; export = True;
output = (char *) atoms; output = (char *) atoms;
...@@ -689,6 +706,14 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) ...@@ -689,6 +706,14 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
WindowPtr pWindow; WindowPtr pWindow;
int i; int i;
if (!wind)
{
#ifdef WARNING
fprintf(stderr, "nxagentExportProperty: WARNING! malloc() failed for '%s' - bailing out.\n", typeS);
#endif
return False;
}
freeMem = True; freeMem = True;
export = True; export = True;
output = (char*) wind; output = (char*) wind;
...@@ -965,7 +990,7 @@ void nxagentImportProperty(Window window, ...@@ -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); WindowPtr icon = nxagentWindowPtr(wmHints.icon_window);
...@@ -986,7 +1011,7 @@ void nxagentImportProperty(Window 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); PixmapPtr icon = nxagentPixmapPtr(wmHints.icon_mask);
...@@ -1036,7 +1061,7 @@ void nxagentImportProperty(Window window, ...@@ -1036,7 +1061,7 @@ void nxagentImportProperty(Window window,
if (atoms == NULL) if (atoms == NULL)
{ {
#ifdef WARNING #ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! Malloc failed bailing out.\n"); fprintf(stderr, "nxagentImportProperty: WARNING! malloc() failed for '%s' - bailing out.\n", typeS);
#endif #endif
return; return;
...@@ -1066,6 +1091,14 @@ void nxagentImportProperty(Window window, ...@@ -1066,6 +1091,14 @@ void nxagentImportProperty(Window window,
WindowPtr pWindow; WindowPtr pWindow;
int i; int i;
if (!wind)
{
#ifdef WARNING
fprintf(stderr, "nxagentImportProperty: WARNING! malloc() failed for '%s' - bailing out.\n", typeS);
#endif
return;
}
freeMem = True; freeMem = True;
import = True; import = True;
output = (char*) wind; output = (char*) wind;
...@@ -1184,7 +1217,7 @@ void nxagentAddPropertyToList(Atom property, WindowPtr pWin) ...@@ -1184,7 +1217,7 @@ void nxagentAddPropertyToList(Atom property, WindowPtr pWin)
if ((tmp = malloc(sizeof(struct nxagentPropertyRec))) == NULL) if ((tmp = malloc(sizeof(struct nxagentPropertyRec))) == NULL)
{ {
FatalError("nxagentAddPropertyToList: malloc failed."); FatalError("nxagentAddPropertyToList: malloc() failed.");
} }
#ifdef TEST #ifdef TEST
......
...@@ -3122,10 +3122,14 @@ static void nxagentReconfigureWindowCursor(void * param0, XID param1, void * dat ...@@ -3122,10 +3122,14 @@ static void nxagentReconfigureWindowCursor(void * param0, XID param1, void * dat
WindowPtr pWin = (WindowPtr)param0; WindowPtr pWin = (WindowPtr)param0;
Bool *pBool = (Bool*)data_buffer; Bool *pBool = (Bool*)data_buffer;
CursorPtr pCursor; CursorPtr pCursor;
ScreenPtr pScreen = pWin -> drawable.pScreen; ScreenPtr pScreen;
if (!pWin || !*pBool || !(pCursor = wCursor(pWin)) || if (!pWin || !*pBool || !(pCursor = wCursor(pWin)))
!(nxagentCursorPriv(pCursor, pScreen))) return;
pScreen = pWin -> drawable.pScreen;
if (!(nxagentCursorPriv(pCursor, pScreen)))
{ {
return; return;
} }
......
...@@ -711,7 +711,7 @@ RecordAReply(pcbl, nulldata, calldata) ...@@ -711,7 +711,7 @@ RecordAReply(pcbl, nulldata, calldata)
if (pContext->continuedReply) if (pContext->continuedReply)
{ {
RecordAProtocolElement(pContext, client, XRecordFromServer, RecordAProtocolElement(pContext, client, XRecordFromServer,
pri->replyData, pri->dataLenBytes, /* continuation */ -1); (void *)pri->replyData, pri->dataLenBytes, /* continuation */ -1);
if (!pri->bytesRemaining) if (!pri->bytesRemaining)
pContext->continuedReply = 0; pContext->continuedReply = 0;
} }
...@@ -721,7 +721,7 @@ RecordAReply(pcbl, nulldata, calldata) ...@@ -721,7 +721,7 @@ RecordAReply(pcbl, nulldata, calldata)
if (majorop <= 127) if (majorop <= 127)
{ /* core reply */ { /* core reply */
RecordAProtocolElement(pContext, client, XRecordFromServer, RecordAProtocolElement(pContext, client, XRecordFromServer,
pri->replyData, pri->dataLenBytes, pri->bytesRemaining); (void *)pri->replyData, pri->dataLenBytes, pri->bytesRemaining);
if (pri->bytesRemaining) if (pri->bytesRemaining)
pContext->continuedReply = 1; pContext->continuedReply = 1;
} }
...@@ -742,7 +742,7 @@ RecordAReply(pcbl, nulldata, calldata) ...@@ -742,7 +742,7 @@ RecordAReply(pcbl, nulldata, calldata)
minorop)) minorop))
{ {
RecordAProtocolElement(pContext, client, RecordAProtocolElement(pContext, client,
XRecordFromServer, pri->replyData, XRecordFromServer, (void *)pri->replyData,
pri->dataLenBytes, pri->bytesRemaining); pri->dataLenBytes, pri->bytesRemaining);
if (pri->bytesRemaining) if (pri->bytesRemaining)
pContext->continuedReply = 1; pContext->continuedReply = 1;
......
...@@ -360,5 +360,5 @@ SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter, ...@@ -360,5 +360,5 @@ SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter,
} }
pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT; pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
return ; return Success;
} }
...@@ -390,7 +390,7 @@ ProcXFixesGetCursorName (ClientPtr client) ...@@ -390,7 +390,7 @@ ProcXFixesGetCursorName (ClientPtr client)
CursorPtr pCursor; CursorPtr pCursor;
xXFixesGetCursorNameReply reply; xXFixesGetCursorNameReply reply;
REQUEST(xXFixesGetCursorNameReq); REQUEST(xXFixesGetCursorNameReq);
char *str; const char *str;
int len; int len;
REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq); REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq);
...@@ -437,7 +437,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client) ...@@ -437,7 +437,7 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
CursorPtr pCursor; CursorPtr pCursor;
CARD32 *image; CARD32 *image;
int npixels; int npixels;
char *name; const char *name;
int nbytes, nbytesRound; int nbytes, nbytesRound;
int width, height; int width, height;
int x, y; int x, y;
...@@ -641,7 +641,8 @@ SProcXFixesChangeCursor (ClientPtr client) ...@@ -641,7 +641,8 @@ SProcXFixesChangeCursor (ClientPtr client)
static Bool static Bool
TestForCursorName (CursorPtr pCursor, void * closure) TestForCursorName (CursorPtr pCursor, void * closure)
{ {
return (pCursor->name == (Atom) closure); Atom *pName = closure;
return (pCursor->name == *pName);
} }
int int
...@@ -657,7 +658,7 @@ ProcXFixesChangeCursorByName (ClientPtr client) ...@@ -657,7 +658,7 @@ ProcXFixesChangeCursorByName (ClientPtr client)
tchar = (char *) &stuff[1]; tchar = (char *) &stuff[1];
name = MakeAtom (tchar, stuff->nbytes, FALSE); name = MakeAtom (tchar, stuff->nbytes, FALSE);
if (name) if (name)
ReplaceCursor (pSource, TestForCursorName, (void *) name); ReplaceCursor (pSource, TestForCursorName, &name);
return (client->noClientException); return (client->noClientException);
} }
......
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