[PATCH:libXext] Avoid having macros expand code to be: ((f) ? (f)->m1 : NULL)->m2

Peter Hutterer peter.hutterer at who-t.net
Sun Jul 29 23:23:22 PDT 2012


On Wed, Jul 18, 2012 at 11:40:18PM +0200, Thomas Klausner wrote:
> From Matthew R. Green <mrg at NetBSD.org>
> 
> Signed-off-by: Thomas Klausner <wiz at NetBSD.org>

applied, thanks.

Cheers,
   Peter

> ---
>  src/XSync.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/XSync.c b/src/XSync.c
> index df7c435..5775293 100644
> --- a/src/XSync.c
> +++ b/src/XSync.c
> @@ -107,8 +107,8 @@ static /* const */ SyncVersionInfo supported_versions[] = {
>  };
>  
>  #define NUM_VERSIONS (sizeof(supported_versions)/sizeof(supported_versions[0]))
> -#define GET_VERSION(info) ((info) ? (const SyncVersionInfo*)(info)->data : NULL)
> -#define IS_VERSION_SUPPORTED(info) (!!GET_VERSION(info))
> +#define GET_VERSION(info) ((const SyncVersionInfo*)(info)->data)
> +#define IS_VERSION_SUPPORTED(info) (!!(info))
>  
>  static
>  const SyncVersionInfo* GetVersionInfo(Display *dpy)
> -- 
> 1.7.11.1
> 


More information about the xorg-devel mailing list