svn commit: r261118 - head/sys/dev/usb/wlan

Hans Petter Selasky hps at bitfrost.no
Fri Jan 24 15:16:01 UTC 2014


On 01/24/14 16:11, Adrian Chadd wrote:
> ... How's that matter?
>
> Adrian

Ok, read slowly:

uint32_t x = 255U;
uint8_t y;

On Big endian:

memcpy(&y, &x, 1);

y == 0;

On Little endian:

memcpy(&y, &x, 1);

y == 255;

If I'm not mistaken. The code is wrong because result depends on 
endianness :-)

--HPS




More information about the svn-src-head mailing list