From 0adf380a4baa2e879279e35b9a5b48fb7d860444 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 28 Jan 2018 08:56:08 +1100 Subject: Backport: Use std::abs in preference to abs as std::abs is generic and abs casts to int which may drop information. Backport of changeset 6434:ed27432729c3. --- src/Document.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Document.cxx') diff --git a/src/Document.cxx b/src/Document.cxx index 90dfb52bc..30295ae04 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -881,7 +882,7 @@ Sci::Position Document::GetRelativePositionUTF16(Sci::Position positionStart, Sc const Sci::Position posNext = NextPosition(pos, increment); if (posNext == pos) return INVALID_POSITION; - if (abs(pos-posNext) > 3) // 4 byte character = 2*UTF16. + if (std::abs(pos-posNext) > 3) // 4 byte character = 2*UTF16. characterOffset -= increment; pos = posNext; characterOffset -= increment; -- cgit v1.2.3