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(
int nCharInfos;
int shmid;
#ifdef HAS_SHM
ShmDescPtr pDesc;
ShmDescPtr pDesc = NULL;
#else
#define pDesc 0
#endif
......
......@@ -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;
}
......
......@@ -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)
......
......@@ -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"))
{
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -360,5 +360,5 @@ SetPicturePictFilter (PicturePtr pPicture, PictFilterPtr pFilter,
}
pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
return ;
return Success;
}
......@@ -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);
}
......
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