meiyunyang / chipmunk-physics

Automatically exported from code.google.com/p/chipmunk-physics
MIT License
0 stars 0 forks source link

Patch to fix some strict warnings #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

This patch fixes some warnings if you have a lot of warnings turned on when
developing on the iphone in objective-c.

----

Description of fixes:

Rename of local variable 'index' to 'idx' to prevent a warning about the
variable masking one in global scope.

Change use of 'fabsf' to 'cpfabs' (presumably as intended), to fix warning
about implicit conversion to 32-bit type from 64-bit type when cpFloat is
double.

Change return value of segValueOnAxis from 'float' to 'cpFloat' (presumably
as intended), to fix warning about implicit conversion to 32-bits.

Added prototypes for some internal/private functions to fix warnings about
no prototype for these functions.

Made conversion from cpFloat to int for l, r, b, t in space hash functions
explicit, to prevent warning about implicit conversion to 32-bit type.

Renamed local variable 'id' to 'hashid' in some hash functions, to prevent
warning about the local variable masking objective-c's 'id' type.

Original issue reported on code.google.com by j...@abbott.me.uk on 24 Apr 2009 at 9:07

Attachments:

GoogleCodeExporter commented 8 years ago
I updated this patch, see this new version attached which contains the same 
changes
as the previous version, plus the following:

----

Added easy #if to change between cpFloat being double or single precision.

Cast some constants to cpFloat, to prevent implicit conversion warnings when 
cpFloat
is set to single precision.

Original comment by j...@abbott.me.uk on 25 Apr 2009 at 10:24

Attachments:

GoogleCodeExporter commented 8 years ago
I completely forgot about this patch. Holy crap. Merged the changes. Thank you 
and sorry.

Original comment by slemb...@gmail.com on 25 Nov 2009 at 4:37