diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-01-15 16:27:32 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-01-15 16:27:32 +0100 |
commit | faae65fb3693fd1020e740e00f9038607bc4a430 (patch) | |
tree | 8ee59a2342f6320f9e8dc3e714b118e106f8d64d | |
parent | d545afdf3967b0305c1215bb9f8a545b81fc24e8 (diff) | |
parent | b44ecc0f897a5d03445aafc120e54b6475699254 (diff) | |
download | nx-libs-faae65fb3693fd1020e740e00f9038607bc4a430.tar.gz nx-libs-faae65fb3693fd1020e740e00f9038607bc4a430.tar.bz2 nx-libs-faae65fb3693fd1020e740e00f9038607bc4a430.zip |
Merge branch 'uli42-pr/rework_booleans_v2' into 3.6.x
Attributes GH PR #980: https://github.com/ArcticaProject/nx-libs/pull/980
44 files changed, 535 insertions, 558 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 1ae1b570b..ee76fc795 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -116,7 +116,7 @@ is" without express or implied warranty. #undef DISABLE_SMART_SCHEDULE -int nxagentUserDefinedFontPath = 0; +Bool nxagentUserDefinedFontPath = False; /* * From X11/ImUtil.c. @@ -178,7 +178,7 @@ static void nxagentParseOptionString(char*); static int nxagentGetDialogName(void); -char nxagentVerbose = 0; +Bool nxagentVerbose = False; char *nxagentKeystrokeFile = NULL; @@ -488,11 +488,11 @@ int ddxProcessArgument(int argc, char *argv[], int i) { if (!strcmp(argv[i], "0")) { - nxagentChangeOption(Streaming, 0); + nxagentChangeOption(Streaming, False); } else { - nxagentChangeOption(Streaming, 1); + nxagentChangeOption(Streaming, True); } return 2; } @@ -507,7 +507,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) sscanf(argv[i], "%i", &level) == 1 && level >= 0 && level <= 2) { - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { nxagentChangeOption(DeferLevel, level); @@ -558,7 +558,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) fprintf(stderr, "ddxProcessArgument: User defined font path [%s].\n", argv[i]); #endif - nxagentUserDefinedFontPath = 1; + nxagentUserDefinedFontPath = True; defaultFontPath = argv[i]; } else @@ -589,7 +589,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) } } - if (nxagentUserGeometry.flag || (nxagentOption(Fullscreen) == 1)) + if (nxagentUserGeometry.flag || (nxagentOption(Fullscreen))) { return 2; } @@ -670,7 +670,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-nomagicpixel")) { - nxagentChangeOption(MagicPixel, 0); + nxagentChangeOption(MagicPixel, False); return 1; } @@ -725,13 +725,13 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-nocomposite")) { - nxagentChangeOption(Composite, 0); + nxagentChangeOption(Composite, False); return 1; } if (!strcmp(argv[i], "-nodamage")) { - nxagentChangeOption(UseDamage, 0); + nxagentChangeOption(UseDamage, False); return 1; } @@ -779,7 +779,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-noignore")) { nxagentChangeOption(DeviceControl, True); - nxagentChangeOption(DeviceControlUserDefined , True); + nxagentChangeOption(DeviceControlUserDefined, True); return 1; } @@ -791,7 +791,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-noxkblock")) { - nxagentChangeOption(InhibitXkb, 0); + nxagentChangeOption(InhibitXkb, False); return 1; } @@ -801,14 +801,9 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-R")) { - if (nxagentOption(Binder) == UNDEFINED || - nxagentOption(Desktop) == UNDEFINED || - nxagentOption(Rootless) == UNDEFINED) - { - nxagentChangeOption(Binder, False); - nxagentChangeOption(Desktop, False); - nxagentChangeOption(Rootless, True); - } + nxagentChangeOption(Binder, False); + nxagentChangeOption(Desktop, False); + nxagentChangeOption(Rootless, True); return 1; } @@ -830,9 +825,9 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-S")) { - nxagentChangeOption(Shadow, 1); + nxagentChangeOption(Shadow, True); nxagentChangeOption(DeferLevel, 0); - nxagentChangeOption(Persistent, 0); + nxagentChangeOption(Persistent, False); return 1; } @@ -858,11 +853,11 @@ int ddxProcessArgument(int argc, char *argv[], int i) { if (!strcmp(argv[i], "0")) { - nxagentChangeOption(ViewOnly, 1); + nxagentChangeOption(ViewOnly, True); } else { - nxagentChangeOption(ViewOnly, 0); + nxagentChangeOption(ViewOnly, False); } return 2; } @@ -969,7 +964,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i], "-verbose")) { - nxagentVerbose = 1; + nxagentVerbose = True; return 1; } @@ -998,7 +993,7 @@ int ddxProcessArgument(int argc, char *argv[], int i) * has been disabled on the cmdline. */ if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) - nxagentChangeOption(Xinerama, 0); + nxagentChangeOption(Xinerama, False); return 0; } @@ -1080,7 +1075,7 @@ static void nxagentParseSingleOption(char *name, char *value) } else if (!strcmp(name, "render")) { - if (nxagentReconnectTrap == True) + if (nxagentReconnectTrap) { #ifdef DEBUG fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'render' at reconnection.\n"); @@ -1111,7 +1106,7 @@ static void nxagentParseSingleOption(char *name, char *value) } else if (!strcmp(name, "fullscreen")) { - if (nxagentReconnectTrap == True) + if (nxagentReconnectTrap) { #ifdef DEBUG fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'fullscreen' at reconnection.\n"); @@ -1174,11 +1169,11 @@ static void nxagentParseSingleOption(char *name, char *value) { if (!strcmp(value, "1")) { - nxagentChangeOption(Composite, 1); + nxagentChangeOption(Composite, True); } else if (!strcmp(value, "0")) { - nxagentChangeOption(Composite, 0); + nxagentChangeOption(Composite, False); } else { @@ -1190,25 +1185,25 @@ static void nxagentParseSingleOption(char *name, char *value) else if (!strcmp(name, "xinerama")) { #if !defined(PANORAMIX) && !defined(RANDR) - nxagentChangeOption(Xinerama, 0); + nxagentChangeOption(Xinerama, False); fprintf(stderr, "Warning: No Xinerama support compiled into %s.\n", nxagentProgName); return; #else if (PANORAMIX_DISABLED_COND && RRXINERAMA_DISABLED_COND) { - nxagentChangeOption(Xinerama, 0); + nxagentChangeOption(Xinerama, False); fprintf(stderr, "Warning: XINERAMA extension has been disabled on %s startup.\n", nxagentProgName); return; } if (!strcmp(value, "1")) { - nxagentChangeOption(Xinerama, 1); + nxagentChangeOption(Xinerama, True); return; } else if (!strcmp(value, "0")) { - nxagentChangeOption(Xinerama, 0); + nxagentChangeOption(Xinerama, False); } else { @@ -1220,13 +1215,13 @@ static void nxagentParseSingleOption(char *name, char *value) } else if (!strcmp(name, "resize")) { - if (nxagentOption(DesktopResize) == 0 || strcmp(value, "0") == 0) + if (!nxagentOption(DesktopResize) || strcmp(value, "0") == 0) { - nxagentResizeDesktopAtStartup = 0; + nxagentResizeDesktopAtStartup = False; } else if (strcmp(value, "1") == 0) { - nxagentResizeDesktopAtStartup = 1; + nxagentResizeDesktopAtStartup = True; } else { @@ -1251,11 +1246,11 @@ static void nxagentParseSingleOption(char *name, char *value) { if (!strcmp(value, "0")) { - nxagentChangeOption(Menu, 0); + nxagentChangeOption(Menu, False); } else { - nxagentChangeOption(Menu, 1); + nxagentChangeOption(Menu, True); } return; } @@ -1263,17 +1258,17 @@ static void nxagentParseSingleOption(char *name, char *value) { if (!strcmp(value, "0")) { - nxagentChangeOption(MagicPixel, 0); + nxagentChangeOption(MagicPixel, False); } else { - nxagentChangeOption(MagicPixel, 1); + nxagentChangeOption(MagicPixel, True); } return; } else if (!strcmp(name, "autodpi")) { - if (nxagentReconnectTrap == True) + if (nxagentReconnectTrap) { #ifdef DEBUG fprintf(stderr, "nxagentParseSingleOption: Ignoring option 'autodpi' at reconnection.\n"); @@ -1749,13 +1744,14 @@ N/A #endif - if ((nxagentOption(Rootless) == 1) && nxagentOption(Fullscreen) == 1) + if (nxagentOption(Rootless) && nxagentOption(Fullscreen)) { #ifdef TEST fprintf(stderr, "WARNING: Ignoring fullscreen option for rootless session.\n"); #endif nxagentChangeOption(Fullscreen, False); + nxagentChangeOption(AllScreens, False); } /* @@ -1971,35 +1967,6 @@ N/A nxagentSetCoalescence(); /* - * Set the other defaults. - */ - - if (nxagentOption(Fullscreen) == UNDEFINED) - { - nxagentChangeOption(Fullscreen, False); - } - - if (nxagentOption(AllScreens) == UNDEFINED) - { - nxagentChangeOption(AllScreens, False); - } - - if (nxagentOption(Binder) == UNDEFINED) - { - nxagentChangeOption(Binder, False); - } - - if (nxagentOption(Rootless) == UNDEFINED) - { - nxagentChangeOption(Rootless, False); - } - - if (nxagentOption(Desktop) == UNDEFINED) - { - nxagentChangeOption(Desktop, True); - } - - /* * The enableBackingStore flag is defined * in window.c in the dix. */ @@ -2039,7 +2006,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. nxagentAlphaEnabled = False; } - if ((nxagentOption(Rootless) == 1) && nxagentOption(Xdmcp)) + if (nxagentOption(Rootless) && nxagentOption(Xdmcp)) { FatalError("PANIC! Cannot start a XDMCP session in rootless mode.\n"); } @@ -2048,7 +2015,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. * We enable server reset only for indirect XDMCP sessions. */ - if (nxagentOption(Reset) == True && nxagentMaxAllowedResets == 0) + if (nxagentOption(Reset) && nxagentMaxAllowedResets == 0) { #ifdef WARNING fprintf(stderr, "nxagentPostProcessArgs: Disabling the server reset.\n"); @@ -2064,7 +2031,7 @@ FIXME: In rootless mode the backing-store support is not functional yet. * passing the -noreset option to a standard XFree86 server. */ - if (nxagentOption(Reset) == False) + if (!nxagentOption(Reset)) { #ifdef TEST fprintf(stderr, "nxagentPostProcessArgs: Disabling dispatch of exception at server reset.\n"); @@ -2176,7 +2143,7 @@ void nxagentSetPackMethod(void) if (nxagentOption(LinkType) == LINK_TYPE_NONE) { - nxagentChangeOption(Streaming, 0); + nxagentChangeOption(Streaming, False); nxagentPackMethod = PACK_NONE; nxagentPackLossless = PACK_NONE; @@ -2199,7 +2166,7 @@ void nxagentSetPackMethod(void) fprintf(stderr, "nxagentSetPackMethod: Using adaptive mode for image compression.\n"); #endif - nxagentChangeOption(Adaptive, 1); + nxagentChangeOption(Adaptive, True); } else { @@ -2207,7 +2174,7 @@ void nxagentSetPackMethod(void) fprintf(stderr, "nxagentSetPackMethod: Not using adaptive mode for image compression.\n"); #endif - nxagentChangeOption(Adaptive, 0); + nxagentChangeOption(Adaptive, False); } if (method == PACK_LOSSY || method == PACK_ADAPTIVE) @@ -2336,11 +2303,11 @@ void nxagentSetDeferLevel(void) * version of the agent. */ - if (nxagentOption(Streaming) == 1) + if (nxagentOption(Streaming)) { fprintf(stderr, "Warning: Streaming of images not available in this agent.\n"); - nxagentChangeOption(Streaming, 0); + nxagentChangeOption(Streaming, False); } switch (nxagentOption(LinkType)) @@ -2363,7 +2330,7 @@ void nxagentSetDeferLevel(void) * Set the defer timeout. */ - if (nxagentOption(Shadow) == 1) + if (nxagentOption(Shadow)) { #ifdef TEST fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer timeout parameter in shadow mode.\n"); @@ -2378,7 +2345,7 @@ void nxagentSetDeferLevel(void) * Set the defer level. */ - if (nxagentOption(Shadow) == 1) + if (nxagentOption(Shadow)) { #ifdef TEST fprintf(stderr, "nxagentSetDeferLevel: Ignoring defer parameter in shadow mode.\n"); @@ -2482,7 +2449,7 @@ void nxagentSetScheduler(void) * The smart scheduler is the default. */ - if (nxagentOption(Shadow) == 1) + if (nxagentOption(Shadow)) { #ifdef TEST fprintf(stderr, "nxagentSetScheduler: Using the dumb scheduler in shadow mode.\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.h b/nx-X11/programs/Xserver/hw/nxagent/Args.h index c8f8907c3..aebb521a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.h @@ -97,7 +97,7 @@ void nxagentSetCoalescence(void); void nxagentShowVersionInfo(void); -extern int nxagentUserDefinedFontPath; +extern Bool nxagentUserDefinedFontPath; extern int nxagentRemoteMajor; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index 52c75e805..c15674f5e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -336,7 +336,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen) * server. */ - nxagentChangeOption(Nested, 1); + nxagentChangeOption(Nested, True); /* * Avoid the image degradation caused by diff --git a/nx-X11/programs/Xserver/hw/nxagent/Client.c b/nx-X11/programs/Xserver/hw/nxagent/Client.c index 83554e573..08b2d8feb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Client.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Client.c @@ -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; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index ceb47b669..8ac2241a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -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; } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h index 4817a03e2..d401dae51 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h @@ -35,7 +35,7 @@ typedef struct _XFixesAgentInfo int Opcode; int EventBase; int ErrorBase; - int Initialized; + Bool Initialized; } XFixesAgentInfoRec; extern XFixesAgentInfoRec nxagentXFixesInfo; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c index af29f8ebc..745696219 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c @@ -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 diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c index 05c78e0ad..dcee721a2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c @@ -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], diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 9adc67a21..15112312f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -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."); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index bdbf4fcf8..ca1b09dd3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -63,7 +63,7 @@ /* * The rectangles composing a region are de- fragmented to reduce the - * number of synch- ronizing PutImage's. + * number of synchronizing PutImage()s. */ #define ADVANCED_BOXES_DEFRAG @@ -99,7 +99,7 @@ int nxagentCorruptedPixmaps = 0; int nxagentCorruptedWindows = 0; int nxagentCorruptedBackgrounds = 0; -int nxagentForceSynchronization = 0; +Bool nxagentForceSynchronization = False; _nxagentSynchronizationRec nxagentSynchronization = { (DrawablePtr) NULL, 0, 0, 0, 0, 0 }; @@ -123,7 +123,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel); unsigned long nxagentGetDrawableColor(DrawablePtr pDrawable); unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion); -int nxagentSkipImage = 0; +Bool nxagentSkipImage = False; static int nxagentTooManyImageData(void) { @@ -144,7 +144,7 @@ int nxagentSynchronizeDrawable(DrawablePtr pDrawable, int wait, unsigned int bre { pDrawable = nxagentSplitDrawable(pDrawable); - if (nxagentLosslessTrap == 0) + if (!nxagentLosslessTrap) { if (nxagentDrawableStatus(pDrawable) == Synchronized) { @@ -257,7 +257,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask * copy with lossless compression turned off. */ - if (nxagentLosslessTrap == 1) + if (nxagentLosslessTrap) { #ifdef TEST fprintf(stderr, "%s: Forcing synchronization of pixmap at [%p] with lossless compression.\n", @@ -266,7 +266,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask return reallySynchronizeDrawableData(pDrawable); } - else if (nxagentReconnectTrap == 1) + else if (nxagentReconnectTrap) { /* * The pixmap data is not synchronized unless we need it. We @@ -277,7 +277,7 @@ int nxagentSynchronizeDrawableData(DrawablePtr pDrawable, unsigned int breakMask if (pDrawable -> depth == 1) { #ifdef TEST - if (nxagentReconnectTrap == 1) + if (nxagentReconnectTrap) { static int totalLength; static int totalReconnectedPixmaps; @@ -357,9 +357,9 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned * full drawable. */ - int useStoredBitmap = (nxagentDrawableBitmap(pDrawable) != NullPixmap && pRegion == NullRegion); + Bool useStoredBitmap = (nxagentDrawableBitmap(pDrawable) != NullPixmap && pRegion == NullRegion); - if (useStoredBitmap != 0) + if (useStoredBitmap) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap at [%p] " @@ -396,7 +396,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned * The bitmap to synchronize is clipped. */ - if (RegionNil(clipRegion) == 1) + if (RegionNil(clipRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: The bitmap region [%d,%d,%d,%d] is not viewable. " @@ -418,7 +418,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned } else { - if (pRegion != NullRegion && RegionNil(pRegion) == 1) + if (pRegion != NullRegion && RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Region [%d,%d,%d,%d] is nil. Skipping synchronization.\n", @@ -451,7 +451,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned RegionIntersect(clipRegion, clipRegion, nxagentCorruptedRegion(pDrawable)); - if (RegionNil(clipRegion) == 1) + if (RegionNil(clipRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: The corrupted region [%d,%d,%d,%d] is not viewable " @@ -473,7 +473,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned { RegionIntersect(clipRegion, clipRegion, pRegion); - if (RegionNil(clipRegion) == 1) + if (RegionNil(clipRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Region requested [%d,%d,%d,%d] already " @@ -588,7 +588,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned unsigned long now = GetTimeInMillis(); - nxagentSynchronization.abort = 0; + nxagentSynchronization.abort = False; /* * Going to split the updated region into small blocks. @@ -652,7 +652,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned "[%lu] ms elapsed.\n", elapsedTime); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; goto nxagentSynchronizeRegionStop; } @@ -670,7 +670,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentBlocking); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; goto nxagentSynchronizeRegionStop; } @@ -687,7 +687,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentCongestion); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; goto nxagentSynchronizeRegionStop; } @@ -799,7 +799,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (owner != NULL) { - if (nxagentOption(Shadow) == 1 && + if (nxagentOption(Shadow) && (nxagentOption(XRatio) != DONT_SCALE || nxagentOption(YRatio) != DONT_SCALE)) { @@ -834,7 +834,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned "new input events.\n"); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; goto nxagentSynchronizeRegionStop; } @@ -852,9 +852,9 @@ nxagentSynchronizeRegionStop: success = 1; - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { - if (nxagentSynchronization.abort == 1) + if (nxagentSynchronization.abort) { /* * Storing the pointer to the drawable we were synchronizing @@ -888,7 +888,7 @@ nxagentSynchronizeRegionStop: if (pDrawable -> type == DRAWABLE_PIXMAP && nxagentIsCorruptedBackground((PixmapPtr) pDrawable) == 1 && - RegionNil(&exposeRegion) == 0) + !RegionNil(&exposeRegion)) { struct nxagentExposeBackground eb = { .pBackground = (PixmapPtr) pDrawable, @@ -921,7 +921,7 @@ nxagentSynchronizeRegionStop: int w = RegionRects(&collectedUpdates)[i].x2 - RegionRects(&collectedUpdates)[i].x1; int h = RegionRects(&collectedUpdates)[i].y2 - RegionRects(&collectedUpdates)[i].y1; - if (nxagentOption(Shadow) == 1 && + if (nxagentOption(Shadow) && (nxagentOption(XRatio) != DONT_SCALE || nxagentOption(YRatio) != DONT_SCALE)) { @@ -994,7 +994,7 @@ void nxagentSynchronizeBox(DrawablePtr pDrawable, BoxPtr pBox, unsigned int brea pBox -> x2 - pBox -> x1, pBox -> y2 - pBox -> y1); - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeBox: Resulting region [%d,%d,%d,%d] is nil. Skipping synchronization.\n", @@ -1023,7 +1023,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2) DrawablePtr pDrawable = (DrawablePtr) p0; unsigned int *breakMask = (unsigned int *) p2; - int shouldClearHiddenRegion = 1; + Bool shouldClearHiddenRegion = True; /* * The nxagentSynchronization.abort propagates a break condition @@ -1031,7 +1031,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2) * synchronizations. */ - if (nxagentSynchronization.abort == 1 || + if (nxagentSynchronization.abort || nxagentDrawableStatus(pDrawable) == Synchronized) { return; @@ -1104,7 +1104,7 @@ void nxagentSynchronizeDrawablePredicate(void *p0, XID x1, void *p2) (void *) pDrawable); #endif - if (shouldClearHiddenRegion == 1) + if (shouldClearHiddenRegion) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeDrawablePredicate: Clearing out the not visible window " @@ -1138,7 +1138,7 @@ FIXME: This condition sounds only as a complication, as the break nxagentCongestion, nxagentBlocking); #endif - nxagentSynchronization.abort = 1; + nxagentSynchronization.abort = True; return; } @@ -1179,8 +1179,8 @@ FIXME: This condition sounds only as a complication, as the break * clear it. */ - if (nxagentSynchronization.abort == 0 && - shouldClearHiddenRegion == 1) + if (!nxagentSynchronization.abort && + shouldClearHiddenRegion) { #ifdef TEST fprintf(stderr, "nxagentSynchronizeDrawablePredicate: Clearing out the remaining corrupted " @@ -1241,9 +1241,9 @@ FIXME: All drawables should be set as synchronized and never marked as * round-robin and if the bitmaps are all synchronized. */ - int doRoundRobin = (nxagentSynchronization.pDrawable != NULL); + Bool doRoundRobin = (nxagentSynchronization.pDrawable != NULL); - nxagentSynchronization.abort = 0; + nxagentSynchronization.abort = False; /* * Synchronize the windows. @@ -1260,9 +1260,9 @@ FIXME: All drawables should be set as synchronized and never marked as #ifdef TEST - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && nxagentSynchronization.windowBitmaps == 0 && - doRoundRobin == 0) + !doRoundRobin) { if (nxagentCorruptedWindows > 0) { @@ -1280,7 +1280,7 @@ FIXME: All drawables should be set as synchronized and never marked as * Synchronize the backgrounds. */ - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_BACKGROUNDS(mask)) { #ifdef TEST @@ -1292,9 +1292,9 @@ FIXME: All drawables should be set as synchronized and never marked as #ifdef TEST - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && nxagentSynchronization.backgroundBitmaps == 0 && - doRoundRobin == 0) + !doRoundRobin) { if (nxagentCorruptedBackgrounds > 0) { @@ -1315,7 +1315,7 @@ FIXME: All drawables should be set as synchronized and never marked as * the pixmap in a copy or in a composite operation. */ - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && NXAGENT_SHOULD_SYNCHRONIZE_CORRUPTED_PIXMAPS(mask)) { #ifdef TEST @@ -1326,9 +1326,9 @@ FIXME: All drawables should be set as synchronized and never marked as nxagentSynchronizeDrawablePredicate, &breakMask); - if (nxagentSynchronization.abort == 0 && + if (!nxagentSynchronization.abort && nxagentSynchronization.pixmapBitmaps == 0 && - doRoundRobin == 0) + !doRoundRobin) { #ifdef TEST @@ -1441,7 +1441,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, * clipmask. */ - if (RegionNil(pRegion) == 0 && + if (!RegionNil(pRegion) && pGC != NULL && pGC -> clientClip != NULL && pGC -> clientClipType == CT_REGION) { @@ -1478,7 +1478,7 @@ RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) { - if (pRegion != NullRegion && RegionNil(pRegion) == 1) + if (pRegion != NullRegion && RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentMarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n", @@ -1552,7 +1552,7 @@ void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) { - if (pRegion != NullRegion && RegionNil(pRegion) == 1) + if (pRegion != NullRegion && RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentUnmarkCorruptedRegion: Region [%d,%d,%d,%d] is nil. Skipping operation.\n", @@ -2001,7 +2001,7 @@ unsigned long nxagentGetColor(DrawablePtr pDrawable, int xPixel, int yPixel) unsigned long nxagentGetRegionColor(DrawablePtr pDrawable, RegionPtr pRegion) { - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { return nxagentGetDrawableColor(pDrawable); } @@ -2055,7 +2055,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion) return; } - if (pRegion == NullRegion || RegionNil(pRegion) == 1) + if (pRegion == NullRegion || RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentClearRegion: The region is empty. Exiting.\n"); @@ -2145,7 +2145,7 @@ void nxagentClearRegion(DrawablePtr pDrawable, RegionPtr pRegion) void nxagentFillRemoteRegion(DrawablePtr pDrawable, RegionPtr pRegion) { - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { return; } @@ -2309,7 +2309,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2) * The window is not visible. */ - if (nxagentWindowIsVisible(pWin) == 0) + if (!nxagentWindowIsVisible(pWin)) { return; } @@ -2328,7 +2328,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2) nxagentFreeRegion(clipRegion); - if (RegionNil(&visRegion) == 1) + if (RegionNil(&visRegion)) { #ifdef TEST fprintf(stderr, "nxagentCorruptedRegionOnWindow: The corrupted region of window at [%p] is hidden.\n", @@ -2455,7 +2455,7 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) RegionIntersect(pClipRegion, pClipRegion, nxagentCorruptedRegion(pDrawable)); - if (RegionNil(pClipRegion) == 1) + if (RegionNil(pClipRegion)) { #ifdef TEST fprintf(stderr, "nxagentCreateDrawableBitmap: The corrupted region is not visible. Skipping bitmap creation.\n"); @@ -2658,7 +2658,7 @@ void nxagentAllocateCorruptedResource(DrawablePtr pDrawable, RESTYPE type) */ if (nxagentPixmapUsageCounter((PixmapPtr) pDrawable) >= MINIMUM_PIXMAP_USAGE_COUNTER && - nxagentIsShmPixmap((PixmapPtr) pDrawable) == 0) + !nxagentIsShmPixmap((PixmapPtr) pDrawable)) { pRealPixmap = nxagentRealPixmap((PixmapPtr) pDrawable); @@ -2780,14 +2780,14 @@ void nxagentUnmarkExposedRegion(WindowPtr pWin, RegionPtr pRegion, RegionPtr pOt { RegionRec clipRegion; - if (pRegion != NullRegion && RegionNil(pRegion) == 0 && + if (pRegion != NullRegion && !RegionNil(pRegion) && nxagentDrawableStatus((DrawablePtr) pWin) == NotSynchronized) { RegionInit(&clipRegion, NullBox, 1); RegionCopy(&clipRegion, pRegion); - if (pOther != NullRegion && RegionNil(pOther) == 0) + if (pOther != NullRegion && !RegionNil(pOther)) { RegionUnion(&clipRegion, &clipRegion, pOther); } @@ -2815,7 +2815,7 @@ int nxagentSynchronizationPredicate(void) return NotNeeded; } - if (nxagentBlocking == 0 && + if (!nxagentBlocking && nxagentCongestion <= 4 && nxagentReady == 0 && nxagentUserInput(NULL) == 0) @@ -2871,7 +2871,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt RegionSubtract(&expose, &expose, nxagentCorruptedRegion((DrawablePtr) pWin)); - if (RegionNil(&pWin -> clipList) != 0) + if (RegionNil(&pWin -> clipList)) { #ifdef TEST fprintf(stderr, "nxagentSendBackgroundExpose: Exposures deferred because the window " @@ -2897,7 +2897,7 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt pBackingStore = (miBSWindowPtr)pWin->backStorage; - if ((pBackingStore != NULL) && (RegionNil(&pBackingStore->SavedRegion) == 0)) + if ((pBackingStore != NULL) && !RegionNil(&pBackingStore->SavedRegion)) { RegionTranslate(&expose, -pWin -> drawable.x, -pWin -> drawable.y); @@ -2931,7 +2931,7 @@ void nxagentExposeBackgroundPredicate(void *p0, XID x1, void *p2) struct nxagentExposeBackground *pPair = p2; - if (RegionNil(pPair -> pExpose) != 0) + if (RegionNil(pPair -> pExpose)) { return; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h index 1101f989f..e4d3ec96e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h @@ -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); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.c b/nx-X11/programs/Xserver/hw/nxagent/Error.c index add5fae85..8c9a52d2e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Error.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c @@ -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); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.h b/nx-X11/programs/Xserver/hw/nxagent/Error.h index 9f5cfef74..76f120ff3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Error.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Error.h @@ -32,7 +32,7 @@ extern char *nxagentClientsLogName; -extern char nxagentVerbose; +extern Bool nxagentVerbose; int nxagentErrorHandler(Display *dpy, XErrorEvent *event); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 332cb2f32..a9a79cebd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -569,13 +569,13 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentChangeOption(DesktopResize, !desktopResize); - if (nxagentOption(DesktopResize) == 0) + if (!nxagentOption(DesktopResize)) { fprintf(stderr,"Info: Disabled desktop resize mode in agent.\n"); nxagentLaunchDialog(DIALOG_DISABLE_DESKTOP_RESIZE_MODE); - if (nxagentOption(Fullscreen) == 0) + if (!nxagentOption(Fullscreen)) { nxagentSetWMNormalHintsMaxsize(pScreen, nxagentOption(RootWidth), @@ -607,7 +607,7 @@ void nxagentShadowSwitchResizeMode(ScreenPtr pScreen) nxagentChangeOption(DesktopResize, !desktopResize); - if (nxagentOption(DesktopResize) == 0) + if (!nxagentOption(DesktopResize)) { nxagentShadowSetRatio(1.0, 1.0); @@ -660,7 +660,7 @@ static void nxagentSwitchDeferMode(void) { nxagentLaunchDialog(DIALOG_DISABLE_DEFER_MODE); - nxagentForceSynchronization = 1; + nxagentForceSynchronization = True; } } @@ -1043,7 +1043,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) } case doSwitchResizeMode: { - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { if (nxagentNoDialogIsRunning) { @@ -1097,7 +1097,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentRemoveDuplicatedKeys(&X); } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) == 1 && result == doNothing) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) && result == doNothing) { X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); @@ -1143,7 +1143,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already nxagentKeyDown = 0; } - if (nxagentXkbState.Initialized == 0) + if (!nxagentXkbState.Initialized) { if (X.xkey.keycode == nxagentCapsLockKeycode) { @@ -1190,7 +1190,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already CriticalOutputPending = 1; - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); @@ -1219,7 +1219,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if (nxagentOption(Fullscreen)) { - if ( (nxagentOption(MagicPixel) == 1) && (nxagentMagicPixelZone(X.xbutton.x, X.xbutton.y)) ) + if ( nxagentOption(MagicPixel) && nxagentMagicPixelZone(X.xbutton.x, X.xbutton.y) ) { pScreen = nxagentScreen(X.xbutton.window); @@ -1229,7 +1229,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } } - if (nxagentOption(DesktopResize) == False && + if (!nxagentOption(DesktopResize) && (X.xbutton.state & (ControlMask | Mod1Mask)) == (ControlMask | Mod1Mask)) { /* @@ -1285,7 +1285,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already CriticalOutputPending = 1; } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { X.xbutton.x -= nxagentOption(RootX); X.xbutton.y -= nxagentOption(RootY); @@ -1359,7 +1359,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already CriticalOutputPending = 1; } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { X.xbutton.x -= nxagentOption(RootX); X.xbutton.y -= nxagentOption(RootY); @@ -1420,7 +1420,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) - 50) && X.xmotion.x_root < (nxagentLastEnteredTopLevelWindow -> drawable.x + (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) + 50) && - nxagentOption(Menu) == 1) + nxagentOption(Menu)) { nxagentPulldownDialog(nxagentLastEnteredTopLevelWindow -> drawable.id); } @@ -1474,7 +1474,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already viewportLastY = X.xmotion.y; } - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) && !viewportCursor) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow) && !viewportCursor) { X.xmotion.x -= nxagentOption(RootX); X.xmotion.y -= nxagentOption(RootY); @@ -1492,7 +1492,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already NXShadowEvent(nxagentDisplay, X); } - if (nxagentOption(Shadow) == 0) + if (!nxagentOption(Shadow)) { nxagentInputEvent = 1; } @@ -1609,7 +1609,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already x.u.u.detail = i * 8 + k; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); - if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) + if (!nxagentOption(ViewOnly) && nxagentOption(Shadow)) { XEvent xM = {0}; xM.type = KeyRelease; @@ -1724,7 +1724,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already nxagentScreenTrap = False; } - if (nxagentOption(Fullscreen) == 1 && + if (nxagentOption(Fullscreen) && X.xcrossing.window == nxagentFullscreenWindow && X.xcrossing.detail != NotifyInferior) { @@ -1851,7 +1851,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already { int value = X.xvisibility.state; - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { TraverseTree(pWin, nxagentChangeVisibilityPrivate, &value); } @@ -1959,7 +1959,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if (nxagentExposeQueue.exposures[nxagentExposeQueue.start].serial != X.xconfigure.x) { #ifdef WARNING - if (nxagentVerbose == 1) + if (nxagentVerbose) { fprintf(stderr, "%s: Requested ConfigureNotify changes didn't take place.\n", __func__); } @@ -2003,13 +2003,13 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already fprintf(stderr, "%s: Going to handle new UnmapNotify event.\n", __func__); #endif - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { WindowPtr pWin; if ((pWin = nxagentRootlessTopLevelWindow(X.xunmap.window)) != NULL || ((pWin = nxagentWindowPtr(X.xunmap.window)) != NULL && - nxagentWindowTopLevel(pWin) == 1)) + nxagentWindowTopLevel(pWin))) { nxagentScreenTrap = True; @@ -2019,8 +2019,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } } - if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 && - nxagentOption(Nested) == 0 && + if (nxagentUseNXTrans == 1 && !nxagentOption(Rootless) && + !nxagentOption(Nested) && X.xmap.window != nxagentIconWindow) { nxagentVisibility = VisibilityFullyObscured; @@ -2034,13 +2034,13 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already fprintf(stderr, "%s: Going to handle new MapNotify event.\n", __func__); #endif - if (nxagentOption(Rootless) == 1) + if (nxagentOption(Rootless)) { WindowPtr pWin; if ((pWin = nxagentRootlessTopLevelWindow(X.xmap.window)) != NULL || ((pWin = nxagentWindowPtr(X.xmap.window)) != NULL && - nxagentWindowTopLevel(pWin) == 1)) + nxagentWindowTopLevel(pWin))) { nxagentScreenTrap = True; @@ -2057,7 +2057,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } } - if (nxagentOption(AllScreens) == 1) + if (nxagentOption(AllScreens)) { if (X.xmap.window == nxagentIconWindow) { @@ -2066,7 +2066,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already } } - if (nxagentOption(Fullscreen) == 1) + if (nxagentOption(Fullscreen)) { nxagentVisibility = VisibilityUnobscured; nxagentVisibilityStop = False; @@ -2185,7 +2185,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if (switchFullscreen) { - if (nxagentOption(AllScreens) == 1 && nxagentOption(Fullscreen) == 1) + if (nxagentOption(AllScreens) && nxagentOption(Fullscreen)) { nxagentSwitchAllScreens(pScreen, 0); } @@ -2197,7 +2197,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already if (switchAllScreens) { - if (nxagentOption(AllScreens) == 0 && nxagentOption(Fullscreen) == 1) + if (!nxagentOption(AllScreens) && nxagentOption(Fullscreen)) { nxagentSwitchFullscreen(pScreen, False); } @@ -2263,7 +2263,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) { - if (nxagentXkbState.Initialized == 0) + if (!nxagentXkbState.Initialized) { if (X -> xkey.keycode == nxagentCapsLockKeycode) { @@ -2741,7 +2741,7 @@ int nxagentHandleXkbKeyboardStateEvent(XEvent *X) nxagentXkbState.Locked); #endif - nxagentXkbState.Initialized = 1; + nxagentXkbState.Initialized = True; if (nxagentXkbState.Caps == 0 && (nxagentXkbState.Locked & CAPSFLAG_IN_EVENT)) @@ -2831,7 +2831,7 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) { XFixesSelectionEvent *xfixesEvent = (XFixesSelectionEvent *) X; - if (nxagentXFixesInfo.Initialized == 0) + if (!nxagentXFixesInfo.Initialized) { #ifdef DEBUG fprintf(stderr, "%s: XFixes not initialized - doing nothing.\n", __func__); @@ -3152,7 +3152,7 @@ int nxagentHandleConfigureNotify(XEvent* X) fprintf(stderr, "%s: DefaultRootWindow(DISPLAY) [0x%lx]\n", __func__, DefaultRootWindow(nxagentDisplay)); #endif - if (nxagentOption(Rootless) == True) + if (nxagentOption(Rootless)) { int sendEventAnyway = 0; @@ -3272,7 +3272,7 @@ int nxagentHandleConfigureNotify(XEvent* X) return 1; } } - else /* (nxagentOption(Rootless) == True) */ + else /* (nxagentOption(Rootless)) */ { /* * Save the position of the agent default window. Don't save the @@ -3291,7 +3291,7 @@ int nxagentHandleConfigureNotify(XEvent* X) if (X -> xconfigure.window == nxagentDefaultWindows[pScreen -> myNum]) { - if (nxagentOption(AllScreens) == 0) + if (!nxagentOption(AllScreens)) { /* * - WITHOUT window manager any position change is relevant @@ -3303,7 +3303,7 @@ int nxagentHandleConfigureNotify(XEvent* X) int newX = X -> xconfigure.x; int newY = X -> xconfigure.y; - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(DesktopResize)) { if (nxagentOption(Width) != X -> xconfigure.width || nxagentOption(Height) != X -> xconfigure.height || @@ -3369,11 +3369,11 @@ int nxagentHandleConfigureNotify(XEvent* X) nxagentChangeOption(Y, newY); } - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1 && + if (nxagentOption(Shadow) && nxagentOption(DesktopResize) && (nxagentOption(Width) != X -> xconfigure.width || nxagentOption(Height) != X -> xconfigure.height)) { - nxagentShadowResize = 1; + nxagentShadowResize = True; } if (nxagentOption(Width) != X->xconfigure.width || nxagentOption(Height) != X->xconfigure.height) @@ -3397,7 +3397,7 @@ int nxagentHandleConfigureNotify(XEvent* X) /* if in shadowing mode or if neither size nor position have changed we do not need to adjust RandR */ /* FIXME: Comment makes no sense */ - if (nxagentOption(Shadow) == 1 || + if (nxagentOption(Shadow) || (nxagentOption(Width) == nxagentOption(RootWidth) && nxagentOption(Height) == nxagentOption(RootHeight) && nxagentOption(X) == nxagentOption(RootX) && @@ -3409,7 +3409,7 @@ int nxagentHandleConfigureNotify(XEvent* X) XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, X -> xconfigure.width, X -> xconfigure.height); - if (nxagentOption(Fullscreen) == 0) + if (!nxagentOption(Fullscreen)) { /* FIXME: has already been done some lines above */ nxagentMoveViewport(pScreen, 0, 0); @@ -3592,7 +3592,7 @@ int nxagentHandleReparentNotify(XEvent* X) return 1; } - else if (nxagentWMIsRunning && nxagentOption(Fullscreen) == 0 && + else if (nxagentWMIsRunning && !nxagentOption(Fullscreen) && nxagentOption(WMBorderWidth) == -1) { /* @@ -4065,7 +4065,7 @@ void nxagentSynchronizeExpose(void) (nxagentExposeQueueHead.remoteRegion), (nxagentExposeQueueHead.localRegion)); - if (RegionNil(nxagentExposeQueueHead.remoteRegion) == 0 && + if (!RegionNil(nxagentExposeQueueHead.remoteRegion) && ((pWin -> eventMask|wOtherEventMasks(pWin)) & ExposureMask)) { #ifdef TEST @@ -4323,7 +4323,7 @@ int nxagentUserInput(void *p) * eventually change the nxagentInputEvent status. */ - if (nxagentOption(Shadow) == 1 && + if (nxagentOption(Shadow) && nxagentPendingEvents(nxagentDisplay) > 0) { nxagentDispatchEvents(NULL); @@ -4342,7 +4342,7 @@ int nxagentUserInput(void *p) * browser's page), in order to update the screen smoothly. */ - if (nxagentOption(Shadow) == 1) + if (nxagentOption(Shadow)) { return result; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.h b/nx-X11/programs/Xserver/hw/nxagent/Events.h index fc00ba1d0..42784a8f3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.h @@ -209,7 +209,7 @@ extern int nxagentInputEvent; * Event-handling utilities. */ -Bool nxagentPendingEvents(Display *dpy); +int nxagentPendingEvents(Display *dpy); #define nxagentQueuedEvents(display) \ XQLength((display)) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index 52c3b0375..9ca7711b2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -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)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index dcbd6949a..c5dcdf4af 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -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 diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 21e888b8a..2aa404910 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -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; } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 5cc29234a..57b7c2b57 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -211,18 +211,18 @@ RegionPtr nxagentBitBlitHelper(GC *pGC) * redirect property. */ -int nxagentWindowIsPopup(DrawablePtr pDrawable) +Bool nxagentWindowIsPopup(DrawablePtr pDrawable) { if (pDrawable -> type != DRAWABLE_WINDOW) { return 0; } - int windowIsPopup = 0; + Bool windowIsPopup = False; if (((WindowPtr) pDrawable) -> overrideRedirect == 1) { - windowIsPopup = 1; + windowIsPopup = True; } else { @@ -244,7 +244,7 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable) if (parent -> overrideRedirect == 1) { - windowIsPopup = 1; + windowIsPopup = True; break; } @@ -254,17 +254,17 @@ int nxagentWindowIsPopup(DrawablePtr pDrawable) #ifdef TEST fprintf(stderr, "nxagentWindowIsPopup: Window [%p] %s to be a popup.\n", (void *) pDrawable, - windowIsPopup == 1 ? "seems" : "does not seem"); + windowIsPopup ? "seems" : "does not seem"); #endif return windowIsPopup; } /* - * This function returns 1 if the XCopyArea request must be skipped. + * This function returns True if the XCopyArea request must be skipped. */ -int nxagentDeferCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, +Bool nxagentDeferCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) { @@ -285,7 +285,7 @@ FIXME: The popup could be synchronized with one single put image, if (nxagentOption(DeferLevel) >= 2 && pSrcDrawable -> type == DRAWABLE_PIXMAP && nxagentPixmapContainTrapezoids((PixmapPtr) pSrcDrawable) == 1 && - nxagentWindowIsPopup(pDstDrawable) == 1) + nxagentWindowIsPopup(pDstDrawable)) { RegionPtr pSrcRegion = nxagentCreateRegion(pSrcDrawable, NULL, srcx, srcy, width, height); @@ -301,7 +301,7 @@ FIXME: The popup could be synchronized with one single put image, RegionIntersect(&corruptedRegion, pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); - if (RegionNil(&corruptedRegion) == 0) + if (!RegionNil(&corruptedRegion)) { #ifdef TEST fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n", @@ -317,7 +317,7 @@ FIXME: The popup could be synchronized with one single put image, if (nxagentDrawableStatus(pSrcDrawable) == Synchronized) { - return 0; + return False; } } @@ -422,17 +422,17 @@ FIXME: The popup could be synchronized with one single put image, * corrupted region. */ - if (RegionNil(pClipRegion) == 0) + if (!RegionNil(pClipRegion)) { nxagentUnmarkCorruptedRegion(pDstDrawable, pClipRegion); } - if (RegionNil(pCorruptedRegion) == 0) + if (!RegionNil(pCorruptedRegion)) { nxagentMarkCorruptedRegion(pDstDrawable, pCorruptedRegion); } - if (RegionNil(pClipRegion) == 0) + if (!RegionNil(pClipRegion)) { Bool pClipRegionFree = True; @@ -509,7 +509,7 @@ FIXME: The popup could be synchronized with one single put image, nxagentChangeClip(targetGC, CT_NONE, NullRegion, 0); - if (pClipRegionFree == True) + if (pClipRegionFree) { nxagentFreeRegion(pClipRegion); } @@ -532,7 +532,7 @@ FIXME: The popup could be synchronized with one single put image, nxagentFreeRegion(pCorruptedRegion); - return 1; + return True; } else { @@ -550,7 +550,7 @@ FIXME: The popup could be synchronized with one single put image, RegionIntersect(&corruptedRegion, pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); - if (RegionNil(&corruptedRegion) == 0) + if (!RegionNil(&corruptedRegion)) { #ifdef TEST fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n", @@ -565,14 +565,14 @@ FIXME: The popup could be synchronized with one single put image, nxagentFreeRegion(pSrcRegion); } - return 0; + return False; } RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty) { - int skip = 0; + Bool skip = False; #ifdef TEST fprintf(stderr, "nxagentCopyArea: Image src [%s:%p], dst [%s:%p] (%d,%d) -> (%d,%d) size (%d,%d)\n", @@ -664,7 +664,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, } - if (nxagentGCTrap == 1 || nxagentShmTrap == 1) + if (nxagentGCTrap || nxagentShmTrap) { if (pSrcDrawable -> type == DRAWABLE_PIXMAP && pDstDrawable -> type == DRAWABLE_PIXMAP) @@ -698,9 +698,9 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * little use. */ - if (nxagentOption(IgnoreVisibility) == 0 && pDstDrawable -> type == DRAWABLE_WINDOW && - (nxagentWindowIsVisible((WindowPtr) pDstDrawable) == 0 || - (nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) + if (!nxagentOption(IgnoreVisibility) && pDstDrawable -> type == DRAWABLE_WINDOW && + (!nxagentWindowIsVisible((WindowPtr) pDstDrawable) || + (!nxagentDefaultWindowIsVisible() && nxagentCompositeEnable == 0))) { #ifdef TEST fprintf(stderr, "nxagentCopyArea: Prevented operation on fully obscured window at [%p].\n", @@ -761,7 +761,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * can skip the copy area operation. */ - skip = 1; + skip = True; } #ifdef TEST @@ -771,7 +771,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, (void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height); #endif - if (skip == 0 && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) + if (!skip && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) { skip = nxagentDeferCopyArea(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty); @@ -784,7 +784,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, } #endif - if (skip == 0) + if (!skip) { XCopyArea(nxagentDisplay, nxagentDrawable(pSrcDrawable), nxagentDrawable(pDstDrawable), nxagentGC(pGC), srcx, srcy, width, height, dstx, dsty); @@ -881,7 +881,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty, unsigned long plane) { - int skip = 0; + Bool skip = False; #ifdef TEST fprintf(stderr, "nxagentCopyPlane: Image src [%s:%p], dst [%s:%p] (%d,%d) -> (%d,%d) size (%d,%d)\n", @@ -890,7 +890,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, (void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height); #endif - if (nxagentGCTrap == 1 || nxagentShmTrap == 1) + if (nxagentGCTrap || nxagentShmTrap) { if (pSrcDrawable -> type == DRAWABLE_PIXMAP && pDstDrawable -> type == DRAWABLE_PIXMAP) @@ -969,10 +969,10 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * can skip the copy plane operation. */ - skip = 1; + skip = True; } - if (skip == 0 && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) + if (!skip && nxagentDrawableStatus(pSrcDrawable) == NotSynchronized) { if (pDstDrawable -> type == DRAWABLE_PIXMAP && nxagentOption(DeferLevel) > 0) @@ -983,7 +983,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, nxagentFreeRegion(pDstRegion); - skip = 1; + skip = True; } else { @@ -996,7 +996,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, RegionIntersect(&corruptedRegion, pSrcRegion, nxagentCorruptedRegion(pSrcDrawable)); - if (RegionNil(&corruptedRegion) == 0) + if (!RegionNil(&corruptedRegion)) { #ifdef TEST fprintf(stderr, "nxagentCopyPlane: Forcing the synchronization of source drawable at [%p].\n", @@ -1025,7 +1025,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, } #endif - if (skip == 0) + if (!skip) { XCopyPlane(nxagentDisplay, nxagentDrawable(pSrcDrawable), nxagentDrawable(pDstDrawable), @@ -1073,7 +1073,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, (void *) pDrawable, (void *) pGC, nPoints); #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1130,7 +1130,7 @@ void nxagentPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, void nxagentPolyLines(DrawablePtr pDrawable, GCPtr pGC, int mode, int nPoints, xPoint *pPoints) { - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1203,7 +1203,7 @@ void nxagentPolySegment(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1280,7 +1280,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1345,7 +1345,7 @@ void nxagentPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, void nxagentPolyArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs) { - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1404,7 +1404,7 @@ void nxagentFillPolygon(DrawablePtr pDrawable, GCPtr pGC, int shape, { xPoint *newPoints = NULL; - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1518,7 +1518,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, #endif - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1540,7 +1540,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, * will be cleared. */ - int inheritCorruptedRegion = 0; + Bool inheritCorruptedRegion = False; if (pGC -> fillStyle == FillTiled && pGC -> tileIsPixel == 0 && pGC -> tile.pixmap != NULL) @@ -1556,11 +1556,11 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, #endif - inheritCorruptedRegion = 1; + inheritCorruptedRegion = True; } } - if (inheritCorruptedRegion == 1 || nxagentDrawableStatus(pDrawable) == NotSynchronized) + if (inheritCorruptedRegion || nxagentDrawableStatus(pDrawable) == NotSynchronized) { RegionPtr rectRegion = RegionFromRects(nRectangles, pRectangles, CT_REGION); @@ -1582,7 +1582,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, RegionUninit(&tmpRegion); } - if (inheritCorruptedRegion == 1) + if (inheritCorruptedRegion) { /* * The fill style should affect the corrupted region @@ -1663,7 +1663,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, void nxagentPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int nArcs, xArc *pArcs) { - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1739,7 +1739,7 @@ int nxagentPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int width = XTextWidth(nxagentFontStruct(pGC->font), string, count); - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1809,7 +1809,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, int width = XTextWidth16(nxagentFontStruct(pGC->font), (XChar2b *)string, count); - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1868,7 +1868,7 @@ int nxagentPolyText16(DrawablePtr pDrawable, GCPtr pGC, int x, void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, char *string) { - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { @@ -1925,7 +1925,7 @@ void nxagentImageText8(DrawablePtr pDrawable, GCPtr pGC, int x, void nxagentImageText16(DrawablePtr pDrawable, GCPtr pGC, int x, int y, int count, unsigned short *string) { - if (nxagentGCTrap == 1) + if (nxagentGCTrap) { if ((pDrawable)->type == DRAWABLE_PIXMAP) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 62974b9c1..d00b13d77 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -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; } /* diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.h b/nx-X11/programs/Xserver/hw/nxagent/Handlers.h index ddae097da..0d019cc22 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.h @@ -37,7 +37,7 @@ extern int nxagentBuffer; * the display to become writable. */ -extern int nxagentBlocking; +extern Bool nxagentBlocking; /* * Current congestion level based on diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index db174a9de..8c828df20 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -403,7 +403,7 @@ FIXME: Here the split trap is always set and so the caching of the resource, nxagentSplitTrap); #endif - if (nxagentSplitTrap == 1 || nxagentUnpackAlpha[resource] == NULL || + if (nxagentSplitTrap || nxagentUnpackAlpha[resource] == NULL || nxagentUnpackAlpha[resource] -> size != size || memcmp(nxagentUnpackAlpha[resource] -> data, data, size) != 0) { @@ -473,8 +473,8 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, RegionPtr pRegion = NullRegion; int resource = 0; - int split = 0; - int cache = 1; + Bool split = False; + Bool cache = True; #ifdef TEST fprintf(stderr, "nxagentPutImage: Image data at [%p] drawable [%s][%p] geometry [%d,%d,%d,%d].\n", @@ -524,9 +524,9 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, * window. */ - if (nxagentOption(IgnoreVisibility) == 0 && pDrawable -> type == DRAWABLE_WINDOW && - (nxagentWindowIsVisible((WindowPtr) pDrawable) == 0 || - (nxagentDefaultWindowIsVisible() == 0 && nxagentCompositeEnable == 0))) + if (!nxagentOption(IgnoreVisibility) && pDrawable -> type == DRAWABLE_WINDOW && + (!nxagentWindowIsVisible((WindowPtr) pDrawable) || + (!nxagentDefaultWindowIsVisible() && nxagentCompositeEnable == 0))) { #ifdef TEST @@ -544,7 +544,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth, pRegion = nxagentCreateRegion(pDrawable, pGC, dstX, dstY, dstWidth, dstHeight); - if (RegionNil(pRegion) == 1) + if (RegionNil(pRegion)) { #ifdef TEST fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on fully clipped " @@ -562,8 +562,8 @@ FIXME: Should use these. int framebuffer = 1; int realize = 1; */ - if (nxagentGCTrap == 1 && nxagentReconnectTrap == 0 && - nxagentFBTrap == 0 && nxagentShmTrap == 0) + if (nxagentGCTrap && !nxagentReconnectTrap && + !nxagentFBTrap && !nxagentShmTrap) { if (pDrawable -> type == DRAWABLE_PIXMAP) { @@ -579,11 +579,11 @@ FIXME: Should use these. goto nxagentPutImageEnd; } - if (nxagentReconnectTrap == 0 && - nxagentSplitTrap == 0) + if (!nxagentReconnectTrap && + !nxagentSplitTrap) { if (pDrawable -> type == DRAWABLE_PIXMAP && - nxagentFBTrap == 0 && nxagentShmTrap == 0) + !nxagentFBTrap && !nxagentShmTrap) { fbPutImage(nxagentVirtualDrawable(pDrawable), pGC, depth, dstX, dstY, dstWidth, dstHeight, leftPad, format, data); @@ -667,11 +667,11 @@ FIXME: Should use these. /* FIXME: Should we disable the split with link LAN? - split = (nxagentOption(Streaming) == 1 && + split = (nxagentOption(Streaming) && nxagentOption(LinkType) != LINK_TYPE_NONE && nxagentOption(LinkType) != LINK_TYPE_LAN */ - split = (nxagentOption(Streaming) == 1 && + split = (nxagentOption(Streaming) && nxagentOption(LinkType) != LINK_TYPE_NONE /* FIXME: Do we stream the images from GLX or Xv? If we do that, we @@ -683,8 +683,8 @@ FIXME: Do we stream the images from GLX or Xv? If we do that, we /* FIXME: Temporarily stream the GLX data. - && nxagentGlxTrap == 0 - && nxagentXvTrap == 0 + && !nxagentGlxTrap + && !nxagentXvTrap */ ); @@ -692,21 +692,21 @@ FIXME: Temporarily stream the GLX data. * Never split images whose depth is less than 15. */ - if (split == 1 && (nxagentSplitTrap == 1 || depth < 15)) + if (split && (nxagentSplitTrap || depth < 15)) { #ifdef TEST - if (nxagentSplitTrap == 1 || - nxagentReconnectTrap == 1) + if (nxagentSplitTrap || + nxagentReconnectTrap) { fprintf(stderr, "nxagentPutImage: Not splitting with reconnection [%d] trap [%d] " "depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth); } #endif - split = 0; + split = False; } #ifdef TEST - else if (split == 1) + else if (split) { fprintf(stderr, "nxagentPutImage: Splitting with reconnection [%d] trap [%d] " "depth [%d].\n", nxagentSplitTrap, nxagentReconnectTrap, depth); @@ -714,7 +714,7 @@ FIXME: Temporarily stream the GLX data. #endif #ifdef TEST - if (split == 1) + if (split) { fprintf(stderr, "nxagentPutImage: Splitting the image with size [%d] " "link [%d] GLX [%d] Xv [%d].\n", length, nxagentOption(LinkType), @@ -734,7 +734,7 @@ FIXME: Temporarily stream the GLX data. */ if (nxagentOption(LinkType) != LINK_TYPE_NONE && - (nxagentGlxTrap == 1 || nxagentXvTrap == 1)) + (nxagentGlxTrap || nxagentXvTrap)) { #ifdef TEST fprintf(stderr, "nxagentPutImage: Disabling the use of the cache with GLX or Xvideo.\n"); @@ -742,7 +742,7 @@ FIXME: Temporarily stream the GLX data. NXSetCacheParameters(nxagentDisplay, 0, 1, 0, 0); - cache = 0; + cache = False; } /* @@ -750,7 +750,7 @@ FIXME: Temporarily stream the GLX data. * tell us if the split took place. */ - if (split == 1) + if (split) { /* * If the drawable is already being split, expand the @@ -793,7 +793,7 @@ FIXME: Should probably intersect the region with the region being nxagentRealizeImage(pDrawable, pGC, depth, dstX, dstY, dstWidth, dstHeight, leftPad, format, data); - if (split == 1) + if (split) { NXEndSplit(nxagentDisplay, resource); @@ -807,7 +807,7 @@ FIXME: Should probably intersect the region with the region being split = nxagentWaitSplitEvent(resource); - if (split == 1) + if (split) { #ifdef TEST fprintf(stderr, "nxagentPutImage: Marking corrupted region [%d,%d,%d,%d] for drawable at [%p].\n", @@ -838,7 +838,7 @@ FIXME: Should probably intersect the region with the region being * above, so here we have to check the value again. */ - if (split == 0) + if (!split) { if (nxagentDrawableStatus(pDrawable) == NotSynchronized) { @@ -863,7 +863,7 @@ nxagentPutImageEnd: * Check if we disabled caching. */ - if (cache == 0) + if (!cache) { #ifdef TEST fprintf(stderr, "nxagentPutImage: Reenabling the use of the cache.\n"); @@ -925,7 +925,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, int bytesPerLine = nxagentImagePad(w, format, leftPad, depth); - if (nxagentOption(Shadow) == 1 && format == ZPixmap && + if (nxagentOption(Shadow) && format == ZPixmap && (nxagentOption(XRatio) != DONT_SCALE || nxagentOption(YRatio) != DONT_SCALE) && pDrawable == (DrawablePtr) nxagentShadowPixmapPtr) @@ -987,7 +987,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, clipRegion = nxagentCreateRegion(pDrawable, pGC, x, y, w, h); } - if (clipRegion == NullRegion || RegionNil(clipRegion) == 0) + if (clipRegion == NullRegion || !RegionNil(clipRegion)) { nxagentPutSubImage(pDrawable, pGC, depth, x, y, w, h, leftPad, format, data, pVisual); @@ -1041,9 +1041,9 @@ void nxagentPutSubImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ClientPtr client; - int lossless = 0; - int clean = 0; - int pack = 0; + Bool lossless = False; + Bool clean = False; + Bool pack = False; /* * XCreateImage is the place where the leftPad should be passed. @@ -1136,7 +1136,7 @@ FIXME: Should use an unpack resource here. lossless = (packMethod == nxagentPackLossless); - if (pack == 1 && lossless == 0) + if (pack && !lossless) { /* * Force the image to be sent as a plain bitmap if we don't have @@ -1145,7 +1145,7 @@ FIXME: Should use an unpack resource here. if (w <= IMAGE_PACK_WIDTH || h <= IMAGE_PACK_HEIGHT || nxagentImageLength(w, h, format, leftPad, depth) <= - IMAGE_PACK_LENGTH || nxagentLosslessTrap == 1) + IMAGE_PACK_LENGTH || nxagentLosslessTrap) { if (nxagentPackLossless == PACK_NONE) { @@ -1155,7 +1155,7 @@ FIXME: Should use an unpack resource here. nxagentImageLength(w, h, format, leftPad, depth)); #endif - pack = 0; + pack = False; } else { @@ -1167,7 +1167,7 @@ FIXME: Should use an unpack resource here. packMethod = nxagentPackLossless; - lossless = 1; + lossless = True; } } } @@ -1176,7 +1176,7 @@ FIXME: Should use an unpack resource here. * Do we still want to pack the image? */ - if (pack == 1) + if (pack) { /* * Set the geometry and alpha channel to be used for the unpacked @@ -1219,8 +1219,8 @@ FIXME: Should try to locate the image anyway, if the lossless trap is method. */ if (nxagentNeedCache(plainImage, packMethod) && - nxagentGlxTrap == 0 && nxagentXvTrap == 0 && - nxagentLosslessTrap == 0 && NXImageCacheSize > 0) + !nxagentGlxTrap && !nxagentXvTrap && + !nxagentLosslessTrap && NXImageCacheSize > 0) { /* * Be sure that the padding bits are cleaned before calculating @@ -1234,7 +1234,7 @@ FIXME: There should be a callback registered by the agent that etc. This statistics report would be included by the proxy in its stat output. */ - clean = 1; + clean = True; NXCleanImage(plainImage); @@ -1284,7 +1284,7 @@ FIXME: There should be a callback registered by the agent that * lossless encoder will compress better. */ - if (lossless == 0 && nxagentOption(Adaptive) == 1) + if (!lossless && nxagentOption(Adaptive)) { int ratio = nxagentUniquePixels(plainImage); @@ -1297,7 +1297,7 @@ FIXME: There should be a callback registered by the agent that packMethod = nxagentPackLossless; - lossless = 1; + lossless = True; } #ifdef TEST else @@ -1324,11 +1324,11 @@ FIXME: There should be a callback registered by the agent that * bitwise the same regardless the padding bits. */ - if (clean == 0) + if (!clean) { if (nxagentNeedClean(plainImage, packMethod) == 1) { - clean = 1; + clean = True; NXCleanImage(plainImage); } @@ -1448,12 +1448,12 @@ FIXME: If we failed to encode the image by any of the available was sent in the unpack alpha message. This can be done here, if the clean flag is true and we are going to send a plain image. */ - if (clean == 0) + if (!clean) { clean = (nxagentOption(LinkType) != LINK_TYPE_NONE && nxagentOption(LinkType) != LINK_TYPE_LAN && depth != 32); - if (clean == 1) + if (clean) { #ifdef DEBUG fprintf(stderr, "nxagentPutSubImage: Cleaning the image with link type [%d] and depth [%d].\n", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index b06d8e239..d760b0c6a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -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); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 14d811877..00db6ce2a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -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; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h index dbfb47733..504c99869 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h @@ -68,8 +68,7 @@ typedef struct _XkbAgentState int Caps; int Num; int Focus; - int Initialized; - + Bool Initialized; } XkbAgentStateRec; extern XkbAgentStateRec nxagentXkbState; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index d6c659fec..9a7c1cd65 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -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: diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index f91dc248d..12a44dbe0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -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(); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index ff50c9965..84414c11f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -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); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 11e66720f..97665d22e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -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]); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index bcb64edcd..5851eb05c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -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"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c index e72a37494..90d0e5f10 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXshm.c @@ -96,7 +96,7 @@ ShmExtensionInit(void) #endif #ifdef NXAGENT_SERVER - if (nxagentOption(SharedMemory) == False) + if (!nxagentOption(SharedMemory)) { return; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index a8d1849ae..d339a12d5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -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); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index 0da504f06..afc6899e3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -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; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.h b/nx-X11/programs/Xserver/hw/nxagent/Options.h index e56860f04..a99f4aee2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h @@ -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; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index 316d147ac..cf5e50c04 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -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 diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c index 13ac47d00..30e5d1e3f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -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", diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c index b5d47623a..1191049ad 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c @@ -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__); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 602351d10..d0f83e7bd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -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); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index f38319858..28e2d77fc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -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; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 148f9e1dd..077457f0e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -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)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.h b/nx-X11/programs/Xserver/hw/nxagent/Screen.h index 3eb16ea3c..53df72df2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.h @@ -67,7 +67,7 @@ extern RegionRec nxagentShadowUpdateRegion; extern WindowPtr nxagentShadowWindowPtr; -extern int nxagentShadowResize; +extern Bool nxagentShadowResize; extern short nxagentShadowUid; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.c b/nx-X11/programs/Xserver/hw/nxagent/Split.c index 850056c21..2e2b130fe 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Split.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Split.c @@ -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), diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 2dea31af0..fcff4c6d0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -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. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h b/nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h index 086ea9082..946b856bc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Xdmcp.h @@ -36,6 +36,6 @@ extern xdmcp_states XdmcpState; extern int XdmcpTimeOutRtx; extern int XdmcpStartTime; -extern int nxagentXdmcpUp; +extern Bool nxagentXdmcpUp; #endif /* __Xdmcp_H__ */ |