Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 05922da

Browse files
committed
Fix types in _path.h
1 parent a9dd8b9 commit 05922da

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/_path.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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,7 @@ 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-
855+
856856
}
857857
}
858858
// 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,
876876
template <class PathIterator1, class PathIterator2>
877877
bool path_intersects_path(PathIterator1 &p1, PathIterator2 &p2)
878878
{
879-
879+
880880
typedef PathNanRemover<py::PathIterator> no_nans_t;
881881
typedef agg::conv_curve<no_nans_t> curve_t;
882882

@@ -901,7 +901,7 @@ bool path_intersects_path(PathIterator1 &p1, PathIterator2 &p2)
901901
}
902902
c2.rewind(0);
903903
c2.vertex(&x21, &y21);
904-
904+
905905

906906
while (c2.vertex(&x22, &y22) != agg::path_cmd_stop) {
907907
// if the segment in path 2 is (almost) 0 length, skip to next vertex
@@ -1147,7 +1147,7 @@ bool __convert_to_string(PathIterator &path,
11471147
double last_x = 0.0;
11481148
double last_y = 0.0;
11491149

1150-
int size = 0;
1150+
size_t size = 0;
11511151
unsigned code;
11521152

11531153
while ((code = path.vertex(&x[0], &y[0])) != agg::path_cmd_stop) {
@@ -1156,7 +1156,7 @@ bool __convert_to_string(PathIterator &path,
11561156
} else if (code < 5) {
11571157
size = NUM_VERTICES[code];
11581158

1159-
for (int i = 1; i < size; ++i) {
1159+
for (size_t i = 1; i < size; ++i) {
11601160
unsigned subcode = path.vertex(&x[i], &y[i]);
11611161
if (subcode != code) {
11621162
return false;
@@ -1176,7 +1176,7 @@ bool __convert_to_string(PathIterator &path,
11761176
buffer += ' ';
11771177
}
11781178

1179-
for (int i = 0; i < size; ++i) {
1179+
for (size_t i = 0; i < size; ++i) {
11801180
__add_number(x[i], format_code, precision, buffer);
11811181
buffer += ' ';
11821182
__add_number(y[i], format_code, precision, buffer);

0 commit comments

Comments
 (0)