This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
SWAP macros
- From: Bob Koninckx <bob dot koninckx at mech dot kuleuven dot ac dot be>
- To: ecos-discuss at sources dot redhat dot com
- Date: 26 Nov 2002 10:03:34 +0100
- Subject: [ECOS] SWAP macros
- Organization: KULeuven
Hi,
In hal/common/current/include/hal_endian.h
the CYG_SWAP16 macro is defined as
# define CYG_SWAP16(_x_) \
({ cyg_uint16 _x = (_x_); ((_x << 8) | (_x >> 8)); })
I don't see how this can have any effect. Shouldn't it be
# define CYG_SWAP16(_x_) \
({ cyg_uint16 _x = (_x_); _x_ = ((_x << 8) | (_x >> 8)); })
Same thing for CYG_SWAP32
Thanks
Bob
--
----------------------------------------------------------------------
ir. Bob Koninckx
Katholieke Universiteit Leuven
Division Production Engineering, tel. +32 16 322535
Machine Design and Automation fax. +32 16 322987
Celestijnenlaan 300B bob.koninckx@mech.kuleuven.ac.be
B-3001 Leuven Belgium http://www.mech.kuleuven.ac.be/pma
----------------------------------------------------------------------
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss