@@ -67,7 +67,7 @@ struct XY
6767template <class PathIterator , class PointArray , class ResultArray >
6868void point_in_path_impl (PointArray &points, PathIterator &path, ResultArray &inside_flag)
6969{
70- int yflag1;
70+ bool yflag1;
7171 double vtx0, vty0, vtx1, vty1;
7272 double tx, ty;
7373 double sx, sy;
@@ -77,13 +77,13 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
7777
7878 size_t n = points.size ();
7979
80- std::vector<int > yflag0 (n);
81- std::vector<int > subpath_flag (n);
80+ std::vector<bool > yflag0 (n);
81+ std::vector<bool > subpath_flag (n);
8282
8383 path.rewind (0 );
8484
8585 for (i = 0 ; i < n; ++i) {
86- inside_flag[i] = 0 ;
86+ inside_flag[i] = false ;
8787 }
8888
8989 unsigned code = 0 ;
@@ -106,7 +106,7 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
106106 // get test bit for above/below X axis
107107 yflag0[i] = (vty0 >= ty);
108108
109- subpath_flag[i] = 0 ;
109+ subpath_flag[i] = false ;
110110 }
111111 }
112112
@@ -152,7 +152,7 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
152152 // Haigh-Hutchinson's different polygon inclusion
153153 // tests.
154154 if (((vty1 - ty) * (vtx0 - vtx1) >= (vtx1 - tx) * (vty0 - vty1)) == yflag1) {
155- subpath_flag[i] ^= 1 ;
155+ subpath_flag[i] = subpath_flag[i] ^ true ;
156156 }
157157 }
158158
@@ -181,11 +181,11 @@ void point_in_path_impl(PointArray &points, PathIterator &path, ResultArray &ins
181181 yflag1 = (vty1 >= ty);
182182 if (yflag0[i] != yflag1) {
183183 if (((vty1 - ty) * (vtx0 - vtx1) >= (vtx1 - tx) * (vty0 - vty1)) == yflag1) {
184- subpath_flag[i] ^= 1 ;
184+ subpath_flag[i] = subpath_flag[i] ^ true ;
185185 }
186186 }
187- inside_flag[i] |= subpath_flag[i];
188- if (inside_flag[i] == 0 ) {
187+ inside_flag[i] = inside_flag[i] || subpath_flag[i];
188+ if (inside_flag[i] == false ) {
189189 all_done = false ;
190190 }
191191 }
@@ -210,7 +210,7 @@ inline void points_in_path(PointArray &points,
210210
211211 size_t i;
212212 for (i = 0 ; i < result.size (); ++i) {
213- result[i] = 0 ;
213+ result[i] = false ;
214214 }
215215
216216 if (path.total_vertices () < 3 ) {
@@ -236,8 +236,8 @@ inline bool point_in_path(
236236 point.push_back (y);
237237 points.push_back (point);
238238
239- std::vector<uint8_t > result (1 );
240- result[0 ] = 0 ;
239+ std::vector<bool > result (1 );
240+ result[0 ] = false ;
241241
242242 points_in_path (points, r, path, trans, result);
243243
@@ -258,7 +258,7 @@ void points_on_path(PointArray &points,
258258
259259 size_t i;
260260 for (i = 0 ; i < result.size (); ++i) {
261- result[i] = 0 ;
261+ result[i] = false ;
262262 }
263263
264264 transformed_path_t trans_path (path, trans);
@@ -279,8 +279,8 @@ inline bool point_on_path(
279279 point.push_back (y);
280280 points.push_back (point);
281281
282- std::vector<uint8_t > result (1 );
283- result[0 ] = 0 ;
282+ std::vector<bool > result (1 );
283+ result[0 ] = false ;
284284
285285 points_on_path (points, r, path, trans, result);
286286
0 commit comments