On 12/29/10 11:27 AM, Pauli wrote:
> From: Pauli Nieminen <[email protected]>
> 
> Local variable eliminates some casts to OsCommPtr.
> 
> Signed-off-by: Pauli Nieminen <[email protected]>
> ---
>  os/access.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/os/access.c b/os/access.c
> index 494986e..3fc5896 100644
> --- a/os/access.c
> +++ b/os/access.c
> @@ -1034,13 +1034,15 @@ Bool LocalClient(ClientPtr client)
>      Xtransaddr               *from = NULL;
>      pointer          addr;
>      register HOST    *host;
> +    OsCommPtr                oc;
>  
>      if (!client->osPrivate)
>          return FALSE;
> -    if (!((OsCommPtr)client->osPrivate)->trans_conn)
> +    oc = client->osPrivate;
> +    if (!oc->trans_conn)
>          return FALSE;
>  
> -    if (!_XSERVTransGetPeerAddr (((OsCommPtr)client->osPrivate)->trans_conn,
> +    if (!_XSERVTransGetPeerAddr (oc->trans_conn,
>       &notused, &alen, &from))
>      {
>       family = ConvertAddr ((struct sockaddr *) from,

Conceptually, looks reasonable to me, so
Reviewed-by: Alan Coopersmith <[email protected]>

But stylistically I'd probably merge the lines now that they're short enough
to fit in one line:

-    if (!_XSERVTransGetPeerAddr (((OsCommPtr)client->osPrivate)->trans_conn,
-       &notused, &alen, &from))
+    if (!_XSERVTransGetPeerAddr (oc->trans_conn, &notused, &alen, &from))

-- 
        -Alan Coopersmith-        [email protected]
         Oracle Solaris Platform Engineering: X Window System

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to