[ODE] Wrong brackets in definition of dSqrt in common.h ?
Rodrigo Hernandez
kwizatz at aeongames.com
Tue Dec 13 15:15:45 MST 2005
That's a function-call style cast, acording to Wikipedia
(http://en.wikipedia.org/wiki/Type_conversion) its the C++ way of doing
type casting (though C style is still supported).
I am curious as to what code does the preprocessor generates for dSqrt
in AMD 64.
Peter Onion wrote:
>I have not got to the bottom of this yet but.....
>
>I'm just building some existing working ODE code on my new AMD 64 box
>and I got this error from gcc.....
>
>Drawers2.c: In function ‘timeout’:
>Drawers2.c:232: error: syntax error before ‘float’
>
>line 232:
> distance = dDISTANCE(posn3,force3);
>
>
>I think the problem is coming from the declaration of dSqrt used in
>dDistance.
>
>dSqrt in defined in common.h as
>#define dSqrt(x) ((float)sqrtf(float(x)))
>which looks odd as I don't think there is not function called "float".
>I think it should be
>#define dSqrt(x) ((float)sqrtf((float)(x)))
>which atleast compiles in the 64 bit box.
>I'm not sure why it ever compiled in the original form!
>
>The gcc on this box is
>gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)
>
>Peter
>
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode
>
>
More information about the ODE
mailing list