aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-09-05 23:40:03 +0200
committerUlrich Sibiller <uli42@gmx.de>2020-01-05 22:37:36 +0100
commite72e2375ffcb7625d2c322d4d58965d06a630c8e (patch)
treec009c2d7c9284e28d717c3aeb416cccf76486762
parent129c8621fd3f6f1ef2190f0a17c7eb6fef53a603 (diff)
downloadnx-libs-e72e2375ffcb7625d2c322d4d58965d06a630c8e.tar.gz
nx-libs-e72e2375ffcb7625d2c322d4d58965d06a630c8e.tar.bz2
nx-libs-e72e2375ffcb7625d2c322d4d58965d06a630c8e.zip
Cursor.c: scope improvements
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Cursor.c55
1 files changed, 24 insertions, 31 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c
index 34672fef5..5346efd90 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c
@@ -93,11 +93,8 @@ extern CursorPtr GetSpriteCursor(void);
void nxagentConstrainCursor(ScreenPtr pScreen, BoxPtr pBox)
{
#ifdef TEST
-
- int width, height;
-
- width = nxagentOption(RootWidth);
- height = nxagentOption(RootHeight);
+ int width = nxagentOption(RootWidth);
+ int height = nxagentOption(RootHeight);
if (pBox->x1 <= 0 && pBox->y1 <= 0 &&
pBox->x2 >= width && pBox->y2 >= height)
@@ -150,18 +147,14 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
fprintf(stderr, "nxagentRealizeCursor: Called for cursor at [%p].\n", (void *) pCursor);
#endif
- unsigned long valuemask = GCFunction |
- GCPlaneMask |
- GCForeground |
- GCBackground |
- GCClipMask;
+ unsigned long valuemask = GCFunction | GCPlaneMask | GCForeground | GCBackground | GCClipMask;
XGCValues values = {
- .function = GXcopy,
- .plane_mask = AllPlanes,
- .foreground = 1L,
- .background = 0L,
- .clip_mask = None
+ .function = GXcopy,
+ .plane_mask = AllPlanes,
+ .foreground = 1L,
+ .background = 0L,
+ .clip_mask = None,
};
XChangeGC(nxagentDisplay, nxagentBitmapGC, valuemask, &values);
@@ -221,15 +214,15 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
SAFE_XFree(image);
XColor fg_color = {
- .red = pCursor->foreRed,
- .green = pCursor->foreGreen,
- .blue = pCursor->foreBlue
+ .red = pCursor->foreRed,
+ .green = pCursor->foreGreen,
+ .blue = pCursor->foreBlue,
};
XColor bg_color = {
- .red = pCursor->backRed,
- .green = pCursor->backGreen,
- .blue = pCursor->backBlue
+ .red = pCursor->backRed,
+ .green = pCursor->backGreen,
+ .blue = pCursor->backBlue,
};
pCursor->devPriv[pScreen->myNum] = (void *) malloc(sizeof(nxagentPrivCursor));
@@ -275,15 +268,15 @@ void nxagentRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor,
Bool displayed)
{
XColor fg_color = {
- .red = pCursor->foreRed,
- .green = pCursor->foreGreen,
- .blue = pCursor->foreBlue
+ .red = pCursor->foreRed,
+ .green = pCursor->foreGreen,
+ .blue = pCursor->foreBlue,
};
XColor bg_color = {
- .red = pCursor->backRed,
- .green = pCursor->backGreen,
- .blue = pCursor->backBlue
+ .red = pCursor->backRed,
+ .green = pCursor->backGreen,
+ .blue = pCursor->backBlue,
};
XRecolorCursor(nxagentDisplay,
@@ -404,7 +397,7 @@ Bool nxagentReconnectAllCursor(void *p0)
fprintf(stderr, "nxagentReconnectAllCursor\n");
#endif
- for (int i = 0, r = 1; i < MAXCLIENTS; r = 1, i++)
+ for (int i = 0; i < MAXCLIENTS; r = 1, i++)
{
if (clients[i])
{
@@ -514,7 +507,7 @@ Bool nxagentDisconnectAllCursor(void)
fprintf(stderr, "nxagentDisconnectAllCursor: Going to iterate through cursor resources.\n");
#endif
- for (int i = 0, r = 1; i < MAXCLIENTS; r = 1, i++)
+ for (int i = 0; i < MAXCLIENTS; r = 1, i++)
{
if (clients[i])
{
@@ -558,9 +551,9 @@ void nxagentListCursor(void *p0, void *p1, void *p2)
void nxagentListCursors(void)
{
- Bool r;
+ Bool r = True;
- for (int i = 0, r = 1; i < MAXCLIENTS; r = 1, i++)
+ for (int i = 0; i < MAXCLIENTS; r = 1, i++)
{
if (clients[i])
{