byte-order of generated divesite UUIDs
Dirk Hohndel
dirk at hohndel.org
Thu Oct 1 09:55:05 PDT 2015
On Thu, Oct 01, 2015 at 06:32:15PM +0300, Lubomir I. Ivanov wrote:
> after seeing a warning about strict-aliasing in:
> divesite.c: create_divesite_uuid()
>
> i think i found a potential problem. the cast at the end of the
> function can have different results on big/little endian machines,
> while i'm pretty sure we want the same result on both.
>
> if the first 4 bytes of the SHA1 are:
> 01 02 03 04
>
> we want them serialized in the XML always as:
> <site uuid=''01020304" .../>
>
> on big endian machines that will be the result, while on little endian
> the result would be:
> <site uuid=''04030201" .../>
Since most systems are little endian these days (at least most systems
people run Subsurface on) I think we should standardize on the little
endian order.
So in order to keep things unchanged for everyone on a PC, can you send a
modified patch that forces little endian order?
Thanks
/D
More information about the subsurface
mailing list