Gabriel Striewe wrote:
> ../FL/Fl_Widget.H: In member function 'long int Fl_Widget::argument() const':
> ../FL/Fl_Widget.H:158:39: error: cast from 'void*' to 'long int' loses
> precision
Note to devs: same issue exists in 1.3.x, since it's complaining about
this line:
FLTK 1.1.10: long argument() const {return (long)user_data_;}
FLTK 1.3.x: long argument() const {return (long)user_data_;}
I believe in OP's context, 'void*' is 64bit, but long is 32bit.
In this usage it should be OK, as the void* is being used as
storage for a long, so the fact that it's larger than the data
we're storing shouldn't be an issue in this case; as long as the
value in the void* is a long, no precision loss should occur
if we take it back out as a long, assuming void* is large enough
(which it is in this case).
This ugly hack might sufficiently fool the compiler, at least
for another 10 years, LOL:
long argument() const {return *((long*)user_data_);}
I'm not sure what the 'right' solution is, or if there even
is one for what's being done here.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk