[ODE] Wrong brackets in definition of dSqrt in common.h ?

Jon Watte (ODE) hplus-ode at mindcontrol.org
Wed Dec 14 15:38:20 MST 2005


Answering more than one message here:

> I noticed that all the macros use the float (not double) versions of the 
> functions (IE: sqrtf as opposed to sqrt) those of us still on 32 bit 
> machines
> would not be affected by just removing the casts, so before I just 
> remove them... is there a reason for those casts to be there? It seems 
> to me that they're rather redundant.

I beleive they remove warnings from the MSVC 7.1 compiler. Especially 
when passing in literals (like 2.0), that compiler is really anal.

 > :-)  Are you saying I'm awkward and it's my fault because I use a C
 > compiler to compile C ?  ROTFL

It's not clear to me that dSqrt() is an officially exported function 
that's intended to be part of the "C" API. However, if it is, then yes, 
the cast needs to be made right. (In fact, even if it isn't, just fixing 
the cast ought to be done)

The right definition should be sqrtf() for the dSINGLE version and 
sqrt() for the DOUBLE version, if they aren't already, btw.

Cheers,

			 / h+


More information about the ODE mailing list