This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: CGY_SWAP16() seems broken to me.
On 2007-09-22, Grant Edwards <grante@visi.com> wrote:
> My fix above should be completely transparent. if the value is
> being assigned to a 16 bit lvalue, the compiler will generate
> exactly the same code as when using the existing "broken"
> macro. If the result from CYG_SWAP16() is being masked by the
> user, the fixed macro will generate exactly the same code as
> the existing macro.
>
> The only argument against my fix would be to claim that
> CYG_SWAP16 is expected to return 24 bits in wider contexts, and
> returning only 16 bits is going to break code or surprise a
> user.
I've examined all uses of SWAP16 and the LE16/BE16 macros in my
source tree (which is a few months out of date), and it doesn't
look like any existing code depends on the fact that SWAP16()
produces 24 bits instead of 16.
--
Grant Edwards grante Yow! An INK-LING? Sure --
at TAKE one!! Did you BUY any
visi.com COMMUNIST UNIFORMS??
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss