Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jan 2014 16:16:58 +0100
From:      Hans Petter Selasky <hps@bitfrost.no>
To:        Adrian Chadd <adrian.chadd@gmail.com>
Cc:        svn-src-head@freebsd.org, Kevin Lo <kevlo@freebsd.org>, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r261118 - head/sys/dev/usb/wlan
Message-ID:  <52E283EA.1050708@bitfrost.no>
In-Reply-To: <CAJ-Vmomc=s_E1U1OA==eHrVCOa4fD_1v-osDqZqS9wzcFx2fjw@mail.gmail.com>
References:  <201401240917.s0O9HTBO046991@svn.freebsd.org>	<CAJ-Vmo=KVWR_b4%2BHTgC154C%2B7nnAxQWGPWQQxqvaOSAPZNdQTA@mail.gmail.com>	<52E279FD.70909@bitfrost.no> <CAJ-Vmomc=s_E1U1OA==eHrVCOa4fD_1v-osDqZqS9wzcFx2fjw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52E283EA.1050708>