CallFunctionFast cast to int?

Everything else that doesn't fall into one of the other PB categories.
Motu
Enthusiast
Enthusiast
Posts: 160
Joined: Tue Oct 19, 2004 12:24 pm

CallFunctionFast cast to int?

Post 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.
User avatar
Arctic Fox
Enthusiast
Enthusiast
Posts: 609
Joined: Sun Dec 21, 2008 5:02 pm
Location: Aarhus, Denmark

Re: CallFunctionFast cast to int?

Post 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.
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Re: CallFunctionFast cast to int?

Post by Rings »

moved, as its not a BugReport
SPAMINATOR NR.1
freak
PureBasic Team
PureBasic Team
Posts: 5962
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: CallFunctionFast cast to int?

Post 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.
quidquid Latine dictum sit altum videtur
Fred
Administrator
Administrator
Posts: 18556
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: CallFunctionFast cast to int?

Post by Fred »

Use prototypes, it's safer, smaller and faster.
Post Reply