From: David Wells Date: Sat, 21 Jan 2023 23:15:33 +0000 (-0500) Subject: ReferenceCell: use std::numeric_limits. X-Git-Tag: v9.5.0-rc1~612^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c23092c73d9ae7c15a571242b5575571dd41670;p=dealii.git ReferenceCell: use std::numeric_limits. --- 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