From: maier Date: Sun, 11 Nov 2012 11:30:10 +0000 (+0000) Subject: Take over r27495 from branch_cmake: X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb3551c193bbe67c9e9b375955259e90be7b253a;p=dealii-svn.git Take over r27495 from branch_cmake: Silence -Warray-bounds warnings for clang git-svn-id: https://svn.dealii.org/trunk@27500 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/base/point.h b/deal.II/include/deal.II/base/point.h index a87204fe21..b94c66b704 100644 --- a/deal.II/include/deal.II/base/point.h +++ b/deal.II/include/deal.II/base/point.h @@ -224,8 +224,12 @@ template inline Point::Point (const Number x) { - Assert (dim==1, StandardExceptions::ExcInvalidConstructorCall()); - this->values[0] = x; + switch(dim) { + case 1: + this->values[0] = x; + default: + Assert (dim==1, StandardExceptions::ExcInvalidConstructorCall()); + } } @@ -234,9 +238,13 @@ template inline Point::Point (const Number x, const Number y) { - Assert (dim==2, StandardExceptions::ExcInvalidConstructorCall()); - this->values[0] = x; - this->values[1] = y; + switch(dim) { + case 2: + this->values[0] = x; + this->values[1] = y; + default: + Assert (dim==2, StandardExceptions::ExcInvalidConstructorCall()); + } } @@ -245,10 +253,14 @@ template inline Point::Point (const Number x, const Number y, const Number z) { - Assert (dim==3, StandardExceptions::ExcInvalidConstructorCall()); - this->values[0] = x; - this->values[1] = y; - this->values[2] = z; + switch(dim) { + case 3: + this->values[0] = x; + this->values[1] = y; + this->values[2] = z; + default: + Assert (dim==3, StandardExceptions::ExcInvalidConstructorCall()); + } }