[ODE] casting

Bram Stolk bram at sara.nl
Wed Dec 7 01:55:01 MST 2005


Hi,


Shouldn't we be investigating, why those ugly type casts are
there in the first place?

Casting pointers to integer types sounds like weak programming to me.

Also, there are some very silly void* arguments in the API:

dGeomTriMeshDataBuildXXX functions all use void ptrs to pass
vertices, indices and normals. That doesn't sound right.

And if it's really unavoidable, shouldn't we cast like Scott Meyers
tells us to? dynamic_cast<> and static_cast<> is the modern way.

  Bram


Jon Watte (ODE) wrote:
> "long" is still 32 bits on 64 bit Windows. The right type is probably 
> either size_t, or ptrdiff_t, if you don't want to define your own.
> 
> Cheers,
> 
> 			/ h+
> 
> Bill Sellers wrote:
> 
>>Hi, it seems to me that we should use long anytime we cast a pointer  
>>to an integer anyway - at least on gcc this is recommended since long  
>>is 4 bytes on 32 bit systems and 8 bytes on 64 bit systems (and for  
> 
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode


-- 
Bram Stolk, VR Engineer SARA, Amsterdam.   tel +31 20 592 3000

"Windows is a 32-bit extension to a 16-bit graphical shell for an 8-bit
 operating system originally coded for a 4-bit microprocessor by a 2-bit
 company that can't stand 1 bit of competition."


More information about the ODE mailing list