Gabriel Striewe wrote:
> Fl_Preferences.cxx: In static member function 'static const char* 
> Fl_Preferences::newUUID()':
> Fl_Preferences.cxx:140:37: error: cast from 'time_t*' to 'unsigned int' loses 
> precision

        Sounds like it's this section:

  if(got_uuid == 0) { // did not make a UUID - use fallback logic
    unsigned char b[16];
    time_t t = time(0); // first 4 byte
    b[0] = (unsigned char)t;
    b[1] = (unsigned char)(t>>8);
    b[2] = (unsigned char)(t>>16);
    b[3] = (unsigned char)(t>>24);
    int r = rand(); // four more bytes
    b[4] = (unsigned char)r;
    b[5] = (unsigned char)(r>>8);
    b[6] = (unsigned char)(r>>16);
    b[7] = (unsigned char)(r>>24);
    unsigned int a = (unsigned int)&t; // four more bytes               <---
    b[8] = (unsigned char)a;                                            <---
    b[9] = (unsigned char)(a>>8);                                       <---
    b[10] = (unsigned char)(a>>16);
    b[11] = (unsigned char)(a>>24);

        It appears it's trying to convert the address of the local variable t
        into separate unsigned bytes to 'pad out' a UUID construction.

        In this case it appears to be immaterial what the 4 bytes are;
        The four bytes above it are even random.

        I imagine due to the compiler, the address of 't' could easily
        be the same on each call since it's a stack variable. Could probably
        just be another random number, or re-arranged with the pointer trick.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to