From bd0b2e98adea5483741a0bad26cf7ece07c685cd Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Fri, 22 Nov 2024 10:55:40 +1300 Subject: [PATCH] Use SIZE_MAX instead of -1 for size_t variable. --- tests/test_utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_utils.cpp b/tests/test_utils.cpp index 5910d20e8..c4662caa9 100644 --- a/tests/test_utils.cpp +++ b/tests/test_utils.cpp @@ -91,7 +91,7 @@ static const std::string FIXED_INDENT = " "; void printComponent(const libcellml::ComponentPtr &component, size_t c, const std::string &indent, bool includeMaths) { - if (c == size_t(-1)) { + if (c == SIZE_MAX) { std::cout << "COMPONENT: '" << component->name() << "'"; } else { std::cout << indent << "[" << c + 1 << "]: " << component->name(); @@ -162,7 +162,7 @@ void printComponent(const libcellml::ComponentPtr &component, size_t c, const st void printComponent(const libcellml::ComponentPtr &component, bool includeMaths) { - printComponent(component, -1, {}, includeMaths); + printComponent(component, SIZE_MAX, {}, includeMaths); } void printModel(const libcellml::ModelPtr &model, bool includeMaths)