Author Topic: Howto Override Default Single in Unprototyped Call?  (Read 1064 times)

0 Members and 1 Guest are viewing this topic.

Mike Lobanovsky

  • Guest
Howto Override Default Single in Unprototyped Call?
« 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

Charles Pegge

  • Guest
Re: Howto Override Default Single in Unprototyped Call?
« Reply #1 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.

Mike Lobanovsky

  • Guest
Re: Howto Override Default Single in Unprototyped Call?
« Reply #2 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?

Charles Pegge

  • Guest
Re: Howto Override Default Single in Unprototyped Call?
« Reply #3 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...

Mike Lobanovsky

  • Guest
Re: Howto Override Default Single in Unprototyped Call?
« Reply #4 on: March 21, 2018, 09:26:39 AM »
Solvable? I'd rather we won't have to subside to a palliation...  :-\