This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix for hal_endian.h SWAP16() macro


On Mon, Sep 24, 2007 at 11:57:01AM -0500, Grant Edwards wrote:

> The SWAP16() macro is broken.
> 
>   unsigned u = SWAP16(0x1234);
> 
> u will be 0x123412 instead of 0x3412.
> 
> Here's a fix.
> 
> I believe that the SWAP32() macro will also break in a similar
> way on systems where "int" is larger than 32 bits, but I have
> no way to test that conjecture.

OK, this time with a Changelog entry.  I have a hard time
remembering to edit the changelog since I use CVS to keep track
of such thing.

-- 
Grant Edwards
grante@visi.com

Attachment: hal_common_endian_SWAP16.patch
Description: hal_endian.h--SWAP16.patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]