[Pythonmac-SIG] calldll: float values?

Jack Jansen jack@oratrix.nl
Fri, 26 Nov 1999 16:52:11 +0100

> I'm trying to use calldll to make an interface to the QD3D library. 
> (Actually, my evil plan is to get it started and then turn it over to 
> Scott Harris.)  I've run into a hitch: calldll doesn't seem to 
> understand floats, and QD3D uses floats all over the place -- both as 
> parameters, and as return values.

I didn't do floats for calldll because the PPC calling convention for floating 
point arguments is different from that for integer arguments. If I remember 
correctly (but it's been some time) the float arguments are passed in floating 
registers in stead of in int registers.

Or, in other words, if a routine has a float argument but I call it (without 
prototypes in scope, etc etc) with an int argument it will receive garbage, 
_not_ the bitpattern that happens to be in the integer. There are apparently 
ways around this (otherwise printf() couldn't be made to work), but I punted 
on it at the time. If someone understands the calling sequence (it's described 
somewhere in Inside Mac, I think it used to be called PowerPC Software or some 
such, and probably also in the CodeWarrior documentation) and explains it to 
me I'll happily add floating point support to calldll.
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm