@@ -840,7 +840,7 @@ inline bool segments_intersect(const double &x1,
840
840
841
841
// If den == 0 we have two possibilities:
842
842
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);
844
844
// 1 - If the area of the triangle made by the 3 first points (2 from the first segment
845
845
// plus one from the second) is zero, they are collinear
846
846
if (isclose (t_area, 0.0 )) {
@@ -852,7 +852,7 @@ inline bool segments_intersect(const double &x1,
852
852
else {
853
853
return (fmin (x1, x2) <= fmin (x3, x4) && fmin (x3, x4) <= fmax (x1, x2)) ||
854
854
(fmin (x3, x4) <= fmin (x1, x2) && fmin (x1, x2) <= fmax (x3, x4));
855
-
855
+
856
856
}
857
857
}
858
858
// 2 - If t_area is not zero, the segments are parallel, but not collinear
@@ -876,7 +876,7 @@ inline bool segments_intersect(const double &x1,
876
876
template <class PathIterator1 , class PathIterator2 >
877
877
bool path_intersects_path (PathIterator1 &p1, PathIterator2 &p2)
878
878
{
879
-
879
+
880
880
typedef PathNanRemover<py::PathIterator> no_nans_t ;
881
881
typedef agg::conv_curve<no_nans_t > curve_t ;
882
882
@@ -901,7 +901,7 @@ bool path_intersects_path(PathIterator1 &p1, PathIterator2 &p2)
901
901
}
902
902
c2.rewind (0 );
903
903
c2.vertex (&x21, &y21);
904
-
904
+
905
905
906
906
while (c2.vertex (&x22, &y22) != agg::path_cmd_stop) {
907
907
// if the segment in path 2 is (almost) 0 length, skip to next vertex
@@ -1147,7 +1147,7 @@ bool __convert_to_string(PathIterator &path,
1147
1147
double last_x = 0.0 ;
1148
1148
double last_y = 0.0 ;
1149
1149
1150
- int size = 0 ;
1150
+ size_t size = 0 ;
1151
1151
unsigned code;
1152
1152
1153
1153
while ((code = path.vertex (&x[0 ], &y[0 ])) != agg::path_cmd_stop) {
@@ -1156,7 +1156,7 @@ bool __convert_to_string(PathIterator &path,
1156
1156
} else if (code < 5 ) {
1157
1157
size = NUM_VERTICES[code];
1158
1158
1159
- for (int i = 1 ; i < size; ++i) {
1159
+ for (size_t i = 1 ; i < size; ++i) {
1160
1160
unsigned subcode = path.vertex (&x[i], &y[i]);
1161
1161
if (subcode != code) {
1162
1162
return false ;
@@ -1176,7 +1176,7 @@ bool __convert_to_string(PathIterator &path,
1176
1176
buffer += ' ' ;
1177
1177
}
1178
1178
1179
- for (int i = 0 ; i < size; ++i) {
1179
+ for (size_t i = 0 ; i < size; ++i) {
1180
1180
__add_number (x[i], format_code, precision, buffer);
1181
1181
buffer += ' ' ;
1182
1182
__add_number (y[i], format_code, precision, buffer);
0 commit comments