diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-05-31 20:47:59 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-05-31 22:03:22 +0200 |
commit | 4c60697daaecc8be0a00e900ba1b4b62713e43df (patch) | |
tree | c872c47f5d7f8e7941e5a8c378115c404be63523 /slideshow/source/engine/animationnodes/basecontainernode.cxx | |
parent | a77b8b75f015fba74e2553c3cff58fcba298b9ed (diff) |
The return value of std::count_if is guaranteed to be non-negative
...so use o3tl::make_unsigned when comparing it against an expression of
unsigned integer type, instead of casting that expression to a signed type
Change-Id: I487fd04eafbf8c56b8b6bfce579b477d8f34a052
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135206
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'slideshow/source/engine/animationnodes/basecontainernode.cxx')
-rw-r--r-- | slideshow/source/engine/animationnodes/basecontainernode.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/slideshow/source/engine/animationnodes/basecontainernode.cxx b/slideshow/source/engine/animationnodes/basecontainernode.cxx index cde434f3d7bd..709f5392ac8a 100644 --- a/slideshow/source/engine/animationnodes/basecontainernode.cxx +++ b/slideshow/source/engine/animationnodes/basecontainernode.cxx @@ -24,6 +24,7 @@ #include <eventqueue.hxx> #include "nodetools.hxx" #include <delayevent.hxx> +#include <o3tl/safeint.hxx> #include <sal/log.hxx> #include <functional> @@ -80,10 +81,10 @@ bool BaseContainerNode::init_children() mnFinishedChildren = 0; // initialize all children - return (std::count_if( + return (o3tl::make_unsigned(std::count_if( maChildren.begin(), maChildren.end(), - std::mem_fn(&AnimationNode::init) ) == - static_cast<VectorOfNodes::difference_type>(maChildren.size())); + std::mem_fn(&AnimationNode::init) )) == + maChildren.size()); } void BaseContainerNode::deactivate_st( NodeState eDestState ) |