diff --git a/external/resinsight/LibGeometry/cvfRay.cpp b/external/resinsight/LibGeometry/cvfRay.cpp index 088ef7c7a..8fb7da149 100644 --- a/external/resinsight/LibGeometry/cvfRay.cpp +++ b/external/resinsight/LibGeometry/cvfRay.cpp @@ -283,7 +283,7 @@ bool Ray::boxIntersect(const BoundingBox& box, Vec3d* intersectionPoint) const // Find candidate planes; this loop can be avoided if rays cast all from the eye(assume perpsective view) bool inside = true; - char quadrant[3]; + char quadrant[3]{}; double candidatePlane[3] = {0.0, 0.0, 0.0}; Vec3d min = box.min(); @@ -320,17 +320,13 @@ bool Ray::boxIntersect(const BoundingBox& box, Vec3d* intersectionPoint) const } // Calculate T distances to candidate planes - double maxT[3]; + double maxT[3]{-1.0f, -1.0f, -1.0f}; for (i = 0; i < 3; i++) { if (quadrant[i] != MIDDLE && m_direction[i] !=0.0f) { maxT[i] = (candidatePlane[i] - m_origin[i]) / m_direction[i]; } - else - { - maxT[i] = -1.0f; - } } // Get largest of the maxT's for final choice of intersection diff --git a/external/resinsight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp b/external/resinsight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp index 9e36c8fb9..58023d5c9 100644 --- a/external/resinsight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp +++ b/external/resinsight/cafHexGridIntersectionTools/cafHexGridIntersectionTools.cpp @@ -1084,7 +1084,7 @@ int HexGridIntersectionTools::planeHexIntersectionMC( const cvf::Plane& plane } cvf::Vec3d edgeIntersections[12]; - double normDistAlongEdge[12]; + double normDistAlongEdge[12]{}; // Compute vertex coordinates on the edges where we have intersections if ( cubeIdxToCutEdgeBitfield[cubeIndex] & 1 )