Re: [dev] Introducing the imagefile-format

From: Martti Kühne <mysatyre_AT_gmail.com>
Date: Tue, 29 Jul 2014 12:17:42 +0200

On Tue, Jul 29, 2014 at 1:37 AM, Staven <pvl.staven_AT_gmail.com> wrote:
>
> width = (hdr[9] << 24) | (hdr[10] << 16) | (hdr[11] << 8) | hdr[12]
> height = (hdr[13] << 24) | (hdr[14] << 16) | (hdr[15] << 8) | hdr[16]
>


To reiterate this, each of these parenthesized expressions is in
native byte order *already*, if I understand the C standard correctly,
and ntohl/htonl would only have any impact if we bit off the whole
word in one byte. Pleasee don't make a mess with both of these
functions.

cheers!
mar77i
Received on Tue Jul 29 2014 - 12:17:42 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 29 2014 - 12:24:06 CEST