Little endian to host?

Started by
10 comments, last by Puzzler183 20 years, 2 months ago
quote:Original post by Anonymous Poster
Pretty much any "standard" file format that originated on x86 is little endian. .3ds is a good example. All multi-byte values are stored in little endian form.



That can mean one of two (maybe more) things:

- The format was not designed with endianness, thus portability,
in mind. (Who cares? I just use it on Wintel machines!)

- The format is supposed to be portable, but the programmers
decided it was fun to write their own Little-Endian conversion
functions.

OK, it may also be that the format designer was not aware
of such a thing as "endianness".


Kami no Itte ga ore ni zettai naru!
神はサイコロを振らない!
Advertisement
Or it may just mean that they evaluated the pros and cons of the alternatives and (rightly) decided that little-endian was the way to go, as its downside (harder to read memory dumps and so on) is negligible compared to its upside (simpler for hardware, reduced need for pointer fixups).
char a[99999],*p=a;int main(int c,char**V){char*v=c>0?1[V]:(char*)V;if(c>=0)for(;*v&&93!=*v;){62==*v&&++p||60==*v&&--p||43==*v&&++*p||45==*v&&--*p||44==*v&&(*p=getchar())||46==*v&&putchar(*p)||91==*v&&(*p&&main(0,(char**)(--v+2))||(v=(char*)main(-1,(char**)++v)-1));++v;}else for(c=1;c;c+=(91==*v)-(93==*v),++v);return(int)v;}  /*** drpizza@battleaxe.net ***/

This topic is closed to new replies.

Advertisement