From: bangerth Date: Sat, 13 Dec 2008 17:35:18 +0000 (+0000) Subject: Add a cast to make a conversion valid in code that's dead. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a509860418b3ae3867318ce10bfaf74902de8230;p=dealii-svn.git 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 --- 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) <