diff --git a/src/doc/algorithm/floodfill.cpp b/src/doc/algorithm/floodfill.cpp index ed945be78..788df8d33 100644 --- a/src/doc/algorithm/floodfill.cpp +++ b/src/doc/algorithm/floodfill.cpp @@ -24,21 +24,19 @@ #include #include +#include #include namespace doc { namespace algorithm { struct FLOODED_LINE { // store segments which have been flooded - short flags; // status of the segment - short lpos, rpos; // left and right ends of segment - short y; // y coordinate of the segment + char flags; // status of the segment + int lpos, rpos; // left and right ends of segment + int y; // y coordinate of the segment int next; // linked list if several per line }; -/* Note: a 'short' is not sufficient for 'next' above in some corner cases. */ - - static std::vector flood_buf; static int flood_count; /* number of flooded segments */ @@ -415,8 +413,8 @@ void floodfill(const Image* image, FLOODED_LINE* p = (FLOODED_LINE*)&flood_buf[0]; for (int c=0; c::max(); + p[c].rpos = std::numeric_limits::min(); p[c].y = y; p[c].next = 0; }