From: David Wells Date: Mon, 13 Dec 2021 17:31:57 +0000 (-0500) Subject: Add some explicit casts to IndexSet. X-Git-Tag: v9.4.0-rc1~744^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=782b2223598404fe703e5bed5171a9844cc2df69;p=dealii.git Add some explicit casts to IndexSet. I tried adding an array PetscInts to an index set and got a sign conversion warning. --- 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; }