From 2a5ffea80aacbd6353f4462300e42c8d55ac19e9 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 28 Jul 2022 16:42:17 +1000 Subject: Use extra consts to avoid 32 to 64-bit widening warnings in headers. This change wouldn't be worthwhile in implementation files but warnings in headers obscure more important diagnostics. --- src/RunStyles.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx index ed4ecc216..6d43e6085 100644 --- a/src/RunStyles.cxx +++ b/src/RunStyles.cxx @@ -71,7 +71,8 @@ void RunStyles::RemoveRunIfEmpty(DISTANCE run) { template void RunStyles::RemoveRunIfSameAsPrevious(DISTANCE run) { if ((run > 0) && (run < starts->Partitions())) { - if (styles->ValueAt(run-1) == styles->ValueAt(run)) { + const DISTANCE runBefore = run - 1; + if (styles->ValueAt(runBefore) == styles->ValueAt(run)) { RemoveRun(run); } } @@ -251,7 +252,8 @@ DISTANCE RunStyles::Runs() const noexcept { template bool RunStyles::AllSame() const noexcept { for (DISTANCE run = 1; run < starts->Partitions(); run++) { - if (styles->ValueAt(run) != styles->ValueAt(run - 1)) + const DISTANCE runBefore = run - 1; + if (styles->ValueAt(run) != styles->ValueAt(runBefore)) return false; } return true; -- cgit v1.2.3