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

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

parents d545afdf b44ecc0f
......@@ -97,7 +97,7 @@ void nxagentSetCoalescence(void);
void nxagentShowVersionInfo(void);
extern int nxagentUserDefinedFontPath;
extern Bool nxagentUserDefinedFontPath;
extern int nxagentRemoteMajor;
......
......@@ -336,7 +336,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen)
* server.
*/
nxagentChangeOption(Nested, 1);
nxagentChangeOption(Nested, True);
/*
* Avoid the image degradation caused by
......
......@@ -332,7 +332,7 @@ void nxagentGuessShadowHint(ClientPtr client, Atom property)
* the windows updated.
*/
nxagentChangeOption(IgnoreVisibility, 1);
nxagentChangeOption(IgnoreVisibility, True);
}
}
}
......@@ -373,7 +373,7 @@ static void checkIfShadowAgent(ClientPtr client)
fprintf(stderr, "nxagentCheckIfShadowAgent: The last shadow nxagent has been detached.\n");
#endif
nxagentChangeOption(IgnoreVisibility, 0);
nxagentChangeOption(IgnoreVisibility, False);
}
}
}
......@@ -457,7 +457,7 @@ void nxagentWaitWakeupBySplit(ClientPtr client)
{
#ifdef TEST
if (nxagentNeedWakeupBySplit(client) == 0)
if (!nxagentNeedWakeupBySplit(client))
{
fprintf(stderr, "++++++nxagentWaitWakeupBySplit: WARNING! The client [%d] is already awake.\n",
client -> index);
......@@ -497,12 +497,12 @@ void nxagentWaitWakeupBySplit(ClientPtr client)
#endif
if (nxagentNeedWakeupBySplit(client) == 0 ||
if (!nxagentNeedWakeupBySplit(client) ||
NXDisplayError(nxagentDisplay) == 1)
{
#ifdef TEST
if (nxagentNeedWakeupBySplit(client) == 0)
if (!nxagentNeedWakeupBySplit(client))
{
fprintf(stderr, "++++++nxagentWaitWakeupBySplit: Client [%d] can now run.\n",
client -> index);
......@@ -535,7 +535,7 @@ FIXME: Should record a serial number for the client, so that the
*/
if (client -> index < MAX_CONNECTIONS)
{
if (nxagentNeedWakeup(client) == 0)
if (!nxagentNeedWakeup(client))
{
#ifdef TEST
fprintf(stderr, "++++++nxagentSuspendBySplit: Suspending client [%d] with agent sequence [%ld].\n",
......@@ -583,7 +583,7 @@ FIXME: Should record a serial number for the client, so that the
{
nxagentClientPriv(client) -> clientState &= ~SleepingBySplit;
if (nxagentNeedWakeup(client) == 0)
if (!nxagentNeedWakeup(client))
{
#ifdef TEST
fprintf(stderr, "++++++nxagentWakeupBySplit: Resuming client [%d] with agent sequence [%ld].\n",
......@@ -629,7 +629,7 @@ void nxagentCheckRestartedClients(struct timeval **timeout)
for (int i = 1; i < currentMaxClients; i++)
{
if (clients[i] != NULL && clients[i] -> osPrivate != NULL &&
nxagentNeedWakeup(clients[i]) == 0)
!nxagentNeedWakeup(clients[i]))
{
int fd = ((OsCommPtr) clients[i] -> osPrivate) -> fd;
......
......@@ -225,7 +225,7 @@ const char * getXErrorString(int code)
* Save the values queried from X server.
*/
XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, 0 };
XFixesAgentInfoRec nxagentXFixesInfo = { -1, -1, -1, False };
extern Display *nxagentDisplay;
......@@ -1571,7 +1571,7 @@ void nxagentSetSelectionCallback(CallbackListPtr *callbacks, void *data,
* way to identify that situation during callback processing we
* could get rid of the Trap...
*/
if (nxagentExternalClipboardEventTrap != 0)
if (nxagentExternalClipboardEventTrap)
{
#ifdef DEBUG
fprintf(stderr, "%s: Trap is set, doing nothing\n", __func__);
......@@ -2234,7 +2234,7 @@ Bool nxagentInitClipboard(WindowPtr pWin)
XFixesSelectionClientCloseNotifyMask);
}
nxagentXFixesInfo.Initialized = 1;
nxagentXFixesInfo.Initialized = True;
}
/*
......
......@@ -35,7 +35,7 @@ typedef struct _XFixesAgentInfo
int Opcode;
int EventBase;
int ErrorBase;
int Initialized;
Bool Initialized;
} XFixesAgentInfoRec;
extern XFixesAgentInfoRec nxagentXFixesInfo;
......
......@@ -57,7 +57,7 @@ void nxagentCompositeExtensionInit(void)
nxagentCompositeEnable = 0;
if (nxagentOption(Composite) == 1)
if (nxagentOption(Composite))
{
int eventBase, errorBase;
......@@ -115,7 +115,7 @@ void nxagentCompositeExtensionInit(void)
void nxagentRedirectDefaultWindows(void)
{
if (nxagentOption(Rootless) == 1 ||
if (nxagentOption(Rootless) ||
nxagentCompositeEnable == 0)
{
#ifdef TEST
......@@ -154,7 +154,7 @@ void nxagentRedirectDefaultWindows(void)
void nxagentRedirectWindow(WindowPtr pWin)
{
if (nxagentOption(Rootless) == 0 ||
if (!nxagentOption(Rootless) ||
nxagentCompositeEnable == 0)
{
#ifdef TEST
......
......@@ -127,7 +127,7 @@ Bool nxagentDisplayCursor(ScreenPtr pScreen, CursorPtr pCursor)
Cursor cursor = (pCursor != rootCursor) ? nxagentCursor(pCursor, pScreen): None;
if (nxagentOption(Rootless) == False)
if (!nxagentOption(Rootless))
{
XDefineCursor(nxagentDisplay,
nxagentInputWindows[pScreen -> myNum],
......
......@@ -312,7 +312,7 @@ static void nxagentSighupHandler(int signal)
}
else if (nxagentSessionState == SESSION_UP)
{
if (nxagentOption(Persistent) == 1)
if (nxagentOption(Persistent))
{
#ifdef TEST
fprintf(stderr, "nxagentSighupHandler: Handling the signal by disconnecting the agent.\n");
......@@ -660,7 +660,7 @@ static void nxagentDisplayBlockHandler(Display *disp, int reason)
fprintf(stderr, "nxagentDisplayBlockHandler: BLOCK! Display is blocking for [write].\n");
#endif
nxagentBlocking = 1;
nxagentBlocking = True;
if (!SmartScheduleSignalEnable)
{
......@@ -908,7 +908,7 @@ void nxagentResetDisplayHandlers(void)
*/
nxagentBuffer = 0;
nxagentBlocking = 0;
nxagentBlocking = False;
nxagentCongestion = 0;
/*
......@@ -1796,7 +1796,7 @@ void nxagentCloseDisplay(void)
nxagentDoFullGeneration, (void *) nxagentDisplay);
#endif
if (nxagentDoFullGeneration == 0 ||
if (!nxagentDoFullGeneration ||
nxagentDisplay == NULL)
{
return;
......@@ -2517,7 +2517,7 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT,
"Couldn't open the display.");
return FALSE;
return False;
}
nxagentAddXConnection();
......@@ -2535,12 +2535,12 @@ Bool nxagentReconnectDisplay(void *p0)
#endif
if (nxagentCheckForDefaultDepthCompatibility() == 0)
if (!nxagentCheckForDefaultDepthCompatibility())
{
nxagentSetReconnectError(FAILED_RESUME_DISPLAY_ALERT,
"Default display depth doesn't match.");
return FALSE;
return False;
}
nxagentUseNXTrans = nxagentPostProcessArgs(nxagentDisplayName, nxagentDisplay,
......@@ -2557,12 +2557,12 @@ Bool nxagentReconnectDisplay(void *p0)
* Init and compare the visuals.
*/
if (nxagentInitAndCheckVisuals(flexibility) == FALSE)
if (!nxagentInitAndCheckVisuals(flexibility))
{
nxagentSetReconnectError(FAILED_RESUME_VISUALS_ALERT,
"Couldn't restore the required visuals.");
return FALSE;
return False;
}
reconnectDisplayState = GOT_VISUAL_INFO;
......@@ -2612,7 +2612,7 @@ Bool nxagentReconnectDisplay(void *p0)
reconnectDisplayState = GOT_DEPTH_LIST;
if (nxagentCheckForDepthsCompatibility() == 0)
if (!nxagentCheckForDepthsCompatibility())
{
nxagentSetReconnectError(FAILED_RESUME_DEPTHS_ALERT,
"Couldn't restore all the required depths.");
......@@ -2634,7 +2634,7 @@ Bool nxagentReconnectDisplay(void *p0)
nxagentInitPixmapFormats();
if (nxagentCheckForPixmapFormatsCompatibility() == 0)
if (!nxagentCheckForPixmapFormatsCompatibility())
{
nxagentSetReconnectError(FAILED_RESUME_PIXMAPS_ALERT,
"Couldn't restore all the required pixmap formats.");
......
......@@ -38,7 +38,7 @@ typedef struct
{
DrawablePtr pDrawable;
int drawableType;
int abort;
Bool abort;
int windowBitmaps;
int pixmapBitmaps;
int backgroundBitmaps;
......@@ -157,7 +157,7 @@ extern int nxagentCorruptedPixmaps;
extern int nxagentCorruptedWindows;
extern int nxagentCorruptedBackgrounds;
extern int nxagentForceSynchronization;
extern Bool nxagentForceSynchronization;
extern RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
int width, int height);
......
......@@ -106,7 +106,7 @@ static int nxagentPrintError(Display *dpy, XErrorEvent *event, FILE *fp);
int nxagentErrorHandler(Display *dpy, XErrorEvent *event)
{
if (nxagentVerbose == 1)
if (nxagentVerbose)
{
nxagentPrintError(dpy, event, stderr);
}
......
......@@ -32,7 +32,7 @@
extern char *nxagentClientsLogName;
extern char nxagentVerbose;
extern Bool nxagentVerbose;
int nxagentErrorHandler(Display *dpy, XErrorEvent *event);
......
......@@ -209,7 +209,7 @@ extern int nxagentInputEvent;
* Event-handling utilities.
*/
Bool nxagentPendingEvents(Display *dpy);
int nxagentPendingEvents(Display *dpy);
#define nxagentQueuedEvents(display) \
XQLength((display))
......
......@@ -393,7 +393,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
{
if (width == 0)
{
if (nxagentOption(Fullscreen) == 1)
if (nxagentOption(Fullscreen))
{
width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
......@@ -405,7 +405,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
if (height == 0)
{
if (nxagentOption(Fullscreen) == 1)
if (nxagentOption(Fullscreen))
{
height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
}
......@@ -417,7 +417,7 @@ void nxagentRandRSetWindowsSize(int width, int height)
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height);
if (nxagentOption(Rootless) == 0)
if (!nxagentOption(Rootless))
{
XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width,
height);
......@@ -429,20 +429,20 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
{
UpdateCurrentTime();
if (nxagentOption(DesktopResize) == 1 &&
(nxagentOption(Fullscreen) == 1 ||
if (nxagentOption(DesktopResize) &&
(nxagentOption(Fullscreen) ||
width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) ||
height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))))
{
if (nxagentOption(ClientOs) != ClientOsWinnt
/*&& nxagentOption(ClientOs) != ClientNXPlayer*/)
{
nxagentChangeOption(DesktopResize, 0);
nxagentChangeOption(DesktopResize, False);
}
}
if (nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 &&
nxagentOption(AllScreens) == 0)
if (nxagentOption(DesktopResize) && !nxagentOption(Fullscreen) &&
!nxagentOption(AllScreens))
{
nxagentChangeOption(Width, width);
nxagentChangeOption(Height, height);
......@@ -450,8 +450,8 @@ int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
int result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight, True);
if (result == 1 && nxagentOption(DesktopResize) == 1 &&
nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0)
if (result == 1 && nxagentOption(DesktopResize) &&
!nxagentOption(Fullscreen) && !nxagentOption(AllScreens))
{
nxagentRandRSetWindowsSize(width, height);
nxagentSetWMNormalHints(pScreen -> myNum, nxagentOption(Width), nxagentOption(Height));
......
......@@ -102,7 +102,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
static XFontStruct *nxagentLoadQueryFont(register Display *dpy , char *fontName , FontPtr pFont);
int nxagentFreeFont(XFontStruct *fs);
static Bool nxagentGetFontServerPath(char * fontServerPath, int size);
static char * nxagentMakeScalableFontName(const char *fontName, int scalableResolution);
static char * nxagentMakeScalableFontName(const char *fontName, Bool scalableResolution);
RESTYPE RT_NX_FONT;
......@@ -414,10 +414,10 @@ Bool nxagentFontLookUp(const char *name)
if (name && strlen(name) == 0)
{
return 0;
return False;
}
int result = nxagentFontFind(name, &i);
Bool result = nxagentFontFind(name, &i);
char *scalable = NULL;
......@@ -425,9 +425,9 @@ Bool nxagentFontLookUp(const char *name)
* Let's try with the scalable font description.
*/
if (result == 0)
if (!result)
{
if ((scalable = nxagentMakeScalableFontName(name, 0)) != NULL)
if ((scalable = nxagentMakeScalableFontName(name, False)) != NULL)
{
result = nxagentFontFind(scalable, &i);
......@@ -439,9 +439,9 @@ Bool nxagentFontLookUp(const char *name)
* Let's try again after replacing zero to xdpi and ydpi in the pattern.
*/
if (result == 0)
if (!result)
{
if ((scalable = nxagentMakeScalableFontName(name, 1)) != NULL)
if ((scalable = nxagentMakeScalableFontName(name, True)) != NULL)
{
result = nxagentFontFind(scalable, &i);
......@@ -449,9 +449,9 @@ Bool nxagentFontLookUp(const char *name)
}
}
if (result == 0)
if (!result)
{
return 0;
return False;
}
else
{
......@@ -612,7 +612,7 @@ Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont)
if (nxagentFontPriv(pFont)->font_struct == NULL)
{
if (nxagentFontLookUp(name) == False)
if (!nxagentFontLookUp(name))
{
fprintf(stderr, "Font: nxagentRealizeFont failed with font Font=%s, not in our remote list\n",
validateString(name));
......@@ -750,7 +750,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
if (numFontFields <= FIELDS)
{
#ifdef WARNING
if (nxagentVerbose == 1)
if (nxagentVerbose)
{
fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Font name in non standard format.\n");
}
......@@ -817,7 +817,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP
}
#ifdef WARNING
if (nxagentVerbose == 1)
if (nxagentVerbose)
{
fprintf(stderr, "nxagentLoadBestQueryFont: WARNING! Failed to load font '%s'. Replacing with '%s'.\n",
fontName, substFontBuf);
......@@ -1532,7 +1532,7 @@ XFontStruct* nxagentLoadQueryFont(register Display *dpy, char *name, FontPtr pFo
fprintf(stderr, "nxagentLoadQueryFont: Looking for font '%s'.\n", name);
#endif
if (nxagentFontLookUp(name) == 0)
if (!nxagentFontLookUp(name))
{
#ifdef DEBUG
fprintf(stderr, "nxagentLoadQueryFont: WARNING! Font not found '%s'.\n", name);
......@@ -1630,7 +1630,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
char *current = string;
int i = 0;
int last = 0;
Bool last = False;
for (;;)
{
......@@ -1644,7 +1644,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
if (next == NULL)
{
next = string + len;
last = 1;
last = True;
}
int fieldlen = next - current;
......@@ -1662,7 +1662,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
i++;
if (last == 1)
if (last)
{
break;
}
......@@ -1671,7 +1671,7 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep)
return i;
}
char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution)
char *nxagentMakeScalableFontName(const char *fontName, Bool scalableResolution)
{
char *scalableFontName;
......@@ -1710,7 +1710,7 @@ char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution)
strcat(scalableFontName, "-0");
}
else if (scalableResolution == 1 && (field == 8 || field == 9))
else if (scalableResolution && (field == 8 || field == 9))
{
/*
* RESOLUTION_X || RESOLUTION_Y
......
......@@ -86,7 +86,7 @@ GCPtr nxagentCreateGraphicContext(int depth);
static void nxagentReconnectGC(void*, XID, void*);
static void nxagentReconnectClip(GCPtr, int, void *, int);
static int nxagentCompareRegions(RegionPtr, RegionPtr);
static Bool nxagentCompareRegions(RegionPtr, RegionPtr);
struct nxagentGCRec
{
......@@ -317,7 +317,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
else
{
if (nxagentDrawableStatus((DrawablePtr) pGC -> tile.pixmap) == NotSynchronized &&
nxagentGCTrap == 0)
!nxagentGCTrap)
{
/*
* If the tile is corrupted and is not too large, it can be
......@@ -367,7 +367,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
if (mask & GCStipple)
{
if (nxagentDrawableStatus((DrawablePtr) pGC -> stipple) == NotSynchronized &&
nxagentGCTrap == 0)
!nxagentGCTrap)
{
#ifdef TEST
fprintf(stderr, "nxagentChangeGC: WARNING! Synchronizing GC at [%p] due the stipple at [%p].\n",
......@@ -425,7 +425,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
{
mask &= ~GCDashList;
if (nxagentGCTrap == 0)
if (!nxagentGCTrap)
{
XSetDashes(nxagentDisplay, nxagentGC(pGC),
pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList);
......@@ -434,7 +434,7 @@ void nxagentChangeGC(GCPtr pGC, unsigned long mask)
CHECKGCVAL(GCArcMode, arc_mode, pGC->arcMode);
if (nxagentGCTrap == 1)
if (nxagentGCTrap)
{
#ifdef TEST
fprintf(stderr, "nxagentChangeGC: Skipping change of GC at [%p] on the real X server.\n",
......@@ -497,7 +497,7 @@ void nxagentDestroyGC(GCPtr pGC)
void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
{
int clipsMatch = 0;
Bool clipsMatch = False;
#ifdef TEST
fprintf(stderr, "nxagentChangeClip: Going to change clip on GC [%p]\n",
......@@ -528,7 +528,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
default:
{
clipsMatch = 0;
clipsMatch = False;
break;
}
}
......@@ -544,7 +544,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
{
case CT_NONE:
{
if (clipsMatch == 0 && nxagentGCTrap == 0)
if (!clipsMatch && !nxagentGCTrap)
{
XSetClipMask(nxagentDisplay, nxagentGC(pGC), None);
}
......@@ -552,7 +552,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
case CT_REGION:
{
if (clipsMatch == 0 && nxagentGCTrap == 0)
if (!clipsMatch && !nxagentGCTrap)
{
XRectangle *pRects;
nRects = RegionNumRects((RegionPtr)pValue);
......@@ -576,7 +576,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
case CT_PIXMAP:
{
if (nxagentGCTrap == 0)
if (!nxagentGCTrap)
{
XSetClipMask(nxagentDisplay, nxagentGC(pGC),
nxagentPixmap((PixmapPtr)pValue));
......@@ -594,7 +594,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
case CT_UNSORTED:
{
if (clipsMatch == 0 && nxagentGCTrap == 0)
if (!clipsMatch && !nxagentGCTrap)
{
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y,
......@@ -604,7 +604,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
case CT_YSORTED:
{
if (clipsMatch == 0 && nxagentGCTrap == 0)
if (!clipsMatch && !nxagentGCTrap)
{
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y,
......@@ -614,7 +614,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
case CT_YXSORTED:
{
if (clipsMatch == 0 && nxagentGCTrap == 0)
if (!clipsMatch && !nxagentGCTrap)
{
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y,
......@@ -624,7 +624,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
}
case CT_YXBANDED:
{
if (clipsMatch == 0 && nxagentGCTrap == 0)
if (!clipsMatch && !nxagentGCTrap)
{
XSetClipRectangles(nxagentDisplay, nxagentGC(pGC),
pGC->clipOrg.x, pGC->clipOrg.y,
......@@ -679,7 +679,7 @@ void nxagentDestroyClip(GCPtr pGC)
nxagentDestroyClipHelper(pGC);
if (nxagentGCTrap == 0)
if (!nxagentGCTrap)
{
XSetClipMask(nxagentDisplay, nxagentGC(pGC), None);
}
......@@ -1209,29 +1209,29 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
nxagentGCPriv(pGC)->nClipRects = nRects;
}
static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2)
static Bool nxagentCompareRegions(RegionPtr r1, RegionPtr r2)
{
/*
* It returns 1 if regions are equal, 0 otherwise
* It returns True if regions are equal, False otherwise
*/
if (r1 == NULL && r2 == NULL)
{
return 1;
return True;
}
if ((r1 == NULL) || (r2 == NULL))
{
return 0;
return False;
}
if (RegionNumRects(r1) != RegionNumRects(r2))
{
return 0;
return False;
}
else if (RegionNumRects(r1) == 0)
{
return 1;
return True;
}
else if ((*RegionExtents(r1)).x1 != (*RegionExtents(r2)).x1) return 0;
else if ((*RegionExtents(r1)).x2 != (*RegionExtents(r2)).x2) return 0;
......@@ -1247,7 +1247,7 @@ static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2)
else if (RegionRects(r1)[i].y2 != RegionRects(r2)[i].y2) return 0;
}
}
return 1;
return True;
}
/*
......
......@@ -114,15 +114,15 @@ extern void nxagentDumpInputDevicesState(void);
* Used in the handling of the X desktop manager protocol.
*/
int nxagentXdmcpUp = 0;
int nxagentXdmcpAlertUp = 0;
Bool nxagentXdmcpUp = False;
Bool nxagentXdmcpAlertUp = False;
/*
* Also used in the block, wakeup and sync handlers.
*/
int nxagentBuffer;
int nxagentBlocking;
Bool nxagentBlocking;
int nxagentCongestion;
double nxagentBytesIn;
......@@ -153,7 +153,7 @@ struct _DispatchRec nxagentDispatch = { UNDEFINED, 0, 0, 0 };
* server.
*/
extern int nxagentSkipImage;
extern Bool nxagentSkipImage;
void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
{
......@@ -179,7 +179,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
* Set if we need to synchronize any drawable.
*/
static int synchronize;
static Bool synchronize;
#ifdef BLOCKS
fprintf(stderr, "[Begin block]\n");
......@@ -199,7 +199,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#endif
if (nxagentNeedConnectionChange() == 1)
if (nxagentNeedConnectionChange())
{
#ifdef TEST
fprintf(stderr, "nxagentBlockHandler: Calling nxagentHandleConnectionChanges "
......@@ -222,7 +222,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#ifdef TEST
if (nxagentLastWindowDestroyed == 1)
if (nxagentLastWindowDestroyed)
{
fprintf(stderr, "nxagentBlockHandler: Elapsed time [%lu].\n",
now - nxagentLastWindowDestroyedTime);
......@@ -302,7 +302,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
* are synchronized.
*/
if (synchronize == 1)
if (synchronize)
{
/*
* We should not enter the synchronization loop if there is any
......@@ -310,7 +310,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
* operation.
*/
if (nxagentForceSynchronization == 1)
if (nxagentForceSynchronization)
{
#ifdef TEST
fprintf(stderr, "nxagentBlockHandler: Going to force a synchronization at %s.\n",
......@@ -319,10 +319,10 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
nxagentSynchronizationLoop(NEVER_BREAK);
nxagentForceSynchronization = 0;
nxagentForceSynchronization = False;
}
else if (nxagentUserInput(NULL) == 0 &&
nxagentBlocking == 0 &&
!nxagentBlocking &&
nxagentCongestion <= 4)
{
#ifdef TEST
......@@ -350,7 +350,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
nxagentCorruptedBackgrounds > 0 ||
nxagentCorruptedPixmaps > 0));
if (nxagentSkipImage == 0 && synchronize == 1)
if (!nxagentSkipImage && synchronize)
{
#ifdef TEST
fprintf(stderr, "nxagentBlockHandler: Setting a zero timeout with [%d][%d][%d] and "
......@@ -391,7 +391,7 @@ void nxagentBlockHandler(void * data, struct timeval **timeout, void * mask)
#ifdef DYNAMIC_DISPLAY_BUFFER
if (nxagentBlocking == 1 &&
if (nxagentBlocking &&
nxagentBuffer > MINIMUM_DISPLAY_BUFFER)
{
nxagentBuffer >>= 1;
......@@ -587,7 +587,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
* Can become true during the dispatch loop.
*/
nxagentBlocking = 0;
nxagentBlocking = False;
/*
* Check if we got new events.
......@@ -648,7 +648,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
* the session.
*/
if (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0)
if (nxagentOption(Xdmcp) && !nxagentXdmcpUp)
{
#ifdef DEBUG
fprintf(stderr, "nxagentWakeupHandler: XdmcpState [%d].\n", XdmcpState);
......@@ -656,10 +656,10 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
if (XdmcpState == XDM_RUN_SESSION)
{
nxagentXdmcpUp = 1;
nxagentXdmcpUp = True;
}
if (nxagentXdmcpUp == 0)
if (!nxagentXdmcpUp)
{
#ifdef DEBUG
fprintf(stderr, "nxagentWakeupHandler: XdmcpTime [%lu].\n",
......@@ -671,7 +671,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
XdmcpTimeOutRtx);
#endif
if (nxagentXdmcpAlertUp == 0 &&
if (!nxagentXdmcpAlertUp &&
GetTimeInMillis() - XdmcpStartTime >= XDM_TIMEOUT)
{
#ifdef WARNING
......@@ -681,7 +681,7 @@ void nxagentWakeupHandler(void * data, int count, void * mask)
NXTransAlert(FAILED_XDMCP_CONNECTION_ALERT, NX_ALERT_REMOTE);
nxagentXdmcpAlertUp = 1;
nxagentXdmcpAlertUp = True;
}
}
}
......@@ -703,7 +703,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
fprintf(stderr, "[Begin block]\n");
#endif
if (nxagentNeedConnectionChange() == 1)
if (nxagentNeedConnectionChange())
{
nxagentHandleConnectionChanges();
}
......@@ -732,9 +732,9 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
nxagentDispatchEvents(NULL);
}
if (nxagentShadowResize == 1)
if (nxagentShadowResize)
{
nxagentShadowResize = 0;
nxagentShadowResize = False;
nxagentShadowAdaptToRatio();
}
......@@ -759,7 +759,7 @@ void nxagentShadowBlockHandler(void * data, struct timeval **timeout, void * mas
nxagentShadowSendUpdates(&suspended);
if (nxagentBlocking == 0)
if (!nxagentBlocking)
{
nxagentSynchronizeDrawable((DrawablePtr) nxagentShadowPixmapPtr, DONT_WAIT,
ALWAYS_BREAK, nxagentShadowWindowPtr);
......@@ -830,7 +830,7 @@ void nxagentShadowWakeupHandler(void * data, int count, void * mask)
* Can become true during the dispatch loop.
*/
nxagentBlocking = 0;
nxagentBlocking = False;
/*
* Check if we got new events.
......@@ -1200,7 +1200,7 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out)
nxagentDispatchEvents(NULL);
nxagentBlocking = 1;
nxagentBlocking = True;
}
/*
......
......@@ -37,7 +37,7 @@ extern int nxagentBuffer;
* the display to become writable.
*/
extern int nxagentBlocking;
extern Bool nxagentBlocking;
/*
* Current congestion level based on
......
......@@ -171,7 +171,7 @@ int nxagentSaveUnder;
* nxagentOpenScreen
* InitInput
*/
int nxagentDoFullGeneration = 1;
Bool nxagentDoFullGeneration = True;
/*
* True if agent is running as X2goAgent
......@@ -251,7 +251,7 @@ void InitOutput(ScreenInfo *scrInfo, int argc, char *argv[])
AddCallback(&ServerGrabCallback, nxagentGrabServerCallback, NULL);
}
if (nxagentUserDefinedFontPath == 0)
if (!nxagentUserDefinedFontPath)
{
#ifdef TEST
fprintf(stderr, "InitOutput: Calling nxagentVerifyDefaultFontPath.\n");
......@@ -518,7 +518,7 @@ FIXME: Do we need to check the key grab if the
fprintf(stderr, "Info: Auto-terminating session with no client running.\n");
raise(SIGTERM);
}
else if (nxagentOption(Persistent) == 0)
else if (!nxagentOption(Persistent))
{
fprintf(stderr, "Info: Auto-terminating session with persistence not allowed.\n");
raise(SIGTERM);
......
......@@ -161,7 +161,7 @@ XkbAgentInfoRec nxagentXkbInfo = { -1, -1, -1, -1, -1 };
* Keyboard status, updated through XKB events.
*/
XkbAgentStateRec nxagentXkbState = { 0, 0, 0, 0, 0 };
XkbAgentStateRec nxagentXkbState = { 0, 0, 0, 0, False };
/*
* Info for disabling/enabling Xkb extension.
......@@ -776,7 +776,7 @@ XkbError:
XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
}
if (nxagentOption(Shadow) == 1 && pDev && pDev->key)
if (nxagentOption(Shadow) && pDev && pDev->key)
{
NXShadowInitKeymap(&(pDev->key->curKeySyms));
}
......@@ -974,7 +974,7 @@ int nxagentResetKeyboard(void)
if (dev->key)
{
#ifdef XKB
if (noXkbExtension == 0 && dev->key->xkbInfo)
if (!noXkbExtension && dev->key->xkbInfo)
{
oldMinKeycode = dev->key->xkbInfo -> desc -> min_key_code;
oldMaxKeycode = dev->key->xkbInfo -> desc -> max_key_code;
......@@ -1132,7 +1132,7 @@ static int nxagentFreeKeyboardDeviceData(DeviceIntPtr dev)
if (dev->key)
{
#ifdef XKB
if (noXkbExtension == 0 && dev->key->xkbInfo)
if (!noXkbExtension && dev->key->xkbInfo)
{
XkbFreeInfo(dev->key->xkbInfo);
dev->key->xkbInfo = NULL;
......
......@@ -68,8 +68,7 @@ typedef struct _XkbAgentState
int Caps;
int Num;
int Focus;
int Initialized;
Bool Initialized;
} XkbAgentStateRec;
extern XkbAgentStateRec nxagentXkbState;
......
......@@ -624,7 +624,7 @@ Bool nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
return True;
break;
case KEYSTROKE_FORCE_SYNCHRONIZATION:
nxagentForceSynchronization = 1;
nxagentForceSynchronization = True;
break;
#ifdef DUMP
case KEYSTROKE_REGIONS_ON_SCREEN:
......
......@@ -330,7 +330,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
clientReady[0] = 0;
if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) == 1 && nxagentXdmcpUp == 0))
if (nxagentHaveSplashWindow() || (nxagentOption(Xdmcp) && !nxagentXdmcpUp))
{
#ifdef TEST
fprintf(stderr, "******Dispatch: Requesting a timeout of [%d] Ms.\n",
......@@ -343,7 +343,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
if (serverGeneration > nxagentMaxAllowedResets &&
nxagentSessionState == SESSION_STARTING &&
(nxagentOption(Xdmcp) == 0 || nxagentXdmcpUp == 1))
(!nxagentOption(Xdmcp) || nxagentXdmcpUp))
{
#ifdef NX_DEBUG_INPUT
fprintf(stderr, "Session: Session started at '%s' timestamp [%u].\n",
......@@ -575,7 +575,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
fprintf(stderr, "Session: Session terminated at '%s'.\n", GetTimeAsString());
}
if (nxagentOption(Shadow) == 1)
if (nxagentOption(Shadow))
{
NXShadowDestroy();
}
......
......@@ -189,7 +189,7 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab,
* }
*/
if (nxagentOption(Rootless) == 1)
if (nxagentOption(Rootless))
{
/*
* from nxagent-1.5.0-20 changelog:
......@@ -238,7 +238,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse)
* by the agent (for example if the focus had left the window), so
* that agent could be unable to update the mouse button state.
*/
if (nxagentOption(Rootless) == 1)
if (nxagentOption(Rootless))
{
XUngrabPointer(nxagentDisplay, CurrentTime);
......
......@@ -193,7 +193,7 @@ ProcChangeProperty(ClientPtr client)
return err;
else
{
if (nxagentOption(Rootless) == 1)
if (nxagentOption(Rootless))
{
nxagentExportProperty(pWin, stuff->property, stuff->type, (int) format,
(int) mode, len, (void *) &stuff[1]);
......
......@@ -551,8 +551,8 @@ int nxagentCompositePredicate(PicturePtr pSrc, PicturePtr pDst)
fprintf(stderr, "nxagentCompositePredicate: Case 1.\n");
#endif
if (nxagentPixmapIsVirtual(pPixmap1) == 1 &&
nxagentPixmapIsVirtual(pPixmap2) == 1)
if (nxagentPixmapIsVirtual(pPixmap1) &&
nxagentPixmapIsVirtual(pPixmap2))
{
#ifdef TEST
fprintf(stderr, "nxagentCompositePredicate: Case 2.\n");
......
......@@ -96,7 +96,7 @@ ShmExtensionInit(void)
#endif
#ifdef NXAGENT_SERVER
if (nxagentOption(SharedMemory) == False)
if (!nxagentOption(SharedMemory))
{
return;
}
......
......@@ -392,7 +392,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin) &&
pWin -> overrideRedirect == 0 &&
nxagentScreenTrap == 0)
!nxagentScreenTrap)
{
nxagentConfigureRootlessWindow(pWin, x, y, w, h, bw, pSib, smode, mask);
......
......@@ -59,10 +59,12 @@ void nxagentInitOptions(void)
{
nxagentOptions.LinkType = UNDEFINED;
nxagentOptions.Desktop = UNDEFINED;
nxagentOptions.Persistent = 1;
nxagentOptions.Rootless = UNDEFINED;
nxagentOptions.Fullscreen = UNDEFINED;
nxagentOptions.Desktop = True;
nxagentOptions.Persistent = True;
nxagentOptions.Rootless = False;
nxagentOptions.Shadow = False;
nxagentOptions.Fullscreen = False;
nxagentOptions.AllScreens = False;
nxagentOptions.NoRootlessExit = False;
nxagentOptions.X = 0;
......@@ -81,23 +83,23 @@ void nxagentInitOptions(void)
nxagentOptions.Timeout = 0;
nxagentOptions.Nested = 0;
nxagentOptions.Nested = False;
nxagentOptions.BackingStore = BackingStoreUndefined;
nxagentOptions.Clipboard = ClipboardBoth;
nxagentOptions.SharedMemory = 1;
nxagentOptions.SharedMemory = True;
nxagentOptions.SharedPixmaps = 1;
nxagentOptions.SharedPixmaps = True;
nxagentOptions.DeviceControl = 0;
nxagentOptions.DeviceControl = False;
nxagentOptions.DeviceControlUserDefined = 0;
nxagentOptions.DeviceControlUserDefined = False;
nxagentOptions.ResetKeyboardAtResume = 1;
nxagentOptions.ResetKeyboardAtResume = True;
nxagentOptions.Reset = 0;
nxagentOptions.Reset = False;
nxagentOptions.RootX = 0;
nxagentOptions.RootY = 0;
......@@ -107,7 +109,7 @@ void nxagentInitOptions(void)
nxagentOptions.ViewportXSpan = 0;
nxagentOptions.ViewportYSpan = 0;
nxagentOptions.DesktopResize = 1;
nxagentOptions.DesktopResize = True;
nxagentOptions.Ratio = DONT_SCALE;
nxagentOptions.XRatio = DONT_SCALE;
......@@ -117,25 +119,25 @@ void nxagentInitOptions(void)
nxagentOptions.FloatXRatio = 1.0;
nxagentOptions.FloatYRatio = 1.0;
nxagentOptions.UseDamage = 1;
nxagentOptions.UseDamage = True;
nxagentOptions.Binder = UNDEFINED;
nxagentOptions.Binder = False;
nxagentOptions.BinderOptions = NULL;
nxagentOptions.Xdmcp = 0;
nxagentOptions.Xdmcp = False;
nxagentOptions.DisplayBuffer = UNDEFINED;
nxagentOptions.DisplayCoalescence = 0;
nxagentOptions.Composite = 1;
nxagentOptions.Composite = True;
nxagentOptions.IgnoreVisibility = 0;
nxagentOptions.IgnoreVisibility = False;
nxagentOptions.ViewOnly = 0;
nxagentOptions.ViewOnly = False;
nxagentOptions.Adaptive = 0;
nxagentOptions.Adaptive = False;
nxagentOptions.Streaming = 0;
nxagentOptions.Streaming = False;
nxagentOptions.DeferLevel = UNDEFINED;
nxagentOptions.DeferTimeout = 200;
......@@ -143,19 +145,19 @@ void nxagentInitOptions(void)
nxagentOptions.TileWidth = UNDEFINED;
nxagentOptions.TileHeight = UNDEFINED;
nxagentOptions.Menu = 1;
nxagentOptions.Menu = True;
nxagentOptions.MagicPixel = 1;
nxagentOptions.MagicPixel = True;
nxagentOptions.ClientOs = UNDEFINED;
nxagentOptions.InhibitXkb = 1;
nxagentOptions.InhibitXkb = True;
nxagentOptions.CopyBufferSize = COPY_UNLIMITED;
nxagentOptions.ImageRateLimit = 0;
nxagentOptions.Xinerama = 1;
nxagentOptions.Xinerama = True;
nxagentOptions.SleepTimeMillis = DEFAULT_SLEEP_TIME_MILLIS;
......
......@@ -26,6 +26,12 @@
#ifndef __Options_H__
#define __Options_H__
/* Bool is defined in Xlib.h but we do not want to include that here, so let's
clone the definition */
#ifndef Bool
#define Bool int
#endif
#ifndef True
#define True 1
#endif
......@@ -122,33 +128,33 @@ typedef struct _AgentOptions
/*
* Is agent running in desktop mode? This is presently the default.
*/
int Desktop;
Bool Desktop;
/*
* True if user activated rootless mode.
*/
int Rootless;
Bool Rootless;
/*
* True for shadow mode.
*/
int Shadow;
Bool Shadow;
/*
* True if user activated persistent mode.
*/
int Persistent;
Bool Persistent;
/*
* True if user activated fullscreen mode.
*/
int Fullscreen;
Bool Fullscreen;
/*
* True if the fullscreen NX session will extend on all available
* screens.
*/
int AllScreens;
Bool AllScreens;
/*
* Set to the auto-disconnect timeout, if the user activated this
......@@ -176,7 +182,7 @@ typedef struct _AgentOptions
/*
* Set if agent is running nested in another agent X server.
*/
int Nested;
Bool Nested;
/*
* Selected backing-store mode.
......@@ -192,12 +198,12 @@ typedef struct _AgentOptions
* Enable agent to use the MITSHM extension in path from remote
* proxy to the real X server.
*/
int SharedMemory;
Bool SharedMemory;
/*
* Enable agent to use shared Pixmaps
*/
int SharedPixmaps;
Bool SharedPixmaps;
/*
* Enable agent to propagate keyboard and pointer device
......@@ -214,12 +220,12 @@ typedef struct _AgentOptions
* Resuming keyboard device corrects keymap if session migrates
* across platforms with different keycode layout.
*/
int ResetKeyboardAtResume;
Bool ResetKeyboardAtResume;
/*
* Reset server when the last client disconnects.
*/
int Reset;
Bool Reset;
/*
* Geometry of the agent root window, relative to the agent default
......@@ -236,7 +242,7 @@ typedef struct _AgentOptions
* True if the user can resize the desktop by dragging the window
* border.
*/
int DesktopResize;
Bool DesktopResize;
/*
* The scaling ratio of the shadow agent.
......@@ -248,19 +254,19 @@ typedef struct _AgentOptions
/*
* The shadow agent uses the Damage extension.
*/
int UseDamage;
Bool UseDamage;
/*
* Was the agent run with the -B option?
*/
int Binder;
Bool Binder;
char *BinderOptions;
/*
* Set if the agent has to connect to a desktop manager to start the
* session.
*/
int Xdmcp;
Bool Xdmcp;
/*
* Size of the Xlib display buffer. The default is set according to
......@@ -276,31 +282,31 @@ typedef struct _AgentOptions
/*
* Use the composite extension when available on the remote display.
*/
int Composite;
Bool Composite;
/*
* If set, don't skip internal operations when the agent window is
* not fully visible.
*/
int IgnoreVisibility;
Bool IgnoreVisibility;
/*
* If set, prevent the shadow session to interact with master
* display.
*/
int ViewOnly;
Bool ViewOnly;
/*
* If true select a lossy or lossless compression method based on
* the characteristics of the image.
*/
int Adaptive;
Bool Adaptive;
/*
* Stream the images and update the display when the image has been
* completely transerred.
*/
int Streaming;
Bool Streaming;
/*
* Use a lazy approach in updating the remote display. This means
......@@ -323,12 +329,12 @@ typedef struct _AgentOptions
/*
* Enabling/disabling the pulldown menu.
*/
int Menu;
Bool Menu;
/*
* Enabling/disabling the magic pixel.
*/
int MagicPixel;
Bool MagicPixel;
/*
* Specify the Operative System of the client.
......@@ -338,7 +344,7 @@ typedef struct _AgentOptions
/*
* Inhibit some XKEYBOARD requests.
*/
int InhibitXkb;
Bool InhibitXkb;
/*
* Maximum number of bytes that can be pasted from an NX session
......@@ -355,7 +361,7 @@ typedef struct _AgentOptions
* True if agent should not exit if there are no clients in rootless
* mode
*/
int NoRootlessExit;
Bool NoRootlessExit;
/*
* Store if the user wants Xinerama. There are variables called
......@@ -365,7 +371,7 @@ typedef struct _AgentOptions
* the user preference provided by the -/+(rr)xinerama parameter(s)
* before initializing those extensions.
*/
int Xinerama;
Bool Xinerama;
/*
* Sleep delay in milliseconds.
......@@ -386,7 +392,7 @@ typedef struct _AgentOptions
* True if agent should grab the input in windowed mode whenever the
* agent window gets the focus
*/
int AutoGrab; /* Should be Bool but I do not want to include Xlib.h here */
Bool AutoGrab;
} AgentOptionsRec;
......
......@@ -77,7 +77,7 @@ while (0)
#define breakOnBlocking(mask) \
(((mask) != NEVER_BREAK) && ((mask) & BLOCKING_BREAK) && \
nxagentBlocking == 1)
nxagentBlocking)
#define breakOnCongestion(mask) \
(((mask) != NEVER_BREAK) && ((mask) & CONGESTION_BREAK) && \
......@@ -97,7 +97,7 @@ while (0)
nxagentUserInput(NULL) == 1)
#define canBreakOnTimeout(mask) \
(((mask) != NEVER_BREAK) && nxagentOption(Shadow) == 0)
(((mask) != NEVER_BREAK) && !nxagentOption(Shadow))
/*
* Macros defining the conditions to
......@@ -145,7 +145,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
#define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \
(nxagentSplitTrap == 0 && \
(!nxagentSplitTrap && \
nxagentOption(DeferLevel) > 0)
/*
......@@ -164,7 +164,7 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
#define NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_PIXMAPS(mask) \
((nxagentCorruptedWindows == 0 && nxagentCorruptedPixmaps > 0 && \
nxagentCongestion == 0 && nxagentBlocking == 0) || \
nxagentCongestion == 0 && !nxagentBlocking) || \
mask == NEVER_BREAK)
/*
......@@ -173,8 +173,8 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
*/
#define NXAGENT_SHOULD_SYNCHRONIZE_WINDOW(pDrawable) \
(nxagentWindowIsVisible((WindowPtr) pDrawable) == 1 && \
(nxagentDefaultWindowIsVisible() == 1 || nxagentCompositeEnable == 1))
(nxagentWindowIsVisible((WindowPtr) pDrawable) && \
(nxagentDefaultWindowIsVisible() || nxagentCompositeEnable == 1))
#define MINIMUM_PIXMAP_USAGE_COUNTER 2
......
......@@ -200,7 +200,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width, int height,
* checksum.
*/
if (width != 0 && height != 0 && nxagentGCTrap == 0)
if (width != 0 && height != 0 && !nxagentGCTrap)
{
pPixmapPriv -> id = XCreatePixmap(nxagentDisplay,
nxagentDefaultWindows[pScreen -> myNum],
......@@ -1064,7 +1064,7 @@ void nxagentSynchronizeShmPixmap(DrawablePtr pDrawable, int xPict, int yPict,
int wPict, int hPict)
{
if (pDrawable -> type == DRAWABLE_PIXMAP &&
nxagentIsShmPixmap((PixmapPtr) pDrawable) == 1)
nxagentIsShmPixmap((PixmapPtr) pDrawable))
{
#ifdef TEST
fprintf(stderr, "nxagentSynchronizeShmPixmap: WARNING! Synchronizing shared pixmap at [%p].\n",
......
......@@ -84,7 +84,7 @@ void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl)
* leaves the agent's window.
*/
if (nxagentOption(DeviceControl) == True)
if (nxagentOption(DeviceControl))
{
#ifdef TEST
fprintf(stderr, "%s: WARNING! Propagating changes to pointer settings.\n", __func__);
......
......@@ -220,7 +220,7 @@ int nxagentHandleConnectionStates(void)
}
}
if (nxagentNeedConnectionChange() == 1)
if (nxagentNeedConnectionChange())
{
#ifdef TEST
fprintf(stderr, "nxagentHandleConnectionStates: Calling nxagentHandleConnectionChanges "
......@@ -240,7 +240,7 @@ TODO: This should be reset only when the state became SESSION_DOWN.
*/
nxagentException.ioError = 0;
if (nxagentOption(Persistent) == 1 && nxagentSessionState != SESSION_STARTING)
if (nxagentOption(Persistent) && nxagentSessionState != SESSION_STARTING)
{
if (nxagentSessionState == SESSION_UP)
{
......@@ -458,7 +458,7 @@ Bool nxagentReconnectSession(void)
nxagentProcessOptions(nxagentOptionsFilenameOrString);
if (nxagentReconnectDisplay(reconnectLossyLevel[DISPLAY_STEP]) == 0)
if (!nxagentReconnectDisplay(reconnectLossyLevel[DISPLAY_STEP]))
{
#ifdef TEST
fprintf(stderr, "nxagentReconnectSession: WARNING! Failed display reconnection.\n");
......@@ -468,7 +468,7 @@ Bool nxagentReconnectSession(void)
goto nxagentReconnectError;
}
if (nxagentReconnectScreen(reconnectLossyLevel[SCREEN_STEP]) == 0)
if (!nxagentReconnectScreen(reconnectLossyLevel[SCREEN_STEP]))
{
failedStep = SCREEN_STEP;
goto nxagentReconnectError;
......@@ -478,9 +478,9 @@ Bool nxagentReconnectSession(void)
nxagentListRemoteFonts("*", nxagentMaxFontNames);
if (nxagentReconnectAllFonts(reconnectLossyLevel[FONT_STEP]) == 0)
if (!nxagentReconnectAllFonts(reconnectLossyLevel[FONT_STEP]))
{
if (nxagentReconnectFailedFonts(reconnectLossyLevel[FONT_STEP]) == 0)
if (!nxagentReconnectFailedFonts(reconnectLossyLevel[FONT_STEP]))
{
failedStep = FONT_STEP;
goto nxagentReconnectError;
......@@ -515,26 +515,26 @@ Bool nxagentReconnectSession(void)
nxagentEmptyBSPixmapList();
/* FIXME: nxagentReconnectAllPixmaps will always return 1 */
if (nxagentReconnectAllPixmaps(reconnectLossyLevel[PIXMAP_STEP]) == 0)
if (!nxagentReconnectAllPixmaps(reconnectLossyLevel[PIXMAP_STEP]))
{
failedStep = PIXMAP_STEP;
goto nxagentReconnectError;
}
if (nxagentReconnectAllGCs(reconnectLossyLevel[GC_STEP]) == 0)
if (!nxagentReconnectAllGCs(reconnectLossyLevel[GC_STEP]))
{
failedStep = GC_STEP;
goto nxagentReconnectError;
}
if (nxagentReconnectAllColormap(reconnectLossyLevel[COLORMAP_STEP]) == 0)
if (!nxagentReconnectAllColormap(reconnectLossyLevel[COLORMAP_STEP]))
{
failedStep = COLORMAP_STEP;
goto nxagentReconnectError;
}
if (nxagentReconnectAllWindows(reconnectLossyLevel[WINDOW_STEP]) == 0)
if (!nxagentReconnectAllWindows(reconnectLossyLevel[WINDOW_STEP]))
{
failedStep = WINDOW_STEP;
goto nxagentReconnectError;
......@@ -542,32 +542,32 @@ Bool nxagentReconnectSession(void)
if (nxagentRenderEnable)
{
if (nxagentReconnectAllGlyphSet(reconnectLossyLevel[GLYPHSET_STEP]) == 0)
if (!nxagentReconnectAllGlyphSet(reconnectLossyLevel[GLYPHSET_STEP]))
{
failedStep = GLYPHSET_STEP;
goto nxagentReconnectError;
}
if (nxagentReconnectAllPictFormat(reconnectLossyLevel[PICTFORMAT_STEP]) == 0)
if (!nxagentReconnectAllPictFormat(reconnectLossyLevel[PICTFORMAT_STEP]))
{
failedStep = PICTFORMAT_STEP;
goto nxagentReconnectError;
}
if (nxagentReconnectAllPicture(reconnectLossyLevel[PICTURE_STEP]) == 0)
if (!nxagentReconnectAllPicture(reconnectLossyLevel[PICTURE_STEP]))
{
failedStep = PICTURE_STEP;
goto nxagentReconnectError;
}
}
if (nxagentReconnectAllCursor(reconnectLossyLevel[CURSOR_STEP]) == 0)
if (!nxagentReconnectAllCursor(reconnectLossyLevel[CURSOR_STEP]))
{
failedStep = CURSOR_STEP;
goto nxagentReconnectError;
}
if (nxagentSetWindowCursors(reconnectLossyLevel[WINDOW_STEP]) == 0)
if (!nxagentSetWindowCursors(reconnectLossyLevel[WINDOW_STEP]))
{
failedStep = WINDOW_STEP;
goto nxagentReconnectError;
......@@ -588,7 +588,7 @@ Bool nxagentReconnectSession(void)
}
/* Reset the keyboard only if we detect any changes. */
if (nxagentOption(ResetKeyboardAtResume) == 1)
if (nxagentOption(ResetKeyboardAtResume))
{
if (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL ||
strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 ||
......@@ -598,7 +598,7 @@ Bool nxagentReconnectSession(void)
if (nxagentResetKeyboard() == 0)
{
#ifdef WARNING
if (nxagentVerbose == 1)
if (nxagentVerbose)
{
fprintf(stderr, "%s: Failed to reset keyboard device.\n", __func__);
}
......@@ -616,7 +616,7 @@ Bool nxagentReconnectSession(void)
}
}
nxagentXkbState.Initialized = 0;
nxagentXkbState.Initialized = False;
SAFE_free(nxagentOldKeyboard);
......@@ -630,7 +630,7 @@ Bool nxagentReconnectSession(void)
nxagentRedirectDefaultWindows();
if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True || nxagentOption(Xinerama) == True)
if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) || nxagentOption(Xinerama))
{
nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight), True);
......@@ -699,7 +699,7 @@ nxagentReconnectError:
if (*nxagentGetReconnectError() == '\0')
{
#ifdef WARNING
if (nxagentVerbose == 1)
if (nxagentVerbose)
{
fprintf(stderr, "nxagentReconnectSession: WARNING! The reconnect error message is not set. Failed step is [%d].\n",
failedStep);
......
......@@ -925,7 +925,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPRepeat)
{
attributes.repeat = (Bool)pPicture -> repeat;
if (nxagentCheckPictureRemoteValue(pPicture, repeat, attributes.repeat) == 0)
if (!nxagentCheckPictureRemoteValue(pPicture, repeat, attributes.repeat))
{
valuemask |= CPRepeat;
nxagentSetPictureRemoteValue(pPicture, repeat, attributes.repeat);
......@@ -935,7 +935,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPAlphaMap)
{
attributes.alpha_map = nxagentPicturePriv(pPicture -> alphaMap) -> picture;
if (nxagentCheckPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map) == 0)
if (!nxagentCheckPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map))
{
valuemask |= CPAlphaMap;
nxagentSetPictureRemoteValue(pPicture, alpha_map, attributes.alpha_map);
......@@ -945,7 +945,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPAlphaXOrigin)
{
attributes.alpha_x_origin = pPicture -> alphaOrigin.x;
if (nxagentCheckPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin) == 0)
if (!nxagentCheckPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin))
{
valuemask |= CPAlphaXOrigin;
nxagentSetPictureRemoteValue(pPicture, alpha_x_origin, attributes.alpha_x_origin);
......@@ -955,7 +955,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPAlphaYOrigin)
{
attributes.alpha_y_origin = pPicture -> alphaOrigin.y;
if (nxagentCheckPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin) == 0)
if (!nxagentCheckPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin))
{
valuemask |= CPAlphaYOrigin;
nxagentSetPictureRemoteValue(pPicture, alpha_y_origin, attributes.alpha_y_origin);
......@@ -965,7 +965,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPClipXOrigin)
{
attributes.clip_x_origin = pPicture -> clipOrigin.x;
if (nxagentCheckPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin) == 0)
if (!nxagentCheckPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin))
{
valuemask |= CPClipXOrigin;
nxagentSetPictureRemoteValue(pPicture, clip_x_origin, attributes.clip_x_origin);
......@@ -975,7 +975,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPClipYOrigin)
{
attributes.clip_y_origin = pPicture -> clipOrigin.y;
if (nxagentCheckPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin) == 0)
if (!nxagentCheckPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin))
{
valuemask |= CPClipYOrigin;
nxagentSetPictureRemoteValue(pPicture, clip_y_origin, attributes.clip_y_origin);
......@@ -985,7 +985,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPGraphicsExposure)
{
attributes.graphics_exposures = (Bool)pPicture -> graphicsExposures;
if (nxagentCheckPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures) == 0)
if (!nxagentCheckPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures))
{
valuemask |= CPGraphicsExposure;
nxagentSetPictureRemoteValue(pPicture, graphics_exposures, attributes.graphics_exposures);
......@@ -995,7 +995,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPSubwindowMode)
{
attributes.subwindow_mode = pPicture -> subWindowMode;
if (nxagentCheckPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode) == 0)
if (!nxagentCheckPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode))
{
valuemask |= CPSubwindowMode;
nxagentSetPictureRemoteValue(pPicture, subwindow_mode, attributes.subwindow_mode);
......@@ -1021,7 +1021,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPPolyEdge)
{
attributes.poly_edge = pPicture -> polyEdge;
if (nxagentCheckPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge) == 0)
if (!nxagentCheckPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge))
{
valuemask |= CPPolyEdge;
nxagentSetPictureRemoteValue(pPicture, poly_edge, attributes.poly_edge);
......@@ -1031,7 +1031,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPPolyMode)
{
attributes.poly_mode = pPicture -> polyMode;
if (nxagentCheckPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode) == 0)
if (!nxagentCheckPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode))
{
valuemask |= CPPolyMode;
nxagentSetPictureRemoteValue(pPicture, poly_mode, attributes.poly_mode);
......@@ -1041,7 +1041,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPDither)
{
attributes.dither = pPicture -> dither;
if (nxagentCheckPictureRemoteValue(pPicture, dither, attributes.dither) == 0)
if (!nxagentCheckPictureRemoteValue(pPicture, dither, attributes.dither))
{
valuemask |= CPDither;
nxagentSetPictureRemoteValue(pPicture, dither, attributes.dither);
......@@ -1051,7 +1051,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
if (mask & CPComponentAlpha)
{
attributes.component_alpha = pPicture -> componentAlpha;
if (nxagentCheckPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha) == 0)
if (!nxagentCheckPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha))
{
valuemask |= CPComponentAlpha;
nxagentSetPictureRemoteValue(pPicture, component_alpha, attributes.component_alpha);
......@@ -1314,7 +1314,7 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
RegionPtr pRegion = nxagentCreateRegion(pDst -> pDrawable, NULL, glyphBox.x1, glyphBox.y1,
glyphBox.x2 - glyphBox.x1, glyphBox.y2 - glyphBox.y1);
if (RegionNil(pRegion) == 1)
if (RegionNil(pRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentGlyphs: WARNING! Glyphs prevented on hidden window at [%p].\n",
......@@ -2252,7 +2252,7 @@ void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2)
{
GlyphSetPtr pGly = (GlyphSetPtr) p0;
if (nxagentReconnectTrap == 0)
if (!nxagentReconnectTrap)
{
int i;
XRenderPictFormat *pForm = NULL;
......
......@@ -176,7 +176,7 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix);
* These variables are for shadowing feature.
*/
int nxagentShadowResize = 0;
Bool nxagentShadowResize = False;
WindowPtr nxagentShadowWindowPtr = NULL;
......@@ -800,6 +800,9 @@ void nxagentPrintAgentGeometry(char *hdrMessage, char *prefix)
fprintf(stderr, "%s | Fullscreen is %s.\n", prefix,
nxagentOption(Fullscreen) ? "ON" : "OFF");
fprintf(stderr, "%s | AllScreens is %s.\n", prefix,
nxagentOption(AllScreens) ? "ON" : "OFF");
fprintf(stderr, "%s | Desktop resize mode is %s.\n", prefix,
nxagentOption(DesktopResize) ? "ON" : "OFF");
......@@ -846,7 +849,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
pScreen->myNum);
#endif
if (nxagentRenderEnable && nxagentReconnectTrap == False)
if (nxagentRenderEnable && !nxagentReconnectTrap)
{
PictureScreenPrivateIndex = -1;
}
......@@ -901,7 +904,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* user geometry then.
*/
if (nxagentReconnectTrap == False && !nxagentOption(Rootless))
if (!nxagentReconnectTrap && !nxagentOption(Rootless))
{
if (nxagentUserGeometry.flag & XValue)
{
......@@ -945,7 +948,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* the screen if we are either in rootless or in fullscreen mode.
*/
if (nxagentOption(Rootless) == False && !nxagentWMIsRunning)
if (!nxagentOption(Rootless) && !nxagentWMIsRunning)
{
#ifdef TEST
fprintf(stderr, "nxagentOpenScreen: Forcing fullscreen mode with no window manager running.\n");
......@@ -954,7 +957,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
nxagentChangeOption(Fullscreen, True);
if (nxagentOption(ClientOs) == ClientOsWinnt &&
(nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup))
(!nxagentReconnectTrap || nxagentResizeDesktopAtStartup))
{
NXSetExposeParameters(nxagentDisplay, 0, 0, 0);
}
......@@ -963,7 +966,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
if (nxagentOption(Fullscreen) &&
nxagentWMIsRunning &&
nxagentReconnectTrap &&
nxagentResizeDesktopAtStartup == False &&
!nxagentResizeDesktopAtStartup &&
nxagentXServerGeometryChanged())
{
#ifdef TEST
......@@ -993,7 +996,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
nxagentChangeOption(Height, h);
/* first time screen initialization or resize during reconnect */
if (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup)
if (!nxagentReconnectTrap || nxagentResizeDesktopAtStartup)
{
if (nxagentOption(RootWidth) >= w)
{
......@@ -1046,7 +1049,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* screen is initialized for the first time.
*/
if (nxagentReconnectTrap == False)
if (!nxagentReconnectTrap)
{
nxagentChangeOption(RootX, 0);
nxagentChangeOption(RootY, 0);
......@@ -1085,7 +1088,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
* the root window isn't bigger than the X server root window..
*/
if (nxagentReconnectTrap == False)
if (!nxagentReconnectTrap)
{
if ((nxagentOption(RootWidth) < w) &&
!(nxagentUserGeometry.flag & WidthValue))
......@@ -1117,7 +1120,7 @@ Bool nxagentOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth));
nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight));
if (nxagentReconnectTrap == 0)
if (!nxagentReconnectTrap)
{
if (nxagentOption(Persistent))
{
......@@ -1654,8 +1657,8 @@ N/A
nxagentPrintAgentGeometry(NULL, "nxagentOpenScreen:");
#endif
if (nxagentDoFullGeneration == 1 ||
nxagentReconnectTrap == 1)
if (nxagentDoFullGeneration ||
nxagentReconnectTrap)
{
unsigned long valuemask = CWBackPixel | CWEventMask | CWColormap;
XSetWindowAttributes attributes = {
......@@ -1664,13 +1667,13 @@ N/A
.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen))
};
if (nxagentOption(AllScreens) == 1)
if (nxagentOption(AllScreens))
{
valuemask |= CWOverrideRedirect;
attributes.override_redirect = True;
}
if (nxagentOption(Fullscreen) == 1)
if (nxagentOption(Fullscreen))
{
if (nxagentReconnectTrap)
{
......@@ -1729,7 +1732,7 @@ N/A
pScreen->myNum, nxagentDefaultWindows[pScreen->myNum]);
#endif
if (nxagentOption(Rootless) == 0)
if (!nxagentOption(Rootless))
{
XSetWindowAttributes inpattributes = {.event_mask = PointerMotionMask};
......@@ -1833,7 +1836,7 @@ N/A
sizeHints->width = nxagentOption(RootWidth);
sizeHints->height = nxagentOption(RootHeight);
if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1)
if (nxagentOption(DesktopResize) || nxagentOption(Fullscreen))
{
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
......@@ -1950,7 +1953,7 @@ N/A
/* FIXME: This doing the same thing in both cases. The
comments do not seem accurate (anymore?) */
if (nxagentOption(Rootless) == False)
if (!nxagentOption(Rootless))
{
/*
* Set the WM_DELETE_WINDOW protocol for the main agent
......@@ -1998,7 +2001,7 @@ N/A
* change the real X server's keyboard and pointer settings.
*/
if (nxagentOption(DeviceControl) == False)
if (!nxagentOption(DeviceControl))
{
fprintf(stderr, "Info: Not using local device configuration changes.\n");
}
......@@ -2362,7 +2365,7 @@ FIXME: We should try to restore the previously
* Change agent window size and size hints.
*/
if ((nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0))
if (!(nxagentOption(Fullscreen) || nxagentOption(AllScreens)))
{
nxagentSetWMNormalHints(pScreen->myNum, width, height);
......@@ -2374,7 +2377,7 @@ FIXME: We should try to restore the previously
XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height);
}
if (nxagentOption(Rootless) == 0)
if (!nxagentOption(Rootless))
{
#ifdef DEBUG
fprintf(stderr, "%s: resizing InputWindow to [%d]x[%d]\n", __func__, width, height);
......@@ -2529,7 +2532,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
NXShadowSetDisplayUid(nxagentShadowUid);
}
if (nxagentOption(UseDamage) == 0)
if (nxagentOption(UseDamage))
{
NXShadowDisableDamage();
}
......@@ -2566,7 +2569,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin)
return -1;
}
if (nxagentOption(Fullscreen) == 1)
if (nxagentOption(Fullscreen))
{
nxagentShadowSetRatio(WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowWidth,
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) * 1.0 / nxagentShadowHeight);
......@@ -2900,7 +2903,7 @@ int nxagentShadowSendUpdates(int *suspended)
{
*suspended = 0;
if (RegionNil(&nxagentShadowUpdateRegion) == 1)
if (RegionNil(&nxagentShadowUpdateRegion))
{
return 0;
}
......@@ -4396,7 +4399,7 @@ void nxagentSetWMNormalHints(int screen, int width, int height)
sizeHints->width = width;
sizeHints->height = height;
if (nxagentOption(DesktopResize) == 1)
if (nxagentOption(DesktopResize))
{
sizeHints->max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
sizeHints->max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay));
......
......@@ -67,7 +67,7 @@ extern RegionRec nxagentShadowUpdateRegion;
extern WindowPtr nxagentShadowWindowPtr;
extern int nxagentShadowResize;
extern Bool nxagentShadowResize;
extern short nxagentShadowUid;
......
......@@ -612,7 +612,7 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion)
RegionIntersect(&tmpRegion, pResource -> region, pRegion);
if (RegionNil(&tmpRegion) == 0)
if (!RegionNil(&tmpRegion))
{
#ifdef TEST
fprintf(stderr, "nxagentValidateSplit: Marking the overlapping commits as invalid "
......@@ -829,11 +829,11 @@ static Bool nxagentWaitSplitPredicate(Display *disp, XEvent *event, XPointer ptr
event -> xclient.format == 32);
}
int nxagentWaitSplitEvent(int resource)
Bool nxagentWaitSplitEvent(int resource)
{
XEvent event;
int split = 0;
Bool split = 0;
/*
* Don't flush the link. We only want to query the NX transport to
......@@ -890,7 +890,7 @@ int nxagentWaitSplitEvent(int resource)
{
nxagentHandleStartSplitEvent(resource);
split = 1;
split = True;
break;
}
......@@ -1074,7 +1074,7 @@ void nxagentHandleEndSplitEvent(int resource)
if (pResource -> drawable != NULL &&
pResource -> region != NullRegion)
{
if (RegionNil(pResource -> region) == 0)
if (!RegionNil(pResource -> region))
{
RegionSubtract(
nxagentCorruptedRegion(pResource -> drawable),
......
......@@ -378,7 +378,7 @@ Bool nxagentCreateWindow(WindowPtr pWin)
nxagentWindowPriv(pWin) -> corruptedTimestamp = 0;
nxagentWindowPriv(pWin) -> splitResource = NULL;
if (nxagentOption(Rootless) == 1)
if (nxagentOption(Rootless))
{
nxagentWindowPriv(pWin) -> isMapped = 0;
......@@ -548,7 +548,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
{
nxagentPrivWindowPtr pWindowPriv;
if (nxagentScreenTrap == 1)
if (nxagentScreenTrap)
{
return 1;
}
......@@ -643,7 +643,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
}
if (nxagentOption(Rootless) && nxagentRootlessDialogPid == 0 &&
nxagentLastWindowDestroyed == False && nxagentSomeWindowsAreMapped() == False)
!nxagentLastWindowDestroyed && nxagentSomeWindowsAreMapped() == False)
{
#ifdef TEST
fprintf(stderr, "nxagentDestroyWindow: Last mapped window as been destroyed.\n");
......@@ -672,7 +672,7 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
*/
Bool nxagentPositionWindow(WindowPtr pWin, int x, int y)
{
if (nxagentScreenTrap == 1)
if (nxagentScreenTrap)
{
return True;
}
......@@ -690,7 +690,7 @@ Bool nxagentPositionWindow(WindowPtr pWin, int x, int y)
void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
{
if (nxagentScreenTrap == 1)
if (nxagentScreenTrap)
{
return;
}
......@@ -700,7 +700,7 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn)
{
if (nxagentOption(Rootless) == 1)
if (nxagentOption(Rootless))
{
return;
}
......@@ -901,9 +901,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e);
nxagentFullscreenWindow = w;
if (nxagentOption(DesktopResize) == 1)
if (nxagentOption(DesktopResize))
{
if (nxagentOption(Shadow) == 0)
if (!nxagentOption(Shadow))
{
nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)),
HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), True);
......@@ -952,12 +952,12 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentIconWindow = nxagentFullscreenWindow = None;
if (nxagentOption(DesktopResize) == 1)
if (nxagentOption(DesktopResize))
{
nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth));
nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight));
if (nxagentOption(Shadow) == 0)
if (!nxagentOption(Shadow))
{
nxagentChangeScreenConfig(0, nxagentOption(RootWidth),
nxagentOption(RootHeight), True);
......@@ -998,7 +998,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn)
nxagentChangeOption(Width, nxagentOption(SavedWidth));
nxagentChangeOption(Height, nxagentOption(SavedHeight));
if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1)
if (nxagentOption(Shadow) && nxagentOption(DesktopResize))
{
nxagentShadowAdaptToRatio();
}
......@@ -1250,7 +1250,7 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
int offX = nxagentWindowPriv(pWin)->x - pWin->origin.x;
int offY = nxagentWindowPriv(pWin)->y - pWin->origin.y;
if (nxagentScreenTrap == 1)
if (nxagentScreenTrap)
{
#ifdef TEST
fprintf(stderr, "nxagentConfigureWindow: WARNING: Called with the screen trap set.\n");
......@@ -1259,8 +1259,8 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
return;
}
if (nxagentOption(Rootless) == 1 &&
nxagentWindowTopLevel(pWin) == 1)
if (nxagentOption(Rootless) &&
nxagentWindowTopLevel(pWin))
{
mask &= ~(CWSibling | CWStackMode);
}
......@@ -1877,7 +1877,7 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired)
-+ */
Bool nxagentRealizeWindow(WindowPtr pWin)
{
if (nxagentScreenTrap == 1)
if (nxagentScreenTrap)
{
return True;
}
......@@ -2146,7 +2146,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
if (nxagentSessionState != SESSION_DOWN)
{
if (nxagentExposeArrayIsInitialized == 0)
if (!nxagentExposeArrayIsInitialized)
{
#ifdef TEST
fprintf(stderr, "nxagentWindowExposures: Initializing expose queue.\n");
......@@ -2171,7 +2171,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
nxagentInitRemoteExposeRegion();
nxagentExposeArrayIsInitialized = 1;
nxagentExposeArrayIsInitialized = True;
}
RegionRec temp;
......@@ -2195,7 +2195,7 @@ void nxagentWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_expo
RegionUnion(&temp, &temp, other_exposed);
}
if (RegionNil(&temp) == 0)
if (!RegionNil(&temp))
{
RegionTranslate(&temp,
-(pWin -> drawable.x), -(pWin -> drawable.y));
......@@ -2500,7 +2500,7 @@ void nxagentRefreshWindows(WindowPtr pWin)
void nxagentUnmapWindows(void)
{
if (nxagentOption(Fullscreen) == 1)
if (nxagentOption(Fullscreen))
{
for (int i = 0; i < screenInfo.numScreens; i++)
{
......@@ -2527,7 +2527,7 @@ void nxagentMapDefaultWindows(void)
*/
MapWindow(pWin, serverClient);
if (nxagentOption(Rootless) == 0)
if (!nxagentOption(Rootless))
{
/*
* Show the NX splash screen.
......@@ -2547,7 +2547,7 @@ void nxagentMapDefaultWindows(void)
* Windows client.
*/
if (nxagentOption(Shadow) == 0 || !nxagentWMIsRunning)
if (!nxagentOption(Shadow) || !nxagentWMIsRunning)
{
#ifdef TEST
fprintf(stderr, "nxagentMapDefaultWindows: Mapping default window id [%ld].\n",
......@@ -2556,7 +2556,7 @@ void nxagentMapDefaultWindows(void)
XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]);
if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning)
if (nxagentOption(Fullscreen) && nxagentWMIsRunning)
{
nxagentMaximizeToFullScreen(pScreen);
}
......@@ -2573,7 +2573,7 @@ void nxagentMapDefaultWindows(void)
* nxagentReconnectAllWindows, after the Root Window is mapped.
*/
if (nxagentReconnectTrap == 0)
if (!nxagentReconnectTrap)
{
XRaiseWindow(nxagentDisplay, nxagentInputWindows[pScreen->myNum]);
}
......@@ -2760,7 +2760,7 @@ Bool nxagentReconnectAllWindows(void *p0)
* raised.
*/
if (nxagentOption(Rootless) == 0)
if (!nxagentOption(Rootless))
{
for (int i = 0; i < screenInfo.numScreens; i++)
{
......@@ -3274,7 +3274,7 @@ XXX: This would break Motif menus.
XIconifyWindow(nxagentDisplay, nxagentWindow(pWin), pWin -> drawable.pScreen -> myNum);
}
}
else if (nxagentOption(Rootless) == 0)
else if (!nxagentOption(Rootless))
{
/*
* Map the root window.
......
......@@ -36,6 +36,6 @@
extern xdmcp_states XdmcpState;
extern int XdmcpTimeOutRtx;
extern int XdmcpStartTime;
extern int nxagentXdmcpUp;
extern Bool nxagentXdmcpUp;
#endif /* __Xdmcp_H__ */
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