[PATCH v2 05/12] mi: Add GetSpriteScreen macro to hide dixLookupPrivate

Daniel Stone daniel at fooishbar.org
Thu Dec 30 18:12:28 PST 2010


On Thu, Dec 30, 2010 at 07:19:36PM +0200, Pauli wrote:
> From: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
> 
> Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
> ---
>  mi/misprite.c |   24 +++++++++++-------------
>  1 files changed, 11 insertions(+), 13 deletions(-)
> 
> diff --git a/mi/misprite.c b/mi/misprite.c
> index 38a6b93..7cb8d41 100644
> --- a/mi/misprite.c
> +++ b/mi/misprite.c
> @@ -184,6 +184,9 @@ miSpriteIsDown(miCursorInfoPtr pDevCursor)
>  
>  static DevPrivateKeyRec miSpriteScreenKeyRec;
>  #define miSpriteScreenKey (&miSpriteScreenKeyRec)
> +#define GetSpriteScreen(pScreen) \
> +	((miSpriteScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \
> +					miSpriteScreenKey))
>  static DevPrivateKeyRec miSpriteDevPrivatesKeyRec;
>  #define miSpriteDevPrivatesKey (&miSpriteDevPrivatesKeyRec)

There's no need for the cast -- dixLookupPrivate returns type pointer,
which is just void *.

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20101231/1207846a/attachment.pgp>


More information about the xorg-devel mailing list