Oxygen Basic

Programming => Problems & Solutions => Topic started by: Mike Lobanovsky on March 21, 2018, 04:47:26 AM

Title: Howto Override Default Single in Unprototyped Call?
Post by: Mike Lobanovsky on March 21, 2018, 04:47:26 AM
Charles,

Since an unprototyped function call would default its floating point argument to a Single, how am I supposed to override this behavior and pass my argument as an explicit Double? (hint: OpenGL)

TIA
Title: Re: Howto Override Default Single in Unprototyped Call?
Post by: Charles Pegge on March 21, 2018, 05:55:06 AM
Hi Mike,

You can prefix convert double to the param expression or value.

Better still, just say double ... But this requires the next release of Oxygen.dll, which I hope will be out later today.
Title: Re: Howto Override Default Single in Unprototyped Call?
Post by: Mike Lobanovsky on March 21, 2018, 06:22:25 AM
Great!

Will double (or convert double) actually preserve the original double precision losslessly or rather regard it as a cast and simply expand the lossy default conversion to 64 bits?
Title: Re: Howto Override Default Single in Unprototyped Call?
Post by: Charles Pegge on March 21, 2018, 06:57:00 AM
Yes the param expression is processed first and then overrides the default type. But I see a lttle problem with cdecl stack cleanup after doubles...
Title: Re: Howto Override Default Single in Unprototyped Call?
Post by: Mike Lobanovsky on March 21, 2018, 09:26:39 AM
Solvable? I'd rather we won't have to subside to a palliation...  :-\