[PATCH] Remove incorrect & in swap_uint32

Jeremy Huddleston jeremyhu at apple.com
Mon Oct 3 10:28:16 PDT 2011


On Oct 3, 2011, at 05:58, Michel Dänzer wrote:

> On Don, 2011-09-29 at 13:10 +1000, Peter Hutterer wrote: 
>> On Wed, Sep 28, 2011 at 05:27:45PM -0400, Matt Turner wrote:
>>> Caused by commit 893e86a4, and hidden by the (char *) cast.
>>> 
>>> Signed-off-by: Matt Turner <mattst88 at gmail.com>
>>> ---
>>> include/misc.h |    2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>> 
>>> diff --git a/include/misc.h b/include/misc.h
>>> index 1fea73e..180b3c1 100644
>>> --- a/include/misc.h
>>> +++ b/include/misc.h
>>> @@ -277,7 +277,7 @@ static inline void __builtin_constant_p(int x)
>>> /* byte swap a 32-bit value */
>>> static inline void swap_uint32(uint32_t *x)
>>> {
>>> -	char n = ((char *) &x)[0];
>>> +	char n = ((char *) x)[0];
>>> 	((char *) x)[0] = ((char *) x)[3];
>>> 	((char *) x)[3] = n;
>>> 	n = ((char *) x)[1];
>>> -- 
>>> 1.7.3.4
>>> 
>> 
>> I recommend writing a few tests in test/misc.c for this. It won't take long,
>> they're quite simple to write and may just spot another bug.
> 
> FWIW, this broke the existing xi2 tests, at least on powerpc.
> 
> I had to find that out using git bisect... what is this fix waiting for?

Matt's busy with midterms and whatnot, so I added it to my [PULL]...  Now we're just waiting on Keith to go through his queue backlog...



More information about the xorg-devel mailing list