fnuecke/eris — pull request #5 by jder (2013-11-10 21:11:15+00:00)
Title: Fixes 64-bit header size issue

I received a warning when compiling Eris with Clang, which pointed me to this bug. the sizeof(kHeader) in the next line was actually producing the size of the `kHeader` *pointer* (i.e. 4 bytes on a 32 bit system, 8 bytes on my 64-bit one), not the size of the "ERIS" string (which is actually 5 bytes in length). The result is that the header produced by my build of Eris was (hex) `45 52 49 53 00 63 6f 75` -- that is, the 4 bytes in "ERIS", the terminating null byte, and 3 garbage bytes.

So, I've changed this global to be the four-byte-long header which I assume was the original intent. This doesn't change the behavior on 32-bit systems, but would introduce backward-incompatibility with old versions of Eris built on 64-bit systems, so I've also added detection of this and skipping of the extra header bytes. You could leave that second commit out if backwards compatibility is not an issue, and people will get an "incompatible floating point type" error instead.