Re: [boost] [endian] Refresh based on comments received

----Original Message---- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of me22 Sent: 09 June 2006 14:51 To: boost@lists.boost.org Subject: Re: [boost] [endian] Refresh based on comments received
Well, some of them (DSPs) are freestanding implementations and don't /have/ fgetc. But in general, yes. Of course, on such systems the file will be divided into 9 or 32 bit sized chunks. (Which makes file transfer interesting).
If, for example, the sockets implementation actually filled all 9 bits in a byte on a recv, I could see that being a portability nightmare...
The sockets implementation receive octets down the wire (and they are called octets not bytes because the designers were aware of non-8-bit bytes). recv will store each octet into a byte (which C and C++ guarantees is big enough). send might just transmit the low eight bits of each byte as the octet, or it might fail if higher bits are non-zero. -- Martin Bonner Martin.Bonner@Pitechnology.com Pi Technology, Milton Hall, Ely Road, Milton, Cambridge, CB4 6WZ, ENGLAND Tel: +44 (0)1223 203894

On 6/9/06, Martin Bonner <martin.bonner@pitechnology.com> wrote:
That raises an interesting issue. It sounds like (on a platform with 32-bit bytes) for a file the octets would have to be rearranged inside one byte, but for a socket it would need the octets spread out, each into one byte. Would it be worth adding allowed_bits_per_byte ( = CHAR_BIT ) and chunk_size ( = 8 ) parameters to the templates? They certainly wouldn't simplify the implementation. Also, has middle-endian finally died? Contemplative, ~ Scott McMurray
participants (2)
-
Martin Bonner
-
me22