Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix compiler warning. #1

Merged
merged 1 commit into from

2 participants

@spritesun

fix compiler warning by changing int to float.

@chrismiles chrismiles merged commit 6fc5859 into chrismiles:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 20, 2012
  1. fix error: comparing floating point with == or != is unsafe [-Werror,…

    Long Sun authored
    …-Wfloat-equal]
This page is out of date. Refresh to see the latest.
View
2  CMTraerPhysics/CMTPParticleSystem.m
@@ -113,7 +113,7 @@ - (void)applyForces
NSUInteger c_length = [custom count];
// Effects of gravity
- if ( gravity.x != 0 || gravity.y != 0 || gravity.x != 0) {
+ if ( gravity.x != 0.0f || gravity.y != 0.0f || gravity.x != 0.0f) {
for (i=0; i<p_length; i++) {
CMTPParticle *p = [particles objectAtIndex:i];
p.force = CMTPVector3DAdd(p.force, gravity);
View
2  CMTraerPhysics/CMTPSpring.m
@@ -95,7 +95,7 @@ - (void)apply
CMTPFloat a2bDistance = sqrtf(a2bX*a2bX + a2bY*a2bY + a2bZ*a2bZ);
- if (a2bDistance == 0) {
+ if (a2bDistance == 0.0f) {
a2bX = 0;
a2bY = 0;
Something went wrong with that request. Please try again.