[Libreoffice-commits] core.git: include/o3tl

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 15 09:46:38 UTC 2021


 include/o3tl/unit_conversion.hxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 76483d1348792a3d1c4c995ef0132ac79dfbc90f
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Feb 15 11:37:34 2021 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Feb 15 10:45:49 2021 +0100

    Fix comments
    
    Change-Id: Id3943df147a204391e206d663e0a71b43ded50a8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110895
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/include/o3tl/unit_conversion.hxx b/include/o3tl/unit_conversion.hxx
index e43ecb557789..f377b16e8b10 100644
--- a/include/o3tl/unit_conversion.hxx
+++ b/include/o3tl/unit_conversion.hxx
@@ -50,8 +50,8 @@ enum class Length
 // If other categories of units would be needed (like time), a separate scoped enum
 // should be created, respective conversion array prepared in detail namespace, and
 // respective md(NewUnit, NewUnit) overload introduced, which would allow using
-// o3tl::convert() and o3tl::convertSanitize() with the new category in a type-safe
-// way, without mixing unrelated units.
+// o3tl::convert(), o3tl::convertSaturate() and o3tl::getConversionMulDiv() with the
+// new category in a type-safe way, without mixing unrelated units.
 
 namespace detail
 {
@@ -206,7 +206,7 @@ template <typename N, typename U> constexpr auto convert(N n, U from, U to)
 }
 
 // Returns nDefault if intermediate multiplication overflows sal_Int64 (only for integral types).
-// On return, bOverflow indicates if overflow happened.
+// On return, bOverflow indicates if overflow happened. nDefault is returned when overflow occurs.
 template <typename N, typename U>
 constexpr auto convert(N n, U from, U to, bool& bOverflow, sal_Int64 nDefault = 0)
 {
@@ -214,7 +214,7 @@ constexpr auto convert(N n, U from, U to, bool& bOverflow, sal_Int64 nDefault =
 }
 
 // Conversion with saturation (only for integral types). For too large input returns SAL_MAX_INT64.
-// When intermediate multiplication would overflow, but otherwise result in in sal_Int64 range, the
+// When intermediate multiplication would overflow, but the end result is in sal_Int64 range, the
 // precision is decreased because of inversion of multiplication and division.
 template <typename N, typename U> constexpr auto convertSaturate(N n, U from, U to)
 {


More information about the Libreoffice-commits mailing list