Page 1 of 1

Has little endian ever been used in RND?

Posted: Mon Jun 05, 2006 5:24 pm
by Zomis
I see that there are some source for saving RND files with BYTE_ORDER_LITTLE_ENDIAN instead of big endian, but has it ever been used? I can't find a single moment (at least not in the source of 3.2.0-8) where it actually has been used...? Was it used in the early 1.2.0 version or has it never been used at all?

[Edit] Ok, it exists in sounds.c... but why only there? Why isn't it all BIG_ENDIAN?

Posted: Mon Jun 05, 2006 5:46 pm
by Holger
It has never been used so far.

This code and definitions were added for two reasons:

(a) There's no such thing as "reading or writing a 16 or 32 bit value from or to a binary file" -- you always need to know if you use network byte order (big endian) or intel style byte order (little endian). So, just to make things clear, I used that more generic approach.

(b) Although R'n'D will never use little endian itself, it may be possible that it has to read (or even write) foreign file formats with little endian format. For this case, I already have the right code base at hand... :-)