From 1ebefe189b07b76edc61575774e2e5caae49c8f9 Mon Sep 17 00:00:00 2001 From: Peter Urban Date: Tue, 20 Sep 2022 15:44:45 +0200 Subject: [PATCH 1/3] ignore unused parameter 'buf' warning --- include/xtensor-python/xtensor_type_caster_base.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/xtensor-python/xtensor_type_caster_base.hpp b/include/xtensor-python/xtensor_type_caster_base.hpp index 5874595..0426110 100644 --- a/include/xtensor-python/xtensor_type_caster_base.hpp +++ b/include/xtensor-python/xtensor_type_caster_base.hpp @@ -109,6 +109,7 @@ namespace pybind11 template static bool run(const B& buf) { + (void)(buf); return true; } }; @@ -140,6 +141,7 @@ namespace pybind11 template static bool run(const B& buf) { + (void)(buf); return true; } }; From 5a781b1d62bb41c6aca18cedaa1af4409752da4f Mon Sep 17 00:00:00 2001 From: Peter Urban Date: Fri, 10 Mar 2023 09:44:33 +0100 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Tom de Geus --- include/xtensor-python/xtensor_type_caster_base.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/xtensor-python/xtensor_type_caster_base.hpp b/include/xtensor-python/xtensor_type_caster_base.hpp index 0426110..a0f0386 100644 --- a/include/xtensor-python/xtensor_type_caster_base.hpp +++ b/include/xtensor-python/xtensor_type_caster_base.hpp @@ -107,9 +107,8 @@ namespace pybind11 struct pybind_array_dim_checker { template - static bool run(const B& buf) + static bool run(const B&) { - (void)(buf); return true; } }; @@ -139,9 +138,8 @@ namespace pybind11 struct pybind_array_shape_checker { template - static bool run(const B& buf) + static bool run(const B&) { - (void)(buf); return true; } }; From 0b9b173a8dd758253ebadc915995d157def78a71 Mon Sep 17 00:00:00 2001 From: Peter Urban Date: Fri, 10 Mar 2023 09:47:58 +0100 Subject: [PATCH 3/3] add name of the ignored argument as comment for more clarity --- include/xtensor-python/xtensor_type_caster_base.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/xtensor-python/xtensor_type_caster_base.hpp b/include/xtensor-python/xtensor_type_caster_base.hpp index a0f0386..840e28c 100644 --- a/include/xtensor-python/xtensor_type_caster_base.hpp +++ b/include/xtensor-python/xtensor_type_caster_base.hpp @@ -107,7 +107,7 @@ namespace pybind11 struct pybind_array_dim_checker { template - static bool run(const B&) + static bool run(const B& /*buf*/) { return true; } @@ -138,7 +138,7 @@ namespace pybind11 struct pybind_array_shape_checker { template - static bool run(const B&) + static bool run(const B& /*buf*/) { return true; }