From a509860418b3ae3867318ce10bfaf74902de8230 Mon Sep 17 00:00:00 2001 From: bangerth Date: Sat, 13 Dec 2008 17:35:18 +0000 Subject: [PATCH] Add a cast to make a conversion valid in code that's dead. git-svn-id: https://svn.dealii.org/trunk@17930 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/grid/tria_accessor.templates.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/deal.II/deal.II/include/grid/tria_accessor.templates.h b/deal.II/deal.II/include/grid/tria_accessor.templates.h index 19f95e2e4b..a12f67684c 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.templates.h +++ b/deal.II/deal.II/include/grid/tria_accessor.templates.h @@ -1392,8 +1392,19 @@ TriaAccessor::refinement_case() const return (static_cast > (this->objects().children[this->present_index] != -1 ? - RefinementCase<1>::cut_x : - RefinementCase<1>::no_refinement)); + // cast the branches + // here first to uchar + // and then (above) to + // RefinementCase + // so that the + // conversion is valid + // even for the case + // structdim>1 (for + // which this part of + // the code is dead + // anyway) + static_cast(RefinementCase<1>::cut_x) : + static_cast(RefinementCase<1>::no_refinement))); default: Assert (static_cast (this->present_index) < -- 2.39.5