On 03-Oct-2000 Lars Gullik Bjønnes wrote:
>| 3. We could lose all of those extra CB functions in FormDocument by making
>| use of the "long" variable that is returned. We'd end up with
>|
>| void FormBase::InputCB(FL_OBJECT * ob, long data )
>| {
>| FormBase * pre = static_cast<FormBase*>(ob->form->u_vdata);
>| pre->bc_.valid( pre->input( data ) );
>| }
>
> Please don't do that. (read: Do not do that!)
>
> casting pointers to integers are not safe and not guaranteed to work.
Well Lars this isn't casting pointer, he just uses the long argument
of the callback and redo the input() function with the long argument
insed of the object pointer (IMO we should send both, the object pointer
AND the long argument!) and then uses this long argument!
No casting required! (IMO we don't gain too much with this, but ...)
Jürgen
--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen Vigna E-Mail: [EMAIL PROTECTED]
Italienallee 13/N Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen Web: http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
I don't have any solution but I certainly admire the problem.
-- Ashleigh Brilliant