byte-order of generated divesite UUIDs
Lubomir I. Ivanov
neolit123 at gmail.com
Thu Oct 1 10:16:03 PDT 2015
On 1 October 2015 at 19:55, Dirk Hohndel <dirk at hohndel.org> wrote:
> 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?
>
sure thing! :-)
here is the updated patch.
lubomir
--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-divesite.c-preserve-byte-order-in-create_divesite_uu.patch
Type: text/x-patch
Size: 1198 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20151001/5dcfd0f4/attachment.bin>
More information about the subsurface
mailing list