From 78b795c58a4684195c6c7ab5e7d531ee484f32c6 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Thu, 7 Mar 2024 10:57:56 -0800 Subject: [PATCH] Remove unused variables in mapillary/opensfm/opensfm/src/third_party/akaze/lib/AKAZE.cpp Summary: LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance. This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code. - If you approve of this diff, please use the "Accept & Ship" button :-) Reviewed By: dmm-fb Differential Revision: D54378379 fbshipit-source-id: 0a23b525ffbe0862e32609ce45af4c2cd7794551 --- opensfm/src/third_party/akaze/lib/AKAZE.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/opensfm/src/third_party/akaze/lib/AKAZE.cpp b/opensfm/src/third_party/akaze/lib/AKAZE.cpp index 5d42f251d..e49b6f1c2 100644 --- a/opensfm/src/third_party/akaze/lib/AKAZE.cpp +++ b/opensfm/src/third_party/akaze/lib/AKAZE.cpp @@ -269,7 +269,7 @@ void AKAZE::Find_Scale_Space_Extrema(std::vector& kpts) { double t1 = 0.0, t2 = 0.0; float value = 0.0; float dist = 0.0, ratio = 0.0, smax = 0.0; - int npoints = 0, id_repeated = 0; + int id_repeated = 0; int sigma_size_ = 0, left_x = 0, right_x = 0, up_y = 0, down_y = 0; bool is_extremum = false, is_repeated = false, is_out = false; cv::KeyPoint point; @@ -357,7 +357,6 @@ void AKAZE::Find_Scale_Space_Extrema(std::vector& kpts) { point.pt.x *= ratio; point.pt.y *= ratio; kpts_aux.push_back(point); - npoints++; } else { point.pt.x *= ratio;