reactphysics3d icon indicating copy to clipboard operation
reactphysics3d copied to clipboard

Comparing if uint8 is less than 256

Open kencb opened this issue 3 years ago • 2 comments

Comparing if an uint8 is less than 256 is always true so therefore a potential bug. At least one example is comparisons with NB_MAX_CONTACT_POINTS_IN_POTENTIAL_MANIFOLD. In general, eliminating all compiler warnings should be a goal.

kencb avatar Feb 23 '22 14:02 kencb

Sure the comparison is not necessary.

Can I ask you where in the code you have found this comparison?

DanielChappuis avatar Feb 23 '22 15:02 DanielChappuis

CollisionDetectionSystem.cpp, line 1218 if (contactManifoldInfo.nbPotentialContactPoints < NB_MAX_CONTACT_POINTS_IN_POTENTIAL_MANIFOLD)

and line 1283 if (potentialContactManifolds[contactManifoldIndex].nbPotentialContactPoints < NB_MAX_CONTACT_POINTS_IN_POTENTIAL_MANIFOLD)

kencb avatar Feb 23 '22 15:02 kencb

This is not valid anymore in in version v0.10.0 of the library. Thanks a lot for reporting the issue.

DanielChappuis avatar Mar 10 '24 13:03 DanielChappuis