@@ -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,6 @@ 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
-
856
855
}
857
856
}
858
857
// 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,
876
875
template <class PathIterator1 , class PathIterator2 >
877
876
bool path_intersects_path (PathIterator1 &p1, PathIterator2 &p2)
878
877
{
879
-
880
878
typedef PathNanRemover<py::PathIterator> no_nans_t ;
881
879
typedef agg::conv_curve<no_nans_t > curve_t ;
882
880
@@ -901,7 +899,6 @@ bool path_intersects_path(PathIterator1 &p1, PathIterator2 &p2)
901
899
}
902
900
c2.rewind (0 );
903
901
c2.vertex (&x21, &y21);
904
-
905
902
906
903
while (c2.vertex (&x22, &y22) != agg::path_cmd_stop) {
907
904
// if the segment in path 2 is (almost) 0 length, skip to next vertex
@@ -1147,16 +1144,15 @@ bool __convert_to_string(PathIterator &path,
1147
1144
double last_x = 0.0 ;
1148
1145
double last_y = 0.0 ;
1149
1146
1150
- int size = 0 ;
1151
1147
unsigned code;
1152
1148
1153
1149
while ((code = path.vertex (&x[0 ], &y[0 ])) != agg::path_cmd_stop) {
1154
1150
if (code == CLOSEPOLY) {
1155
1151
buffer += codes[4 ];
1156
1152
} else if (code < 5 ) {
1157
- size = NUM_VERTICES[code];
1153
+ size_t size = NUM_VERTICES[code];
1158
1154
1159
- for (int i = 1 ; i < size; ++i) {
1155
+ for (size_t i = 1 ; i < size; ++i) {
1160
1156
unsigned subcode = path.vertex (&x[i], &y[i]);
1161
1157
if (subcode != code) {
1162
1158
return false ;
@@ -1176,7 +1172,7 @@ bool __convert_to_string(PathIterator &path,
1176
1172
buffer += ' ' ;
1177
1173
}
1178
1174
1179
- for (int i = 0 ; i < size; ++i) {
1175
+ for (size_t i = 0 ; i < size; ++i) {
1180
1176
__add_number (x[i], format_code, precision, buffer);
1181
1177
buffer += ' ' ;
1182
1178
__add_number (y[i], format_code, precision, buffer);
0 commit comments