From f702372822dadb1fef92cfc25086481f640147b3 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 17 Jun 2011 12:58:25 -0400 Subject: dix: Repack ClientRec sizeof(ClientRec) ILP32 LP64 before 120 184 after 104 136 Reviewed-by: Daniel Stone Signed-off-by: Adam Jackson --- include/dixstruct.h | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/dixstruct.h b/include/dixstruct.h index 0a85f40b6..5fd595dc7 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -90,23 +90,22 @@ typedef struct _Client { Mask clientAsMask; pointer requestBuffer; pointer osPrivate; /* for OS layer, including scheduler */ - Bool swapped; + char swapped; + char big_requests; + char closeDownMode; + char clientGone; + char noClientException; /* this client died or needs to be + * killed */ + char clientState; ReplySwapPtr pSwapReplyFunc; XID errorValue; int sequence; - int closeDownMode; - int clientGone; - int noClientException; /* this client died or needs to be - * killed */ int ignoreCount; /* count for Attend/IgnoreClient */ - SaveSetElt *saveSet; int numSaved; - int (**requestVector) ( - ClientPtr /* pClient */); + SaveSetElt *saveSet; + int (**requestVector) (ClientPtr /* pClient */); CARD32 req_len; /* length of current request */ - Bool big_requests; /* supports large requests */ int priority; - ClientState clientState; PrivateRec *devPrivates; unsigned short xkbClientFlags; unsigned short mapNotifyMask; @@ -114,16 +113,16 @@ typedef struct _Client { unsigned short vMajor,vMinor; KeyCode minKC,maxKC; - unsigned long replyBytesRemaining; + unsigned int replyBytesRemaining; int smart_priority; - long smart_start_tick; - long smart_stop_tick; - long smart_check_tick; + int smart_start_tick; + int smart_stop_tick; + int smart_check_tick; DeviceIntPtr clientPtr; ClientIdPtr clientIds; unsigned short majorOp, minorOp; -} ClientRec; +} ClientRec; /* * Scheduling interface -- cgit v1.2.3 From 49d38b75c8f3276cfce33ffe6b8c4fbeb1081b96 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 17 Jun 2011 13:22:41 -0400 Subject: dix: Pull client-is-local flag up to the ClientRec Reviewed-by: Daniel Stone Signed-off-by: Adam Jackson --- Xext/xf86bigfont.c | 4 ++-- hw/kdrive/ephyr/ephyrdriext.c | 4 ++-- hw/xfree86/dixmods/extmod/xf86dga2.c | 2 +- hw/xfree86/dixmods/extmod/xf86vmode.c | 6 +++--- hw/xfree86/dri/xf86dri.c | 4 ++-- hw/xfree86/dri2/dri2ext.c | 2 +- hw/xquartz/applewm.c | 4 ++-- hw/xquartz/xpr/appledri.c | 4 ++-- hw/xwin/winwindowswm.c | 4 ++-- include/dixstruct.h | 1 + include/os.h | 2 -- os/access.c | 9 +-------- os/connection.c | 2 +- os/osdep.h | 1 - 14 files changed, 20 insertions(+), 29 deletions(-) (limited to 'include') diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index 4b63a13a1..5053852a4 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -300,7 +300,7 @@ ProcXF86BigfontQueryVersion( #endif reply.capabilities = #ifdef HAS_SHM - (LocalClient(client) && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0) + (client->local && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0) #else 0 #endif @@ -367,7 +367,7 @@ ProcXF86BigfontQueryFont( #else switch (client->req_len) { case 2: /* client with version 1.0 libX11 */ - stuff_flags = (LocalClient(client) && !client->swapped ? XF86Bigfont_FLAGS_Shm : 0); + stuff_flags = (client->local && !client->swapped ? XF86Bigfont_FLAGS_Shm : 0); break; case 3: /* client with version 1.1 libX11 */ stuff_flags = stuff->flags; diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c index 0741a7294..85e38e058 100644 --- a/hw/kdrive/ephyr/ephyrdriext.c +++ b/hw/kdrive/ephyr/ephyrdriext.c @@ -586,7 +586,7 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client) } rep.isCapable = isCapable; - if (!LocalClient(client) || client->swapped) + if (!client->local || client->swapped) rep.isCapable = 0; if (client->swapped) { @@ -1253,7 +1253,7 @@ ProcXF86DRIDispatch (register ClientPtr client) } } - if (!LocalClient(client)) + if (!client->local) return DRIErrorBase + XF86DRIClientNotLocal; switch (stuff->data) diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c index 4bcf77efd..4b17f152e 100644 --- a/hw/xfree86/dixmods/extmod/xf86dga2.c +++ b/hw/xfree86/dixmods/extmod/xf86dga2.c @@ -928,7 +928,7 @@ ProcXDGADispatch (ClientPtr client) { REQUEST(xReq); - if (!LocalClient(client)) + if (!client->local) return DGAErrorBase + XF86DGAClientNotLocal; #ifdef DGA_REQ_DEBUG diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index 6d3d5fcbc..6e5e3f94c 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -1527,7 +1527,7 @@ ProcXF86VidModeGetPermissions(ClientPtr client) rep.sequenceNumber = client->sequence; rep.permissions = XF86VM_READ_PERMISSION; if (xf86GetVidModeEnabled() && - (xf86GetVidModeAllowNonLocal() || LocalClient (client))) { + (xf86GetVidModeAllowNonLocal() || client->local)) { rep.permissions |= XF86VM_WRITE_PERMISSION; } if(client->swapped) { @@ -1597,7 +1597,7 @@ ProcXF86VidModeDispatch(ClientPtr client) default: if (!xf86GetVidModeEnabled()) return VidModeErrorBase + XF86VidModeExtensionDisabled; - if (xf86GetVidModeAllowNonLocal() || LocalClient (client)) { + if (xf86GetVidModeAllowNonLocal() || client->local) { switch (stuff->data) { case X_XF86VidModeAddModeLine: return ProcXF86VidModeAddModeLine(client); @@ -2017,7 +2017,7 @@ SProcXF86VidModeDispatch(ClientPtr client) default: if (!xf86GetVidModeEnabled()) return VidModeErrorBase + XF86VidModeExtensionDisabled; - if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) { + if (xf86GetVidModeAllowNonLocal() || client->local) { switch (stuff->data) { case X_XF86VidModeAddModeLine: return SProcXF86VidModeAddModeLine(client); diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c index c35ba2f94..723e52622 100644 --- a/hw/xfree86/dri/xf86dri.c +++ b/hw/xfree86/dri/xf86dri.c @@ -130,7 +130,7 @@ ProcXF86DRIQueryDirectRenderingCapable( } rep.isCapable = isCapable; - if (!LocalClient(client) || client->swapped) + if (!client->local || client->swapped) rep.isCapable = 0; if (client->swapped) { @@ -557,7 +557,7 @@ ProcXF86DRIDispatch ( return ProcXF86DRIQueryDirectRenderingCapable(client); } - if (!LocalClient(client)) + if (!client->local) return DRIErrorBase + XF86DRIClientNotLocal; switch (stuff->data) diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c index 73ef7f25e..21331559f 100644 --- a/hw/xfree86/dri2/dri2ext.c +++ b/hw/xfree86/dri2/dri2ext.c @@ -547,7 +547,7 @@ ProcDRI2Dispatch (ClientPtr client) return ProcDRI2QueryVersion(client); } - if (!LocalClient(client)) + if (!client->local) return BadRequest; switch (stuff->data) { diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c index 55976c454..7077a6c6a 100644 --- a/hw/xquartz/applewm.c +++ b/hw/xquartz/applewm.c @@ -630,7 +630,7 @@ ProcAppleWMDispatch ( return ProcAppleWMQueryVersion(client); } - if (!LocalClient(client)) + if (!client->local) return WMErrorBase + AppleWMClientNotLocal; switch (stuff->data) @@ -693,7 +693,7 @@ SProcAppleWMDispatch ( REQUEST(xReq); /* It is bound to be non-local when there is byte swapping */ - if (!LocalClient(client)) + if (!client->local) return WMErrorBase + AppleWMClientNotLocal; /* only local clients are allowed WM access */ diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c index 44c132abc..091145be3 100644 --- a/hw/xquartz/xpr/appledri.c +++ b/hw/xquartz/xpr/appledri.c @@ -133,7 +133,7 @@ ProcAppleDRIQueryDirectRenderingCapable( } rep.isCapable = isCapable; - if (!LocalClient(client)) + if (!client->local) rep.isCapable = 0; if (client->swapped) { @@ -365,7 +365,7 @@ ProcAppleDRIDispatch ( return ProcAppleDRIQueryDirectRenderingCapable(client); } - if (!LocalClient(client)) + if (!client->local) return DRIErrorBase + AppleDRIClientNotLocal; switch (stuff->data) diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c index 577614db6..f43834d5e 100644 --- a/hw/xwin/winwindowswm.c +++ b/hw/xwin/winwindowswm.c @@ -548,7 +548,7 @@ ProcWindowsWMDispatch (ClientPtr client) return ProcWindowsWMQueryVersion(client); } - if (!LocalClient(client)) + if (!client->local) return WMErrorBase + WindowsWMClientNotLocal; switch (stuff->data) @@ -598,7 +598,7 @@ SProcWindowsWMDispatch (ClientPtr client) REQUEST(xReq); /* It is bound to be non-local when there is byte swapping */ - if (!LocalClient(client)) + if (!client->local) return WMErrorBase + WindowsWMClientNotLocal; /* only local clients are allowed WM access */ diff --git a/include/dixstruct.h b/include/dixstruct.h index 5fd595dc7..cb370519e 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -91,6 +91,7 @@ typedef struct _Client { pointer requestBuffer; pointer osPrivate; /* for OS layer, including scheduler */ char swapped; + char local; char big_requests; char closeDownMode; char clientGone; diff --git a/include/os.h b/include/os.h index 48ce32962..84dedd5cb 100644 --- a/include/os.h +++ b/include/os.h @@ -353,8 +353,6 @@ typedef struct sockaddr * sockaddrPtr; extern _X_EXPORT int InvalidHost(sockaddrPtr /*saddr*/, int /*len*/, ClientPtr client); -extern _X_EXPORT int LocalClient(ClientPtr /* client */); - extern _X_EXPORT int LocalClientCred(ClientPtr, int *, int *); #define LCC_UID_SET (1 << 0) diff --git a/os/access.c b/os/access.c index b609442de..ed13d0a0d 100644 --- a/os/access.c +++ b/os/access.c @@ -1045,13 +1045,6 @@ ComputeLocalClient(ClientPtr client) return FALSE; } -Bool LocalClient(ClientPtr client) -{ - if (!client->osPrivate) - return FALSE; - return ((OsCommPtr)client->osPrivate)->local_client; -} - /* * Return the uid and gid of a connected local client * @@ -1209,7 +1202,7 @@ AuthorizedClient(ClientPtr client) if (rc != Success) return rc; - return LocalClient(client) ? Success : BadAccess; + return client->local ? Success : BadAccess; } /* Add a host to the access control list. This is the external interface diff --git a/os/connection.c b/os/connection.c index 8a677a7ef..575cfb80f 100644 --- a/os/connection.c +++ b/os/connection.c @@ -745,7 +745,7 @@ AllocNewConnection (XtransConnInfo trans_conn, int fd, CARD32 conn_time) free(oc); return NullClient; } - oc->local_client = ComputeLocalClient(client); + client->local = ComputeLocalClient(client); #if !defined(WIN32) ConnectionTranslation[fd] = client->index; #else diff --git a/os/osdep.h b/os/osdep.h index 5fe019f5f..60cef27a2 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -166,7 +166,6 @@ typedef struct _osComm { XID auth_id; /* authorization id */ CARD32 conn_time; /* timestamp if not established, else 0 */ struct _XtransConnInfo *trans_conn; /* transport connection object */ - Bool local_client; } OsCommRec, *OsCommPtr; extern int FlushClient( -- cgit v1.2.3 From a4553019a10b4e01cc06f3081db71a83338697b4 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 17 Jun 2011 14:30:06 -0400 Subject: dix: Fix types in WindowOptRec No reason for these to be 64 bits on LP64. Reviewed-by: Daniel Stone Signed-off-by: Adam Jackson --- include/windowstr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/windowstr.h b/include/windowstr.h index 222de31dc..1124dfc4c 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -87,8 +87,8 @@ typedef struct _WindowOpt { struct _OtherClients *otherClients; /* default: NULL */ struct _GrabRec *passiveGrabs; /* default: NULL */ PropertyPtr userProps; /* default: NULL */ - unsigned long backingBitPlanes; /* default: ~0L */ - unsigned long backingPixel; /* default: 0 */ + CARD32 backingBitPlanes; /* default: ~0L */ + CARD32 backingPixel; /* default: 0 */ RegionPtr boundingShape; /* default: NULL */ RegionPtr clipShape; /* default: NULL */ RegionPtr inputShape; /* default: NULL */ -- cgit v1.2.3