From: kronbichler Date: Wed, 10 Nov 2010 15:29:28 +0000 (+0000) Subject: Avoid compiler warning on zero-sized arrays. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84e87ae10200ed117ece6285e9fbb3096fed8ece;p=dealii-svn.git Avoid compiler warning on zero-sized arrays. git-svn-id: https://svn.dealii.org/trunk@22677 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/base/tensor_product_polynomials.h b/deal.II/include/deal.II/base/tensor_product_polynomials.h index db075ce851..db503e098b 100644 --- a/deal.II/include/deal.II/base/tensor_product_polynomials.h +++ b/deal.II/include/deal.II/base/tensor_product_polynomials.h @@ -54,8 +54,8 @@ DEAL_II_NAMESPACE_OPEN * polynomial space it gives the indices i,j,k of the one-dimensional * polynomials in x,y and z direction. The ordering of the * dim-dimensional polynomials can be changed by using the - * set_numbering() function. - * + * set_numbering() function. + * * @author Ralf Hartmann, 2000, 2004, Guido Kanschat, 2000, Wolfgang Bangerth 2003 */ template @@ -69,7 +69,7 @@ class TensorProductPolynomials * in other classes. */ static const unsigned int dimension = dim; - + /** * Constructor. pols is * a vector of objects that @@ -81,7 +81,7 @@ class TensorProductPolynomials */ template TensorProductPolynomials (const std::vector &pols); - + /** * Prints the list of the indices * to out. @@ -137,7 +137,7 @@ class TensorProductPolynomials std::vector &values, std::vector > &grads, std::vector > &grad_grads) const; - + /** * Computes the value of the * ith tensor product @@ -226,7 +226,7 @@ class TensorProductPolynomials */ unsigned int n () const; - + private: /** * Copy of the vector pols of @@ -263,9 +263,11 @@ class TensorProductPolynomials * for each space direction, * given the index i. */ + // fix to avoid compiler warnings about zero + // length arrays void compute_index (const unsigned int i, - unsigned int (&indices)[dim]) const; - + unsigned int (&indices)[(dim>0?dim:1)]) const; + /** * Computes * xdim for @@ -315,7 +317,7 @@ TensorProductPolynomials::get_numbering_inverse() const * few polynomials are thus Px1(x)Py1(y), Px2(x)Py1(y), * Px3(x)Py1(y), ..., Px1(x)Py2(y), Px2(x)Py2(y), * Px3(x)Py2(y), ..., and likewise in 3d. - * + * * @author Wolfgang Bangerth 2003 */ template @@ -366,7 +368,7 @@ class AnisotropicPolynomials std::vector &values, std::vector > &grads, std::vector > &grad_grads) const; - + /** * Computes the value of the * ith tensor product @@ -487,7 +489,7 @@ class AnisotropicPolynomials */ void compute_index (const unsigned int i, unsigned int (&indices)[dim]) const; - + /** * Given the input to the * constructor, compute @@ -552,7 +554,7 @@ TensorProductPolynomials(const std::vector &pols) { index_map[i]=i; index_map_inverse[i]=i; - } + } }