From 782b2223598404fe703e5bed5171a9844cc2df69 Mon Sep 17 00:00:00 2001 From: David Wells Date: Mon, 13 Dec 2021 12:31:57 -0500 Subject: [PATCH] Add some explicit casts to IndexSet. I tried adding an array PetscInts to an index set and got a sign conversion warning. --- include/deal.II/base/index_set.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/deal.II/base/index_set.h b/include/deal.II/base/index_set.h index 5d05fe75cd..4cb5d98560 100644 --- a/include/deal.II/base/index_set.h +++ b/include/deal.II/base/index_set.h @@ -1723,7 +1723,7 @@ IndexSet::add_indices(const ForwardIterator &begin, const ForwardIterator &end) size_type end_index = begin_index + 1; ForwardIterator q = p; ++q; - while ((q != end) && (*q == end_index)) + while ((q != end) && (static_cast(*q) == end_index)) { ++end_index; ++q; @@ -1736,7 +1736,7 @@ IndexSet::add_indices(const ForwardIterator &begin, const ForwardIterator &end) // than the end index of the one just identified, then we will have at // least one pair of ranges that are not sorted, and consequently the // whole collection of ranges is not sorted. - if (p != end && *p < end_index) + if (p != end && static_cast(*p) < end_index) ranges_are_sorted = false; } -- 2.39.5