diff --git a/dix/resource.c b/dix/resource.c index 6bd240368..26d2c72aa 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -167,7 +167,6 @@ typedef struct _Resource { RESTYPE type; pointer value; } ResourceRec, *ResourcePtr; -#define NullResource ((ResourcePtr)NULL) typedef struct _ClientResource { ResourcePtr *resources; @@ -176,7 +175,6 @@ typedef struct _ClientResource { int hashsize; /* log(2)(buckets) */ XID fakeID; XID endFakeID; - XID expectID; } ClientResourceRec; RESTYPE lastResourceType; @@ -323,10 +321,9 @@ InitClientResources(ClientPtr client) clientTable[i].fakeID = client->clientAsMask | (client->index ? SERVER_BIT : SERVER_MINID); clientTable[i].endFakeID = (clientTable[i].fakeID | RESOURCE_ID_MASK) + 1; - clientTable[i].expectID = client->clientAsMask; for (j=0; jvalue = value; *head = res; rrec->elements++; - if (!(id & SERVER_BIT) && (id >= rrec->expectID)) - rrec->expectID = id + 1; CallResourceStateCallback(ResourceStateAdding, res); return TRUE; } @@ -543,7 +538,7 @@ RebuildTable(int client) } for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++) { - *rptr = NullResource; + *rptr = NULL; *tptr = rptr; } clientTable[client].hashsize++; @@ -555,7 +550,7 @@ RebuildTable(int client) for (res = *rptr; res; res = next) { next = res->next; - res->next = NullResource; + res->next = NULL; tptr = &tails[Hash(client, res->id)]; **tptr = res; *tptr = &res->next; @@ -886,24 +881,21 @@ LegalNewID(XID id, ClientPtr client) #ifdef PANORAMIX XID minid, maxid; - if (!noPanoramiXExtension) { - minid = client->clientAsMask | (client->index ? - SERVER_BIT : SERVER_MINID); - maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1; - if ((id >= minid) && (id <= maxid)) - return TRUE; - } + if (!noPanoramiXExtension) { + minid = client->clientAsMask | (client->index ? + SERVER_BIT : SERVER_MINID); + maxid = (clientTable[client->index].fakeID | RESOURCE_ID_MASK) + 1; + if ((id >= minid) && (id <= maxid)) + return TRUE; + } #endif /* PANORAMIX */ - if (client->clientAsMask == (id & ~RESOURCE_ID_MASK)) - { - if (clientTable[client->index].expectID <= id) - return TRUE; - - rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient, - DixGetAttrAccess); - return rc == BadValue; - } - return FALSE; + if (client->clientAsMask == (id & ~RESOURCE_ID_MASK)) + { + rc = dixLookupResourceByClass(&val, id, RC_ANY, serverClient, + DixGetAttrAccess); + return rc == BadValue; + } + return FALSE; } int diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c index 033b52512..c67077aec 100644 --- a/hw/dmx/config/xdmxconfig.c +++ b/hw/dmx/config/xdmxconfig.c @@ -142,7 +142,7 @@ static void dmxConfigGetDims(int *maxWidth, int *maxHeight) DMXConfigEntryPtr e; *maxWidth = dmxConfigWallWidth = 0; - *maxWidth = dmxConfigWallHeight = 0; + *maxHeight = dmxConfigWallHeight = 0; if (!dmxConfigCurrent) return; dmxConfigWallWidth = dmxConfigCurrent->width; diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c index 45cb3db93..bd326ce2a 100644 --- a/hw/dmx/dmxextension.c +++ b/hw/dmx/dmxextension.c @@ -855,7 +855,7 @@ static void dmxBERestorePixmap(PixmapPtr pPixmap) static void dmxBECreateResources(pointer value, XID id, RESTYPE type, pointer n) { - int scrnNum = (int)n; + int scrnNum = (uintptr_t)n; ScreenPtr pScreen = screenInfo.screens[scrnNum]; if ((type & TypeMask) == (RT_WINDOW & TypeMask)) { @@ -1059,7 +1059,7 @@ static void dmxBERestoreRenderPict(pointer value, XID id, pointer n) { PicturePtr pPicture = value; /* The picture */ DrawablePtr pDraw = pPicture->pDrawable; /* The picture's drawable */ - int scrnNum = (int)n; + int scrnNum = (uintptr_t)n; if (pDraw->pScreen->myNum != scrnNum) { /* Picture not on the screen we are restoring*/ @@ -1081,7 +1081,7 @@ static void dmxBERestoreRenderPict(pointer value, XID id, pointer n) static void dmxBERestoreRenderGlyph(pointer value, XID id, pointer n) { GlyphSetPtr glyphSet = value; - int scrnNum = (int)n; + int scrnNum = (uintptr_t)n; dmxGlyphPrivPtr glyphPriv = DMX_GET_GLYPH_PRIV(glyphSet); DMXScreenInfo *dmxScreen = &dmxScreens[scrnNum]; GlyphRefPtr table; @@ -1274,7 +1274,7 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr) for (i = currentMaxClients; --i >= 0; ) if (clients[i]) FindAllClientResources(clients[i], dmxBECreateResources, - (pointer)idx); + (pointer)(uintptr_t)idx); /* Create window hierarchy (top down) */ dmxBECreateWindowTree(idx); @@ -1283,13 +1283,15 @@ int dmxAttachScreen(int idx, DMXScreenAttributesPtr attr) for (i = currentMaxClients; --i >= 0; ) if (clients[i]) FindClientResourcesByType(clients[i],PictureType, - dmxBERestoreRenderPict,(pointer)idx); + dmxBERestoreRenderPict, + (pointer)(uintptr_t)idx); /* Restore the glyph state for RENDER */ for (i = currentMaxClients; --i >= 0; ) if (clients[i]) FindClientResourcesByType(clients[i],GlyphSetType, - dmxBERestoreRenderGlyph,(pointer)idx); + dmxBERestoreRenderGlyph, + (pointer)(uintptr_t)idx); /* Refresh screen by generating exposure events for all windows */ dmxForceExposures(idx); @@ -1453,7 +1455,7 @@ static void dmxBESavePixmap(PixmapPtr pPixmap) static void dmxBEDestroyResources(pointer value, XID id, RESTYPE type, pointer n) { - int scrnNum = (int)n; + int scrnNum = (uintptr_t)n; ScreenPtr pScreen = screenInfo.screens[scrnNum]; if ((type & TypeMask) == (RT_WINDOW & TypeMask)) { @@ -1596,7 +1598,7 @@ int dmxDetachScreen(int idx) for (i = currentMaxClients; --i >= 0; ) if (clients[i]) FindAllClientResources(clients[i], dmxBEDestroyResources, - (pointer)idx); + (pointer)(uintptr_t)idx); /* Free scratch GCs */ dmxBEDestroyScratchGCs(idx); diff --git a/hw/dmx/dmxgc.c b/hw/dmx/dmxgc.c index 829200e6a..f10f9a074 100644 --- a/hw/dmx/dmxgc.c +++ b/hw/dmx/dmxgc.c @@ -383,12 +383,7 @@ void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) break; case CT_PIXMAP: - case CT_UNSORTED: - case CT_YSORTED: - case CT_YXSORTED: - case CT_YXBANDED: - /* These clip types are condensed down to either NONE or REGION - in the mi code */ + /* Condensed down to REGION in the mi code */ break; } diff --git a/hw/dmx/input/dmxinputinit.c b/hw/dmx/input/dmxinputinit.c index 7cac86f79..5cbd620c9 100644 --- a/hw/dmx/input/dmxinputinit.c +++ b/hw/dmx/input/dmxinputinit.c @@ -132,14 +132,6 @@ static DMXLocalInputInfoRec DMXConsoleKbd = { NULL, dmxCommonKbdCtrl, dmxCommonKbdBell }; -static DMXLocalInputInfoRec DMXCommonOth = { - "common-oth", DMX_LOCAL_OTHER, DMX_LOCAL_TYPE_COMMON, 1, - dmxCommonCopyPrivate, NULL, - NULL, NULL, NULL, dmxCommonOthGetInfo, - dmxCommonOthOn, dmxCommonOthOff -}; - - static DMXLocalInputInfoRec DMXLocalDevices[] = { /* Dummy drivers that can compile on any OS */ #ifdef __linux__ @@ -615,7 +607,7 @@ static void dmxCollectAll(DMXInputInfo *dmxInput) static void dmxBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadMask) { - DMXInputInfo *dmxInput = &dmxInputs[(int)blockData]; + DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t)blockData]; static unsigned long generation = 0; if (generation != serverGeneration) { @@ -642,7 +634,7 @@ static void dmxSwitchReturn(pointer p) static void dmxWakeupHandler(pointer blockData, int result, pointer pReadMask) { - DMXInputInfo *dmxInput = &dmxInputs[(int)blockData]; + DMXInputInfo *dmxInput = &dmxInputs[(uintptr_t)blockData]; int i; if (dmxInput->vt_switch_pending) { @@ -897,29 +889,6 @@ static void dmxInputScanForExtensions(DMXInputInfo *dmxInput, int doXI) } } break; -#if 0 - case IsXExtensionDevice: - case IsXExtensionKeyboard: - case IsXExtensionPointer: - if (doXI) { - if (!dmxInput->numDevs) { - dmxLog(dmxWarning, - "Cannot use remote (%s) XInput devices if" - " not also using core devices\n", - dmxInput->name); - } else { - dmxLocal = dmxInputCopyLocal(dmxInput, - &DMXCommonOth); - dmxLocal->isCore = FALSE; - dmxLocal->sendsCore = FALSE; - dmxLocal->deviceId = devices[i].id; - dmxLocal->deviceName = (devices[i].name - ? strdup(devices[i].name) - : NULL); - } - } - break; -#endif } } XFreeDeviceList(devices); @@ -1067,9 +1036,8 @@ void dmxInputInit(DMXInputInfo *dmxInput) dmxInput->processInputEvents = dmxProcessInputEvents; dmxInput->detached = False; - RegisterBlockAndWakeupHandlers(dmxBlockHandler, - dmxWakeupHandler, - (void *)dmxInput->inputIdx); + RegisterBlockAndWakeupHandlers(dmxBlockHandler, dmxWakeupHandler, + (void *)(uintptr_t)dmxInput->inputIdx); } static void dmxInputFreeLocal(DMXLocalInputInfoRec *local) diff --git a/os/WaitFor.c b/os/WaitFor.c index e66300490..867cb04b8 100644 --- a/os/WaitFor.c +++ b/os/WaitFor.c @@ -153,13 +153,17 @@ WaitForSomething(int *pClientsReady) fd_set clientsWritable; int curclient; int selecterr; - int nready; + static int nready; fd_set devicesReadable; CARD32 now = 0; Bool someReady = FALSE; FD_ZERO(&clientsReadable); + if (nready) + SmartScheduleStopTimer(); + nready = 0; + /* We need a while loop here to handle crashed connections and the screen saver timeout */ while (1) @@ -211,7 +215,6 @@ WaitForSomething(int *pClientsReady) } XFD_COPYSET(&AllSockets, &LastSelectMask); } - SmartScheduleStopTimer (); BlockHandler((pointer)&wt, (pointer)&LastSelectMask); if (NewOutputPending) @@ -230,7 +233,6 @@ WaitForSomething(int *pClientsReady) } selecterr = GetErrno(); WakeupHandler(i, (pointer)&LastSelectMask); - SmartScheduleStartTimer (); if (i <= 0) /* An error or timeout occurred */ { if (dispatchException) @@ -388,6 +390,10 @@ WaitForSomething(int *pClientsReady) #endif } } + + if (nready) + SmartScheduleStartTimer(); + return nready; }