Path: csiph.com!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: comp.programming Subject: Re: little-endian Date: Sat, 17 Nov 2012 10:26:19 +0100 Organization: Informatimago Lines: 30 Message-ID: <87mwygpolg.fsf@informatimago.com> References: <2f491c75-8fbc-4dca-9abe-f11e784454a2@googlegroups.com> <87r4ntp4b1.fsf@informatimago.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net cVgtL2ci/sn/mauo2607XAq4cq3nt0vZm6t9PpOevrdg+KuguPOemVWB1OyDXJceQk Cancel-Lock: sha1:YzgxMDJlN2Q0NjI2MmJhYWNlYmQ1ODJhZjQ2YjRhNzViNjczN2M2ZA== sha1:jkotDeMtFjbOa83hL6qw/dnGlYo= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (darwin) Xref: csiph.com comp.programming:2491 BGB writes: > some of my file-formats end up little-endian, and others big-endian. That's unfortunate. The internet is in general specified to use big-endian. For files you'd be well advised to apply the same rule. Always use htonl to write to files/network and ntohl to read from files/network. > then (when dealing with bitstream formats) there is also the whole > matter of bit-ordering, which may or may not match the byte-ordering. Granted, but then bits are usually gathered into bytes by the hardware, so the issue doesn't concerns us programmers, in general. That said, some hardware protocols transmit bytes in little endian bit order, while others transmit them in big endian bit order too :-) > personally, I prefer little endian, but don't really think it is a big > deal either. > […] > it is mostly just debatable if this would be worthwhile. Or if the debate is worthwhile :-) -- __Pascal Bourguignon__ http://www.informatimago.com