[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: r4140 - in packages/trunk/hex-a-hop/debian: . patches



retitle 438857 hex-a-hop: On big endian systems: complains about invalid .dat file
thanks

On Sun, Sep 09, 2007 at 07:52:00PM +0200, Miriam Ruiz wrote:
> --- Jens Seidel <jseidel-guest@alioth.debian.org> escribió:
> > Author: jseidel-guest
> > Date: 2007-09-09 17:42:43 +0000 (Sun, 09 Sep 2007)
> > New Revision: 4140
> > 
> > Modified:
> >    packages/trunk/hex-a-hop/debian/changelog
> >    packages/trunk/hex-a-hop/debian/patches/endianess.patch
> > Log:
> > Game status file is now always written with little endian data.
> > So it's exchangeable across different systems.
> 
> Will the game be able to read old status files or those who played with
> previous versions have lost all their data?

All previously released versions did not support big endian systems at
all. Nevertheless Alfie who tested the SVN snapshot will no longer be
able to reuse his old game files. I think this is not critical. If a
player who tested SVN really wants to convert the data file from big
endian to little endian I will be able to do so, nevertheless I prefer
not to do this.

PS: I consider all the little<-->big endian changes as a big mess. It
works well but the code should be improved and avoid writing binary data
(which is endian dependent, depends also on the data type size such as
sizeof(int), ...) and use only readable texts. At least I learned to
avoid this in my own code.

PS2: A question: Currently I do not swap the bits of char's during
endianess conversion, which is save on 8 bit char's in C++. Now I wonder
whether this will work if a char consists of 16 bits or more. IIRC C++
defines the size of a char as 1 and also 1 byte:=1 char. Will in this
case a 16 bit variable of random typ (char, int16_t, ...) represented in
the same way on little and big endian systems or not?

Jens



Reply to: