Has little endian ever been used in RND?

Discussion around programming R'n'D, its source code and its tools.

Moderators: Zomis, Flumminator

Post Reply
Zomis
Posts: 1501
Joined: Mon Jun 21, 2004 1:27 pm
Location: Sweden
Contact:

Has little endian ever been used in RND?

Post by Zomis » Mon Jun 05, 2006 5:24 pm

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?

User avatar
Holger
Site Admin
Posts: 3225
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger » Mon Jun 05, 2006 5:46 pm

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... :-)

Post Reply