[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Re: AVR byte swap optimization
From: |
Nils Springob |
Subject: |
Re: [avr-gcc-list] Re: AVR byte swap optimization |
Date: |
Tue, 19 Dec 2006 00:08:00 +0100 |
User-agent: |
Thunderbird 1.5.0.8 (Windows/20061025) |
Hi,
and it is possible to use an anonymous struct:
static inline uint16_t bswap_16_inline(uint16_t x)
{
union {
uint16_t x;
struct {
uint8_t a, b;
};
} in, out;
in.x = x;
out.a = in.b;
out.b = in.a;
return out.x;
}
Regards,
Nils