Idris2 icon indicating copy to clipboard operation
Idris2 copied to clipboard

[RefC] Add 16 and 32 bit access to base/Data.Buffer .

Open seagull-kamome opened this issue 3 years ago • 2 comments

Some FFI definitions are missing in base/Data.Buffer. This PR adds 16 and 32 bit access routines.

seagull-kamome avatar Aug 02 '22 06:08 seagull-kamome

What's the convention behind the *LE names? Why is it not uniform?

I suspect it's "Little Endian". It won't matter in 99% of the cases, since most modern machines are LE, but the ones where it does matter it'll likely mess up everything to do with assumed behaviour of bit shifts on (unsigned) integers...

CodingCellist avatar Oct 06 '22 08:10 CodingCellist

What's the convention behind the *LE names? Why is it not uniform?

I suspect it's "Little Endian". It won't matter in 99% of the cases, since most modern machines are LE

Not only machines have set endianness, but also protocols. Say, if one would use Data.Buffer to form a network packet where usually Big Endian is used disregarding endianness of the machine where the code is executed, one would definitely want to understand the order bytes are put into the buffer.

buzden avatar Oct 06 '22 16:10 buzden