Page 1 of 1

CallFunctionFast cast to int?

Posted: Tue Dec 22, 2009 4:52 pm
by Motu
in the update log you find a little entry called:

- Changed: Call(C)Function(Fast) parameters have been changed from 'Any' to 'Integer'.

why that? It's simply wrong to cast 32bit floats in a callfunctionfast to int. For example take a look inside the directX documention:

D3DXMatrixRotationYawPitchRoll or D3DXMatrixTranslation - both function take 32bit floats as parameter. With this change in the update you can no longer use callfunctionfast to use these function. Please turn it back... It's a pain in the a** when you work a lot with the win32 api or directX directly.

Yes, I know that I can use prototyps, anyway, this casting behavior is wrong.

Re: CallFunctionFast cast to int?

Posted: Tue Dec 22, 2009 4:58 pm
by Arctic Fox
Have a look at this thread
http://www.purebasic.fr/english/viewtop ... 13&t=40303

You have to use pointers for your variable parameters.

Re: CallFunctionFast cast to int?

Posted: Tue Dec 22, 2009 6:13 pm
by Rings
moved, as its not a BugReport

Re: CallFunctionFast cast to int?

Posted: Tue Dec 22, 2009 9:31 pm
by freak
This change was made to prevent problems in connection with double and quad types. Prototypes are the proper way to do this anyway.

Re: CallFunctionFast cast to int?

Posted: Wed Dec 23, 2009 10:07 am
by Fred
Use prototypes, it's safer, smaller and faster.