@@ -840,7 +840,7 @@ inline bool segments_intersect(const double &x1,
840840
841841 // If den == 0 we have two possibilities:
842842 if (isclose (den, 0.0 )) {
843- float t_area = (x2*y3 - x3*y2) - x1*(y3 - y2) + y1*(x3 - x2);
843+ double t_area = (x2*y3 - x3*y2) - x1*(y3 - y2) + y1*(x3 - x2);
844844 // 1 - If the area of the triangle made by the 3 first points (2 from the first segment
845845 // plus one from the second) is zero, they are collinear
846846 if (isclose (t_area, 0.0 )) {
@@ -852,7 +852,6 @@ inline bool segments_intersect(const double &x1,
852852 else {
853853 return (fmin (x1, x2) <= fmin (x3, x4) && fmin (x3, x4) <= fmax (x1, x2)) ||
854854 (fmin (x3, x4) <= fmin (x1, x2) && fmin (x1, x2) <= fmax (x3, x4));
855-
856855 }
857856 }
858857 // 2 - If t_area is not zero, the segments are parallel, but not collinear
@@ -876,7 +875,6 @@ inline bool segments_intersect(const double &x1,
876875template <class PathIterator1 , class PathIterator2 >
877876bool path_intersects_path (PathIterator1 &p1, PathIterator2 &p2)
878877{
879-
880878 typedef PathNanRemover<py::PathIterator> no_nans_t ;
881879 typedef agg::conv_curve<no_nans_t > curve_t ;
882880
@@ -901,7 +899,6 @@ bool path_intersects_path(PathIterator1 &p1, PathIterator2 &p2)
901899 }
902900 c2.rewind (0 );
903901 c2.vertex (&x21, &y21);
904-
905902
906903 while (c2.vertex (&x22, &y22) != agg::path_cmd_stop) {
907904 // if the segment in path 2 is (almost) 0 length, skip to next vertex
@@ -1147,16 +1144,15 @@ bool __convert_to_string(PathIterator &path,
11471144 double last_x = 0.0 ;
11481145 double last_y = 0.0 ;
11491146
1150- int size = 0 ;
11511147 unsigned code;
11521148
11531149 while ((code = path.vertex (&x[0 ], &y[0 ])) != agg::path_cmd_stop) {
11541150 if (code == CLOSEPOLY) {
11551151 buffer += codes[4 ];
11561152 } else if (code < 5 ) {
1157- size = NUM_VERTICES[code];
1153+ size_t size = NUM_VERTICES[code];
11581154
1159- for (int i = 1 ; i < size; ++i) {
1155+ for (size_t i = 1 ; i < size; ++i) {
11601156 unsigned subcode = path.vertex (&x[i], &y[i]);
11611157 if (subcode != code) {
11621158 return false ;
@@ -1176,7 +1172,7 @@ bool __convert_to_string(PathIterator &path,
11761172 buffer += ' ' ;
11771173 }
11781174
1179- for (int i = 0 ; i < size; ++i) {
1175+ for (size_t i = 0 ; i < size; ++i) {
11801176 __add_number (x[i], format_code, precision, buffer);
11811177 buffer += ' ' ;
11821178 __add_number (y[i], format_code, precision, buffer);
0 commit comments