dix: Remove pointless client-state callbacks
Private storage is pre-zeroed by the private system itself. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
140c2f1a54
commit
f523ebb549
22
Xext/geext.c
22
Xext/geext.c
|
@ -145,28 +145,10 @@ SProcGEDispatch(ClientPtr client)
|
||||||
return (*SProcGEVector[stuff->ReqType]) (client);
|
return (*SProcGEVector[stuff->ReqType]) (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when a new client inits a connection to the X server.
|
|
||||||
*
|
|
||||||
* We alloc a simple struct to store the client's major/minor version. Can be
|
|
||||||
* used in the furture for versioning support.
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
GEClientCallback(CallbackListPtr *list, void *closure, void *data)
|
|
||||||
{
|
|
||||||
NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
|
|
||||||
ClientPtr pClient = clientinfo->client;
|
|
||||||
GEClientInfoPtr pGEClient = GEGetClient(pClient);
|
|
||||||
|
|
||||||
pGEClient->major_version = 0;
|
|
||||||
pGEClient->minor_version = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Reset extension. Called on server shutdown. */
|
/* Reset extension. Called on server shutdown. */
|
||||||
static void
|
static void
|
||||||
GEResetProc(ExtensionEntry * extEntry)
|
GEResetProc(ExtensionEntry * extEntry)
|
||||||
{
|
{
|
||||||
DeleteCallback(&ClientStateCallback, GEClientCallback, 0);
|
|
||||||
EventSwapVector[GenericEvent] = NotImplemented;
|
EventSwapVector[GenericEvent] = NotImplemented;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,10 +187,6 @@ GEExtensionInit(void)
|
||||||
(&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec)))
|
(&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec)))
|
||||||
FatalError("GEExtensionInit: GE private request failed.\n");
|
FatalError("GEExtensionInit: GE private request failed.\n");
|
||||||
|
|
||||||
if (!AddCallback(&ClientStateCallback, GEClientCallback, 0)) {
|
|
||||||
FatalError("GEExtensionInit: register client callback failed.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(GE_NAME,
|
if ((extEntry = AddExtension(GE_NAME,
|
||||||
0, GENumberErrors,
|
0, GENumberErrors,
|
||||||
ProcGEDispatch, SProcGEDispatch,
|
ProcGEDispatch, SProcGEDispatch,
|
||||||
|
|
15
Xi/extinit.c
15
Xi/extinit.c
|
@ -380,18 +380,6 @@ DevPrivateKeyRec XIClientPrivateKeyRec;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
|
||||||
XIClientCallback(CallbackListPtr *list, void *closure, void *data)
|
|
||||||
{
|
|
||||||
NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
|
|
||||||
ClientPtr pClient = clientinfo->client;
|
|
||||||
XIClientPtr pXIClient;
|
|
||||||
|
|
||||||
pXIClient = dixLookupPrivate(&pClient->devPrivates, XIClientPrivateKey);
|
|
||||||
pXIClient->major_version = 0;
|
|
||||||
pXIClient->minor_version = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
*
|
*
|
||||||
* ProcIDispatch - main dispatch routine for requests to this extension.
|
* ProcIDispatch - main dispatch routine for requests to this extension.
|
||||||
|
@ -1298,9 +1286,6 @@ XInputExtensionInit(void)
|
||||||
(&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec)))
|
(&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec)))
|
||||||
FatalError("Cannot request private for XI.\n");
|
FatalError("Cannot request private for XI.\n");
|
||||||
|
|
||||||
if (!AddCallback(&ClientStateCallback, XIClientCallback, 0))
|
|
||||||
FatalError("Failed to add callback to XI.\n");
|
|
||||||
|
|
||||||
if (!XIBarrierInit())
|
if (!XIBarrierInit())
|
||||||
FatalError("Could not initialize barriers.\n");
|
FatalError("Could not initialize barriers.\n");
|
||||||
|
|
||||||
|
|
|
@ -66,17 +66,6 @@ typedef struct _CompositeClient {
|
||||||
#define GetCompositeClient(pClient) ((CompositeClientPtr) \
|
#define GetCompositeClient(pClient) ((CompositeClientPtr) \
|
||||||
dixLookupPrivate(&(pClient)->devPrivates, CompositeClientPrivateKey))
|
dixLookupPrivate(&(pClient)->devPrivates, CompositeClientPrivateKey))
|
||||||
|
|
||||||
static void
|
|
||||||
CompositeClientCallback(CallbackListPtr *list, void *closure, void *data)
|
|
||||||
{
|
|
||||||
NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
|
|
||||||
ClientPtr pClient = clientinfo->client;
|
|
||||||
CompositeClientPtr pCompositeClient = GetCompositeClient(pClient);
|
|
||||||
|
|
||||||
pCompositeClient->major_version = 0;
|
|
||||||
pCompositeClient->minor_version = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
FreeCompositeClientWindow(void *value, XID ccwid)
|
FreeCompositeClientWindow(void *value, XID ccwid)
|
||||||
{
|
{
|
||||||
|
@ -580,9 +569,6 @@ CompositeExtensionInit(void)
|
||||||
sizeof(CompositeClientRec)))
|
sizeof(CompositeClientRec)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!AddCallback(&ClientStateCallback, CompositeClientCallback, 0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (s = 0; s < screenInfo.numScreens; s++)
|
for (s = 0; s < screenInfo.numScreens; s++)
|
||||||
if (!compScreenInit(screenInfo.screens[s]))
|
if (!compScreenInit(screenInfo.screens[s]))
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -568,24 +568,6 @@ SProcDamageDispatch(ClientPtr client)
|
||||||
return (*SProcDamageVector[stuff->damageReqType]) (client);
|
return (*SProcDamageVector[stuff->damageReqType]) (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
DamageClientCallback(CallbackListPtr *list, void *closure, void *data)
|
|
||||||
{
|
|
||||||
NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
|
|
||||||
ClientPtr pClient = clientinfo->client;
|
|
||||||
DamageClientPtr pDamageClient = GetDamageClient(pClient);
|
|
||||||
|
|
||||||
pDamageClient->critical = 0;
|
|
||||||
pDamageClient->major_version = 0;
|
|
||||||
pDamageClient->minor_version = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*ARGSUSED*/ static void
|
|
||||||
DamageResetProc(ExtensionEntry * extEntry)
|
|
||||||
{
|
|
||||||
DeleteCallback(&ClientStateCallback, DamageClientCallback, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
FreeDamageExt(void *value, XID did)
|
FreeDamageExt(void *value, XID did)
|
||||||
{
|
{
|
||||||
|
@ -757,13 +739,10 @@ DamageExtensionInit(void)
|
||||||
(&DamageClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(DamageClientRec)))
|
(&DamageClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(DamageClientRec)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!AddCallback(&ClientStateCallback, DamageClientCallback, 0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ((extEntry = AddExtension(DAMAGE_NAME, XDamageNumberEvents,
|
if ((extEntry = AddExtension(DAMAGE_NAME, XDamageNumberEvents,
|
||||||
XDamageNumberErrors,
|
XDamageNumberErrors,
|
||||||
ProcDamageDispatch, SProcDamageDispatch,
|
ProcDamageDispatch, SProcDamageDispatch,
|
||||||
DamageResetProc, StandardMinorOpcode)) != 0) {
|
NULL, StandardMinorOpcode)) != 0) {
|
||||||
DamageReqCode = (unsigned char) extEntry->base;
|
DamageReqCode = (unsigned char) extEntry->base;
|
||||||
DamageEventBase = extEntry->eventBase;
|
DamageEventBase = extEntry->eventBase;
|
||||||
EventSwapVector[DamageEventBase + XDamageNotify] =
|
EventSwapVector[DamageEventBase + XDamageNotify] =
|
||||||
|
|
|
@ -219,17 +219,6 @@ typedef struct _RenderClient {
|
||||||
|
|
||||||
#define GetRenderClient(pClient) ((RenderClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RenderClientPrivateKey))
|
#define GetRenderClient(pClient) ((RenderClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RenderClientPrivateKey))
|
||||||
|
|
||||||
static void
|
|
||||||
RenderClientCallback(CallbackListPtr *list, void *closure, void *data)
|
|
||||||
{
|
|
||||||
NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
|
|
||||||
ClientPtr pClient = clientinfo->client;
|
|
||||||
RenderClientPtr pRenderClient = GetRenderClient(pClient);
|
|
||||||
|
|
||||||
pRenderClient->major_version = 0;
|
|
||||||
pRenderClient->minor_version = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
RESTYPE XRT_PICTURE;
|
RESTYPE XRT_PICTURE;
|
||||||
#endif
|
#endif
|
||||||
|
@ -246,8 +235,6 @@ RenderExtensionInit(void)
|
||||||
if (!dixRegisterPrivateKey
|
if (!dixRegisterPrivateKey
|
||||||
(&RenderClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(RenderClientRec)))
|
(&RenderClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(RenderClientRec)))
|
||||||
return;
|
return;
|
||||||
if (!AddCallback(&ClientStateCallback, RenderClientCallback, 0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
extEntry = AddExtension(RENDER_NAME, 0, RenderNumberErrors,
|
extEntry = AddExtension(RENDER_NAME, 0, RenderNumberErrors,
|
||||||
ProcRenderDispatch, SProcRenderDispatch,
|
ProcRenderDispatch, SProcRenderDispatch,
|
||||||
|
|
|
@ -212,23 +212,6 @@ SProcXFixesDispatch(ClientPtr client)
|
||||||
return (*SProcXFixesVector[stuff->xfixesReqType]) (client);
|
return (*SProcXFixesVector[stuff->xfixesReqType]) (client);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
XFixesClientCallback(CallbackListPtr *list, void *closure, void *data)
|
|
||||||
{
|
|
||||||
NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
|
|
||||||
ClientPtr pClient = clientinfo->client;
|
|
||||||
XFixesClientPtr pXFixesClient = GetXFixesClient(pClient);
|
|
||||||
|
|
||||||
pXFixesClient->major_version = 0;
|
|
||||||
pXFixesClient->minor_version = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*ARGSUSED*/ static void
|
|
||||||
XFixesResetProc(ExtensionEntry * extEntry)
|
|
||||||
{
|
|
||||||
DeleteCallback(&ClientStateCallback, XFixesClientCallback, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
XFixesExtensionInit(void)
|
XFixesExtensionInit(void)
|
||||||
{
|
{
|
||||||
|
@ -237,14 +220,12 @@ XFixesExtensionInit(void)
|
||||||
if (!dixRegisterPrivateKey
|
if (!dixRegisterPrivateKey
|
||||||
(&XFixesClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XFixesClientRec)))
|
(&XFixesClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XFixesClientRec)))
|
||||||
return;
|
return;
|
||||||
if (!AddCallback(&ClientStateCallback, XFixesClientCallback, 0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (XFixesSelectionInit() && XFixesCursorInit() && XFixesRegionInit() &&
|
if (XFixesSelectionInit() && XFixesCursorInit() && XFixesRegionInit() &&
|
||||||
(extEntry = AddExtension(XFIXES_NAME, XFixesNumberEvents,
|
(extEntry = AddExtension(XFIXES_NAME, XFixesNumberEvents,
|
||||||
XFixesNumberErrors,
|
XFixesNumberErrors,
|
||||||
ProcXFixesDispatch, SProcXFixesDispatch,
|
ProcXFixesDispatch, SProcXFixesDispatch,
|
||||||
XFixesResetProc, StandardMinorOpcode)) != 0) {
|
NULL, StandardMinorOpcode)) != 0) {
|
||||||
XFixesReqCode = (unsigned char) extEntry->base;
|
XFixesReqCode = (unsigned char) extEntry->base;
|
||||||
XFixesEventBase = extEntry->eventBase;
|
XFixesEventBase = extEntry->eventBase;
|
||||||
XFixesErrorBase = extEntry->errorBase;
|
XFixesErrorBase = extEntry->errorBase;
|
||||||
|
|
Loading…
Reference in New Issue