From 57a086a0dd47b2dd2bd9dec8462ba2b3462b9616 Mon Sep 17 00:00:00 2001 From: Mohamad Ghadban Date: Mon, 12 Aug 2024 14:51:08 -0600 Subject: [PATCH] replace (void) casts with [[maybe_unused]] --- source/base/function_lib.cc | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/source/base/function_lib.cc b/source/base/function_lib.cc index bf1dad3ccd..4de0b3e63b 100644 --- a/source/base/function_lib.cc +++ b/source/base/function_lib.cc @@ -2603,10 +2603,9 @@ namespace Functions template double InterpolatedTensorProductGridData::value( - const Point &p, - const unsigned int component) const + const Point &p, + [[maybe_unused]] const unsigned int component) const { - (void)component; Assert( component == 0, ExcMessage( @@ -2634,10 +2633,9 @@ namespace Functions template Tensor<1, dim> InterpolatedTensorProductGridData::gradient( - const Point &p, - const unsigned int component) const + const Point &p, + [[maybe_unused]] const unsigned int component) const { - (void)component; Assert( component == 0, ExcMessage( @@ -2712,10 +2710,10 @@ namespace Functions template double - InterpolatedUniformGridData::value(const Point &p, - const unsigned int component) const + InterpolatedUniformGridData::value( + const Point &p, + [[maybe_unused]] const unsigned int component) const { - (void)component; Assert( component == 0, ExcMessage( @@ -2761,10 +2759,10 @@ namespace Functions template Tensor<1, dim> - InterpolatedUniformGridData::gradient(const Point &p, - const unsigned int component) const + InterpolatedUniformGridData::gradient( + const Point &p, + [[maybe_unused]] const unsigned int component) const { - (void)component; Assert( component == 0, ExcMessage( @@ -2850,10 +2848,9 @@ namespace Functions template double - Polynomial::value(const Point &p, - const unsigned int component) const + Polynomial::value(const Point &p, + [[maybe_unused]] const unsigned int component) const { - (void)component; AssertIndexRange(component, 1); double sum = 0; @@ -2892,10 +2889,9 @@ namespace Functions template Tensor<1, dim> - Polynomial::gradient(const Point &p, - const unsigned int component) const + Polynomial::gradient(const Point &p, + [[maybe_unused]] const unsigned int component) const { - (void)component; AssertIndexRange(component, 1); Tensor<1, dim> r; -- 2.39.5