Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ContainmentType BoundingBox::Contains(
- BoundingBox box, BoundingSphere sphere )
- {
- ....
- if( box.Minimum.X + radius <= sphere.Center.X &&
- sphere.Center.X <= box.Maximum.X - radius &&
- box.Maximum.X - box.Minimum.X > radius && <<<===
- box.Minimum.Y + radius <= sphere.Center.Y &&
- sphere.Center.Y <= box.Maximum.Y - radius &&
- box.Maximum.Y - box.Minimum.Y > radius &&
- box.Minimum.Z + radius <= sphere.Center.Z &&
- sphere.Center.Z <= box.Maximum.Z - radius &&
- box.Maximum.X - box.Minimum.X > radius) <<<===
- return ContainmentType::Contains;
- ....
- }
- This suspicious code was found in SlimDX project by PVS-Studio static code analyzer.
- Warning message is:
- V501 There are identical sub-expressions 'box.Maximum.X - box.Minimum.X > radius' to the left and to the right of the '&&' operator. boundingbox.cpp 94
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment