Commit e72e2375 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Cursor.c: scope improvements

parent 129c8621
...@@ -93,11 +93,8 @@ extern CursorPtr GetSpriteCursor(void); ...@@ -93,11 +93,8 @@ extern CursorPtr GetSpriteCursor(void);
void nxagentConstrainCursor(ScreenPtr pScreen, BoxPtr pBox) void nxagentConstrainCursor(ScreenPtr pScreen, BoxPtr pBox)
{ {
#ifdef TEST #ifdef TEST
int width = nxagentOption(RootWidth);
int width, height; int height = nxagentOption(RootHeight);
width = nxagentOption(RootWidth);
height = nxagentOption(RootHeight);
if (pBox->x1 <= 0 && pBox->y1 <= 0 && if (pBox->x1 <= 0 && pBox->y1 <= 0 &&
pBox->x2 >= width && pBox->y2 >= height) pBox->x2 >= width && pBox->y2 >= height)
...@@ -150,18 +147,14 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) ...@@ -150,18 +147,14 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
fprintf(stderr, "nxagentRealizeCursor: Called for cursor at [%p].\n", (void *) pCursor); fprintf(stderr, "nxagentRealizeCursor: Called for cursor at [%p].\n", (void *) pCursor);
#endif #endif
unsigned long valuemask = GCFunction | unsigned long valuemask = GCFunction | GCPlaneMask | GCForeground | GCBackground | GCClipMask;
GCPlaneMask |
GCForeground |
GCBackground |
GCClipMask;
XGCValues values = { XGCValues values = {
.function = GXcopy, .function = GXcopy,
.plane_mask = AllPlanes, .plane_mask = AllPlanes,
.foreground = 1L, .foreground = 1L,
.background = 0L, .background = 0L,
.clip_mask = None .clip_mask = None,
}; };
XChangeGC(nxagentDisplay, nxagentBitmapGC, valuemask, &values); XChangeGC(nxagentDisplay, nxagentBitmapGC, valuemask, &values);
...@@ -221,15 +214,15 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) ...@@ -221,15 +214,15 @@ Bool nxagentRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor)
SAFE_XFree(image); SAFE_XFree(image);
XColor fg_color = { XColor fg_color = {
.red = pCursor->foreRed, .red = pCursor->foreRed,
.green = pCursor->foreGreen, .green = pCursor->foreGreen,
.blue = pCursor->foreBlue .blue = pCursor->foreBlue,
}; };
XColor bg_color = { XColor bg_color = {
.red = pCursor->backRed, .red = pCursor->backRed,
.green = pCursor->backGreen, .green = pCursor->backGreen,
.blue = pCursor->backBlue .blue = pCursor->backBlue,
}; };
pCursor->devPriv[pScreen->myNum] = (void *) malloc(sizeof(nxagentPrivCursor)); pCursor->devPriv[pScreen->myNum] = (void *) malloc(sizeof(nxagentPrivCursor));
...@@ -275,15 +268,15 @@ void nxagentRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, ...@@ -275,15 +268,15 @@ void nxagentRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor,
Bool displayed) Bool displayed)
{ {
XColor fg_color = { XColor fg_color = {
.red = pCursor->foreRed, .red = pCursor->foreRed,
.green = pCursor->foreGreen, .green = pCursor->foreGreen,
.blue = pCursor->foreBlue .blue = pCursor->foreBlue,
}; };
XColor bg_color = { XColor bg_color = {
.red = pCursor->backRed, .red = pCursor->backRed,
.green = pCursor->backGreen, .green = pCursor->backGreen,
.blue = pCursor->backBlue .blue = pCursor->backBlue,
}; };
XRecolorCursor(nxagentDisplay, XRecolorCursor(nxagentDisplay,
...@@ -404,7 +397,7 @@ Bool nxagentReconnectAllCursor(void *p0) ...@@ -404,7 +397,7 @@ Bool nxagentReconnectAllCursor(void *p0)
fprintf(stderr, "nxagentReconnectAllCursor\n"); fprintf(stderr, "nxagentReconnectAllCursor\n");
#endif #endif
for (int i = 0, r = 1; i < MAXCLIENTS; r = 1, i++) for (int i = 0; i < MAXCLIENTS; r = 1, i++)
{ {
if (clients[i]) if (clients[i])
{ {
...@@ -514,7 +507,7 @@ Bool nxagentDisconnectAllCursor(void) ...@@ -514,7 +507,7 @@ Bool nxagentDisconnectAllCursor(void)
fprintf(stderr, "nxagentDisconnectAllCursor: Going to iterate through cursor resources.\n"); fprintf(stderr, "nxagentDisconnectAllCursor: Going to iterate through cursor resources.\n");
#endif #endif
for (int i = 0, r = 1; i < MAXCLIENTS; r = 1, i++) for (int i = 0; i < MAXCLIENTS; r = 1, i++)
{ {
if (clients[i]) if (clients[i])
{ {
...@@ -558,9 +551,9 @@ void nxagentListCursor(void *p0, void *p1, void *p2) ...@@ -558,9 +551,9 @@ void nxagentListCursor(void *p0, void *p1, void *p2)
void nxagentListCursors(void) 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]) if (clients[i])
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment