behdad / box2d

Automatically exported from code.google.com/p/box2d
2 stars 12 forks source link

Argument of b2Assert in b2Simplex produces compiler warning #75

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile Box2D in XCode under default  settings

What is the expected output? What do you see instead?
Expect no warning.  
Get warning "comparison is always true due to limited range of data type" at  
line 
70 of b2Distance.cpp

What version of the product are you using? On what operating system?
r39 on Snow Leopard  

Please provide any additional information below.

This issue can be fixed by changing line 70 from:

b2Assert(0 <= cache->count && cache->count <= 3);

to:

b2Assert(0 == cache->count && cache->count <= 3);

since cache->count is an unsigned int, it can never be less than 0.

Original issue reported on code.google.com by mwmerlo@gmail.com on 31 Jan 2010 at 7:33

GoogleCodeExporter commented 9 years ago

Original comment by erinca...@gmail.com on 2 Feb 2010 at 6:17