Re: Endian-specific types
Mouse <[email protected]> Mon, 11 Apr 2016 15:46:00 -0400 (EDT)
| Newsgroups | gmane.os.netbsd.devel.general |
|---|---|
| Message-ID | <[email protected]> |
>> It uses __le16, what should I convert that to in NetBSD? > What does it do? I _think_ __le16 is just uint16 (or maybe int16) but with an additional annotation for humans and (potentially?) automated codewalkers that the value is thought of as little-endian. I have never really understood their use of it. IMO values in integer-typed variables should not even conceptually have endiannesses; endianness is a property of not the variable or its value but rather of a serialization of that value. Confusing a value with its serialization is a fruitful source of bugs - I'm working with some code right now at work that does the "overlay values onto the buffer to serialize/deserialize" thing and it is byte sex hell, for exactly this reason. (I've been recommending they fix the code to stop doing that.) /~\ The ASCII Mouse \ / Ribbon Campaign X Against HTML [email protected] / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B