From: Wolfgang Bangerth Date: Wed, 21 Jul 2021 14:53:52 +0000 (-0600) Subject: Be more explicit about types and taking addresses. X-Git-Tag: v9.4.0-rc1~1076^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f97587c779e5f42f7bf72f23476408fb856b8824;p=dealii.git Be more explicit about types and taking addresses. --- diff --git a/include/deal.II/sundials/n_vector.templates.h b/include/deal.II/sundials/n_vector.templates.h index ee6294cd6d..42161e5b4b 100644 --- a/include/deal.II/sundials/n_vector.templates.h +++ b/include/deal.II/sundials/n_vector.templates.h @@ -363,7 +363,8 @@ SUNDIALS::internal::unwrap_nvector(N_Vector v) { Assert(v != nullptr, ExcInternalError()); Assert(v->content != nullptr, ExcInternalError()); - auto *pContent = reinterpret_cast *>(v->content); + NVectorContent *pContent = + reinterpret_cast *>(v->content); return pContent->get(); } @@ -375,7 +376,7 @@ SUNDIALS::internal::unwrap_nvector_const(N_Vector v) { Assert(v != nullptr, ExcInternalError()); Assert(v->content != nullptr, ExcInternalError()); - auto *pContent = + const NVectorContent *pContent = reinterpret_cast *>(v->content); return pContent->get(); } @@ -939,34 +940,34 @@ SUNDIALS::internal::create_empty_nvector() Assert(v != nullptr, ExcInternalError()); /* constructors, destructors, and utility operations */ - v->ops->nvgetvectorid = NVectorOperations::get_vector_id; - v->ops->nvclone = NVectorOperations::clone; - v->ops->nvcloneempty = NVectorOperations::clone_empty; - v->ops->nvdestroy = NVectorOperations::destroy; + v->ops->nvgetvectorid = &NVectorOperations::get_vector_id; + v->ops->nvclone = &NVectorOperations::clone; + v->ops->nvcloneempty = &NVectorOperations::clone_empty; + v->ops->nvdestroy = &NVectorOperations::destroy; // v->ops->nvspace = undef; # if DEAL_II_SUNDIALS_VERSION_GTE(5, 0, 0) v->ops->nvgetcommunicator = NVectorOperations::get_communicator_as_void_ptr; - v->ops->nvgetlength = NVectorOperations::get_global_length; + v->ops->nvgetlength = &NVectorOperations::get_global_length; # endif /* standard vector operations */ - v->ops->nvlinearsum = NVectorOperations::linear_sum; - v->ops->nvconst = NVectorOperations::set_constant; - v->ops->nvprod = NVectorOperations::elementwise_product; - v->ops->nvdiv = NVectorOperations::elementwise_div; - v->ops->nvscale = NVectorOperations::scale; - v->ops->nvabs = NVectorOperations::elementwise_abs; - v->ops->nvinv = NVectorOperations::elementwise_inv; - v->ops->nvaddconst = NVectorOperations::add_constant; - v->ops->nvdotprod = NVectorOperations::dot_product; - v->ops->nvmaxnorm = NVectorOperations::max_norm; - v->ops->nvwrmsnorm = NVectorOperations::weighted_rms_norm; - v->ops->nvmin = NVectorOperations::min_element; - v->ops->nvwl2norm = NVectorOperations::weighted_l2_norm; - v->ops->nvl1norm = NVectorOperations::l1_norm; + v->ops->nvlinearsum = &NVectorOperations::linear_sum; + v->ops->nvconst = &NVectorOperations::set_constant; + v->ops->nvprod = &NVectorOperations::elementwise_product; + v->ops->nvdiv = &NVectorOperations::elementwise_div; + v->ops->nvscale = &NVectorOperations::scale; + v->ops->nvabs = &NVectorOperations::elementwise_abs; + v->ops->nvinv = &NVectorOperations::elementwise_inv; + v->ops->nvaddconst = &NVectorOperations::add_constant; + v->ops->nvdotprod = &NVectorOperations::dot_product; + v->ops->nvmaxnorm = &NVectorOperations::max_norm; + v->ops->nvwrmsnorm = &NVectorOperations::weighted_rms_norm; + v->ops->nvmin = &NVectorOperations::min_element; + v->ops->nvwl2norm = &NVectorOperations::weighted_l2_norm; + v->ops->nvl1norm = &NVectorOperations::l1_norm; v->ops->nvwrmsnormmask = - NVectorOperations::weighted_rms_norm_mask; + &NVectorOperations::weighted_rms_norm_mask; // v->ops->nvcompare = undef; // v->ops->nvinvtest = undef; // v->ops->nvconstrmask = undef; @@ -984,7 +985,7 @@ SUNDIALS::internal::create_empty_nvector() // v->ops->nvminquotientlocal = undef; // v->ops->nvwsqrsumlocal = undef; // v->ops->nvwsqrsummasklocal = undef; - return (v); + return v; } DEAL_II_NAMESPACE_CLOSE