From 6a3ba4291b952c4beb48d7ea499940caa078ffc5 Mon Sep 17 00:00:00 2001 From: Kenneth Moreland Date: Mon, 14 Sep 2020 15:26:43 -0600 Subject: [PATCH] Fix warning about unused function --- vtkm/cont/ColorTable.cxx | 47 ++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/vtkm/cont/ColorTable.cxx b/vtkm/cont/ColorTable.cxx index f7af39f2b..7d2ec8bc2 100644 --- a/vtkm/cont/ColorTable.cxx +++ b/vtkm/cont/ColorTable.cxx @@ -200,33 +200,48 @@ inline vtkm::Vec hsvTorgb(const vtkm::Vec& hsv) return rgb; } -// clang-format off -inline bool outside_vrange(double x) { return x < 0.0 || x > 1.0; } -inline bool outside_vrange(const vtkm::Vec& x) - { return x[0] < 0.0 || x[0] > 1.0 || x[1] < 0.0 || x[1] > 1.0; } -inline bool outside_vrange(const vtkm::Vec& x) - { return x[0] < 0.0 || x[0] > 1.0 || x[1] < 0.0 || x[1] > 1.0 || x[2] < 0.0 || x[2] > 1.0; } -inline bool outside_vrange(float x) { return x < 0.0f || x > 1.0f; } -inline bool outside_vrange(const vtkm::Vec& x) - { return x[0] < 0.0f || x[0] > 1.0f || x[1] < 0.0f || x[1] > 1.0f; } -inline bool outside_vrange(const vtkm::Vec& x) - { return x[0] < 0.0f || x[0] > 1.0f || x[1] < 0.0f || x[1] > 1.0f || x[2] < 0.0f || x[2] > 1.0f; } +inline bool outside_vrange(double x) +{ + return x < 0.0 || x > 1.0; +} +inline bool outside_vrange(float x) +{ + return x < 0.0f || x > 1.0f; +} +template +inline bool outside_vrange(const vtkm::Vec& x) +{ + return outside_vrange(x[0]) || outside_vrange(x[1]); +} +template +inline bool outside_vrange(const vtkm::Vec& x) +{ + return outside_vrange(x[0]) || outside_vrange(x[1]) || outside_vrange(x[2]); +} -inline bool outside_range() { return false; } +inline bool outside_range() +{ + return false; +} template -inline bool outside_range(T&& t) { return outside_vrange(t); } +inline bool outside_range(T&& t) +{ + return outside_vrange(t); +} template -inline bool outside_range(T&& t, U&& u) { return outside_vrange(t) || outside_vrange(u); } +inline bool outside_range(T&& t, U&& u) +{ + return outside_vrange(t) || outside_vrange(u); +} template inline bool outside_range(T&& t, U&& u, V&& v, Args&&... args) { return outside_vrange(t) || outside_vrange(u) || outside_vrange(v) || - outside_range(std::forward(args)...); + outside_range(std::forward(args)...); } -// clang-format on } namespace vtkm