Re: [Pixman] [PATCH 7/7] Add bswap() macros and use them

2010-05-03 Thread Soeren Sandmann
Jeff Muizelaar writes: > These macros reuse their value which makes them prone to bugs like: > > cairo: ce3ad6f41edf86ed6914f4d7f364111eba42ca65 > > We should either use inline functions or trickier macros. Yeah, good catch. It probably would make sense to take the macros that Alan pointed ou

Re: [Pixman] [PATCH 7/7] Add bswap() macros and use them

2010-04-26 Thread Alan Coopersmith
> +/* Byte swapping */ > +#if HAVE_BYTESWAP_H > +# include > +#endif > +#ifndef bswap_16 > +# define bswap_16(p) \ > + (uint16_t)(p)) & 0x00ff) << 8) | \ > + (((uint16_t)(p)) >> 8)); > +#endif If you want to enter the twisty maze of all the platform #ifdefs, since this is

Re: [Pixman] [PATCH 7/7] Add bswap() macros and use them

2010-04-24 Thread Jeff Muizelaar
On 24-Apr-10, at 4:48 PM, Søren Sandmann wrote: diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h index d5767af..c4f5064 100644 --- a/pixman/pixman-private.h +++ b/pixman/pixman-private.h @@ -686,6 +686,24 @@ pixman_region16_copy_from_region32 (pixman_region16_t *dst, +/* Byte s

[Pixman] [PATCH 7/7] Add bswap() macros and use them

2010-04-24 Thread Søren Sandmann
From: Benjamin Otte Code taken from Cairo. --- configure.ac|1 + pixman/pixman-access.c | 35 +-- pixman/pixman-private.h | 18 ++ 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/configure.ac b/configure.ac ind