This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: Fix for hal_endian.h SWAP16() macro
Grant Edwards wrote:
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.
Feel free to make a guess.
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.
Thanks, applied.
Jifl
--
eCosCentric Limited http://www.eCosCentric.com/ The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
>>>> Visit us on stand 810 at The Embedded Systems Show 2007, NEC <<<<
>>>> Oct 17-18 Birmingham, UK http://www.edaexhibitions.com/ess/ <<<<
------["The best things in life aren't things."]------ Opinions==mine