diff --git a/src/logdata/include/linepositionarray.h b/src/logdata/include/linepositionarray.h index ec5f4b89..e45c2c4b 100644 --- a/src/logdata/include/linepositionarray.h +++ b/src/logdata/include/linepositionarray.h @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -100,10 +101,11 @@ class SimpleLinePositionStorage { { klogg::vector result; result.reserve( count.get() ); - size_t beginIndex = firstLine.get(); - size_t endIndex = std::min( beginIndex + count.get(), storage_.size() ); + const int64_t beginIndex = static_cast( firstLine.get() ); + const int64_t endIndex = std::min( beginIndex + static_cast( count.get() ), + static_cast( storage_.size() ) ); - std::copy_n( storage_.begin() + static_cast( beginIndex ), endIndex - beginIndex, + std::copy_n( storage_.begin() + beginIndex, endIndex - beginIndex, std::back_inserter( result ) ); return result; @@ -186,8 +188,9 @@ class LinePosition { return pos; } - klogg::vector range( LineNumber firstLine, LinesCount count ) const { - return array.range(firstLine, count); + klogg::vector range( LineNumber firstLine, LinesCount count ) const + { + return array.range( firstLine, count ); } // Set the presence of a fake final LF