From 6c23092c73d9ae7c15a571242b5575571dd41670 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 21 Jan 2023 18:15:33 -0500 Subject: [PATCH] ReferenceCell: use std::numeric_limits. --- include/deal.II/grid/reference_cell.h | 7 ++++--- source/grid/reference_cell.cc | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index d8a6e4e7d8..e7f7e916fe 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -879,7 +879,7 @@ namespace internal #ifndef DEAL_II_CXX14_CONSTEXPR_BUG // Make sure these are the only indices from which objects can be // created. - Assert((kind == static_cast(-1)) || (kind < 8), + Assert((kind == std::numeric_limits::max()) || (kind < 8), ExcInternalError()); #endif @@ -917,7 +917,8 @@ namespace ReferenceCells constexpr const ReferenceCell Hexahedron = internal::make_reference_cell_from_int(7); constexpr const ReferenceCell Invalid = - internal::make_reference_cell_from_int(static_cast(-1)); + internal::make_reference_cell_from_int( + std::numeric_limits::max()); /** * Return the correct simplex reference cell type for the given dimension @@ -2776,7 +2777,7 @@ ReferenceCell::get_orientation_index(const ArrayView &vertices_0, } Assert(false, (internal::NoPermutation(*this, vertices_0, vertices_1))); - return numbers::invalid_unsigned_int; + return std::numeric_limits::max(); } diff --git a/source/grid/reference_cell.cc b/source/grid/reference_cell.cc index 3ae63c4556..83e75fffdc 100644 --- a/source/grid/reference_cell.cc +++ b/source/grid/reference_cell.cc @@ -41,7 +41,7 @@ namespace { // Define VTK constants for linear, quadratic and // high-order Lagrange geometrices - enum + enum : unsigned int { VTK_VERTEX = 1, // Linear cells @@ -69,7 +69,7 @@ namespace VTK_LAGRANGE_WEDGE = 73, VTK_LAGRANGE_PYRAMID = 74, // Invalid code - VTK_INVALID = static_cast(-1) + VTK_INVALID = numbers::invalid_unsigned_int }; } // namespace VTKCellType -- 2.39.5