From 948c1be9b32766d14a0aa6b92fc3df0713f56fc5 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 19 Aug 2026 18:16:02 -0400 Subject: [PATCH] Fixed numerous Clang -Wextra-semi warnings --- hal/carotene/include/carotene/types.hpp | 2 +- modules/core/perf/perf_gemm.cpp | 2 +- modules/core/test/test_allocator.cpp | 4 +-- modules/features/3rdparty/annoy/annoylib.h | 2 +- modules/features/src/matchers_lightglue.cpp | 2 +- .../include/opencv2/flann/flann_base.hpp | 4 +-- modules/imgcodecs/src/grfmt_base.hpp | 2 +- .../src/aruco/apriltag/unionfind.hpp | 2 +- modules/photo/src/ccm/ccm.cpp | 2 +- modules/photo/src/ccm/color.hpp | 4 +-- modules/photo/src/ccm/colorspace.hpp | 30 +++++++++---------- modules/photo/src/ccm/illumobserver.hpp | 6 ++-- modules/photo/src/ccm/linearize.hpp | 26 ++++++++-------- modules/photo/src/ccm/operations.hpp | 16 +++++----- .../opencv2/ptcloud/odometry_frame.hpp | 2 +- .../opencv2/ptcloud/odometry_settings.hpp | 2 +- modules/ptcloud/src/hash_tsdf_functions.hpp | 2 +- modules/ptcloud/src/odometry.cpp | 4 +-- .../ptcloud/src/odometry_settings_impl.cpp | 6 ++-- modules/ptcloud/src/volume_impl.hpp | 2 +- modules/ptcloud/src/volume_settings_impl.cpp | 4 +-- modules/ptcloud/test/test_normal.cpp | 2 +- 22 files changed, 64 insertions(+), 64 deletions(-) diff --git a/hal/carotene/include/carotene/types.hpp b/hal/carotene/include/carotene/types.hpp index 81b03d649a..0699a7c24d 100644 --- a/hal/carotene/include/carotene/types.hpp +++ b/hal/carotene/include/carotene/types.hpp @@ -118,7 +118,7 @@ namespace CAROTENE_NS { struct KeypointStore { virtual void push(f32 kpX, f32 kpY, f32 kpSize, f32 kpAngle=-1, f32 kpResponse=0, s32 kpOctave=0, s32 kpClass_id=-1) = 0; - virtual ~KeypointStore() {}; + virtual ~KeypointStore() {} }; } diff --git a/modules/core/perf/perf_gemm.cpp b/modules/core/perf/perf_gemm.cpp index de8ad54815..cbfcbaad3f 100644 --- a/modules/core/perf/perf_gemm.cpp +++ b/modules/core/perf/perf_gemm.cpp @@ -30,7 +30,7 @@ class GemmTest : public perf::TestBaseWithParam SANITY_CHECK_NOTHING(); else SANITY_CHECK(dst, (CV_MAT_DEPTH(type) == CV_32F) ? 1e-4 : 1e-6, ERROR_RELATIVE); - }; + } }; // Sparse coverage: exercise tiny/small/rectangular shapes and m=1/n=1 edge cases. diff --git a/modules/core/test/test_allocator.cpp b/modules/core/test/test_allocator.cpp index 88b03b689e..fde9501d38 100644 --- a/modules/core/test/test_allocator.cpp +++ b/modules/core/test/test_allocator.cpp @@ -9,8 +9,8 @@ namespace opencv_test { namespace { struct DummyAllocator: public cv::MatAllocator { public: - DummyAllocator() {}; - ~DummyAllocator() {}; + DummyAllocator() {} + ~DummyAllocator() {} cv::UMatData* allocate(int dims, const int* sizes, int type, void* data0, size_t* step, cv::AccessFlag flags, diff --git a/modules/features/3rdparty/annoy/annoylib.h b/modules/features/3rdparty/annoy/annoylib.h index 0d07e86823..67941446cf 100644 --- a/modules/features/3rdparty/annoy/annoylib.h +++ b/modules/features/3rdparty/annoy/annoylib.h @@ -907,7 +907,7 @@ template class AnnoyIndexInterface { public: // Note that the methods with an **error argument will allocate memory and write the pointer to that string if error is non-NULL - virtual ~AnnoyIndexInterface() {}; + virtual ~AnnoyIndexInterface() {} virtual bool add_item(S item, const T* w, char** error=NULL) = 0; virtual bool build(int q, int n_threads=-1, char** error=NULL) = 0; virtual bool unbuild(char** error=NULL) = 0; diff --git a/modules/features/src/matchers_lightglue.cpp b/modules/features/src/matchers_lightglue.cpp index 3278f7fb94..583b00cbfd 100644 --- a/modules/features/src/matchers_lightglue.cpp +++ b/modules/features/src/matchers_lightglue.cpp @@ -80,7 +80,7 @@ public: // Private constructor for clone() — shares the already-loaded network LightGlueMatcherImpl(const dnn::Net& _net, float _scoreThreshold) - : net(_net), scoreThreshold(_scoreThreshold) {}; + : net(_net), scoreThreshold(_scoreThreshold) {} // DescriptorMatcher interface bool isMaskSupported() const CV_OVERRIDE { return false; } diff --git a/modules/flann/include/opencv2/flann/flann_base.hpp b/modules/flann/include/opencv2/flann/flann_base.hpp index 848f1e286e..e09c8a8eee 100644 --- a/modules/flann/include/opencv2/flann/flann_base.hpp +++ b/modules/flann/include/opencv2/flann/flann_base.hpp @@ -50,11 +50,11 @@ class FILEScopeGuard { public: explicit FILEScopeGuard(FILE* file) { file_ = file; - }; + } ~FILEScopeGuard() { fclose(file_); - }; + } private: FILE* file_; diff --git a/modules/imgcodecs/src/grfmt_base.hpp b/modules/imgcodecs/src/grfmt_base.hpp index 3fec6055c2..ba82304bdd 100644 --- a/modules/imgcodecs/src/grfmt_base.hpp +++ b/modules/imgcodecs/src/grfmt_base.hpp @@ -169,7 +169,7 @@ public: */ virtual bool checkSignature(const String& signature) const; - const Animation& animation() const { return m_animation; }; + const Animation& animation() const { return m_animation; } /** * @brief Create and return a new instance of the derived image decoder. diff --git a/modules/objdetect/src/aruco/apriltag/unionfind.hpp b/modules/objdetect/src/aruco/apriltag/unionfind.hpp index f7a2d6a55c..a25c61f157 100644 --- a/modules/objdetect/src/aruco/apriltag/unionfind.hpp +++ b/modules/objdetect/src/aruco/apriltag/unionfind.hpp @@ -26,7 +26,7 @@ struct UnionFind { data[i].size = 1; data[i].parent = i; } - }; + } inline uint32_t get_representative(uint32_t id) { uint32_t root = id; diff --git a/modules/photo/src/ccm/ccm.cpp b/modules/photo/src/ccm/ccm.cpp index 26edc0048e..7d3e693a25 100644 --- a/modules/photo/src/ccm/ccm.cpp +++ b/modules/photo/src/ccm/ccm.cpp @@ -99,7 +99,7 @@ public: public: ColorCorrectionModel::Impl* ccmLoss; LossFunction(ColorCorrectionModel::Impl* ccm) - : ccmLoss(ccm) {}; + : ccmLoss(ccm) {} /** @brief Reset dims to ccm->shape. */ diff --git a/modules/photo/src/ccm/color.hpp b/modules/photo/src/ccm/color.hpp index 669904c52c..d3e59af6fd 100644 --- a/modules/photo/src/ccm/color.hpp +++ b/modules/photo/src/ccm/color.hpp @@ -38,7 +38,7 @@ public: Color(Mat colors_, const ColorSpaceBase& cs, Mat colored); Color(Mat colors_, const ColorSpaceBase& cs); Color(Mat colors_, std::shared_ptr cs_); - virtual ~Color() {}; + virtual ~Color() {} /** @brief Change to other color space. The conversion process incorporates linear transformations to speed up. @@ -105,4 +105,4 @@ public: } } // namespace cv::ccm -#endif \ No newline at end of file +#endif diff --git a/modules/photo/src/ccm/colorspace.hpp b/modules/photo/src/ccm/colorspace.hpp index 853d9eeb31..90761c3d40 100644 --- a/modules/photo/src/ccm/colorspace.hpp +++ b/modules/photo/src/ccm/colorspace.hpp @@ -30,18 +30,18 @@ public: ColorSpaceBase* l; ColorSpaceBase* nl; - ColorSpaceBase() {}; + ColorSpaceBase() {} ColorSpaceBase(IllumObserver illumobserver_, std::string type_, bool linear_) : illumobserver(illumobserver_) , type(type_) - , linear(linear_) {}; + , linear(linear_) {} virtual ~ColorSpaceBase() { l = 0; nl = 0; - }; + } virtual bool relate(const ColorSpaceBase& other) const; virtual Operations relation(const ColorSpaceBase& /*other*/) const; @@ -91,7 +91,7 @@ public: virtual Mat fromLFunc(Mat& /*rgbl*/, Mat dst=Mat()) const; private: - virtual void setParameter() {}; + virtual void setParameter() {} /** @brief Calculation of M_RGBL2XYZ_base. */ @@ -101,7 +101,7 @@ private: */ virtual void calOperations(); - virtual void calLinear() {}; + virtual void calLinear() {} }; /** @brief Base of Adobe RGB color space; @@ -165,7 +165,7 @@ class sRGB_ : public sRGBBase_ { public: sRGB_(bool linear_) - : sRGBBase_(IllumObserver::getIllumObservers(D65_2), "sRGB", linear_) {}; + : sRGBBase_(IllumObserver::getIllumObservers(D65_2), "sRGB", linear_) {} private: void setParameter() CV_OVERRIDE; @@ -177,7 +177,7 @@ class AdobeRGB_ : public AdobeRGBBase_ { public: AdobeRGB_(bool linear_ = false) - : AdobeRGBBase_(IllumObserver::getIllumObservers(D65_2), "AdobeRGB", linear_) {}; + : AdobeRGBBase_(IllumObserver::getIllumObservers(D65_2), "AdobeRGB", linear_) {} private: void setParameter() CV_OVERRIDE; @@ -190,7 +190,7 @@ class WideGamutRGB_ : public AdobeRGBBase_ { public: WideGamutRGB_(bool linear_ = false) - : AdobeRGBBase_(IllumObserver::getIllumObservers(D50_2), "WideGamutRGB", linear_) {}; + : AdobeRGBBase_(IllumObserver::getIllumObservers(D50_2), "WideGamutRGB", linear_) {} private: void setParameter() CV_OVERRIDE; @@ -204,7 +204,7 @@ class ProPhotoRGB_ : public AdobeRGBBase_ { public: ProPhotoRGB_(bool linear_ = false) - : AdobeRGBBase_(IllumObserver::getIllumObservers(D50_2), "ProPhotoRGB", linear_) {}; + : AdobeRGBBase_(IllumObserver::getIllumObservers(D50_2), "ProPhotoRGB", linear_) {} private: void setParameter() CV_OVERRIDE; @@ -217,7 +217,7 @@ class DCI_P3_RGB_ : public AdobeRGBBase_ { public: DCI_P3_RGB_(bool linear_ = false) - : AdobeRGBBase_(IllumObserver::getIllumObservers(D65_2), "DCI_P3_RGB", linear_) {}; + : AdobeRGBBase_(IllumObserver::getIllumObservers(D65_2), "DCI_P3_RGB", linear_) {} private: void setParameter() CV_OVERRIDE; @@ -230,7 +230,7 @@ class AppleRGB_ : public AdobeRGBBase_ { public: AppleRGB_(bool linear_ = false) - : AdobeRGBBase_(IllumObserver::getIllumObservers(D65_2), "AppleRGB", linear_) {}; + : AdobeRGBBase_(IllumObserver::getIllumObservers(D65_2), "AppleRGB", linear_) {} private: void setParameter() CV_OVERRIDE; @@ -243,7 +243,7 @@ class REC_709_RGB_ : public sRGBBase_ { public: REC_709_RGB_(bool linear_) - : sRGBBase_(IllumObserver::getIllumObservers(D65_2), "REC_709_RGB", linear_) {}; + : sRGBBase_(IllumObserver::getIllumObservers(D65_2), "REC_709_RGB", linear_) {} private: void setParameter() CV_OVERRIDE; @@ -256,7 +256,7 @@ class REC_2020_RGB_ : public sRGBBase_ { public: REC_2020_RGB_(bool linear_) - : sRGBBase_(IllumObserver::getIllumObservers(D65_2), "REC_2020_RGB", linear_) {}; + : sRGBBase_(IllumObserver::getIllumObservers(D65_2), "REC_2020_RGB", linear_) {} private: void setParameter() CV_OVERRIDE; @@ -279,7 +279,7 @@ class XYZ : public ColorSpaceBase { public: XYZ(IllumObserver illumobserver_) - : ColorSpaceBase(illumobserver_, "XYZ", true) {}; + : ColorSpaceBase(illumobserver_, "XYZ", true) {} Operations cam(IllumObserver dio, ChromaticAdaptationType method = BRADFORD); static std::shared_ptr get(IllumObserver illumobserver); @@ -340,4 +340,4 @@ public: } } // namespace cv::ccm -#endif \ No newline at end of file +#endif diff --git a/modules/photo/src/ccm/illumobserver.hpp b/modules/photo/src/ccm/illumobserver.hpp index 9f46e61847..5d4a78d24f 100644 --- a/modules/photo/src/ccm/illumobserver.hpp +++ b/modules/photo/src/ccm/illumobserver.hpp @@ -38,9 +38,9 @@ class IllumObserver public: std::string illuminant; std::string observer; - IllumObserver() {}; + IllumObserver() {} IllumObserver(std::string illuminant, std::string observer); - virtual ~IllumObserver() {}; + virtual ~IllumObserver() {} bool operator<(const IllumObserver& other) const; bool operator==(const IllumObserver& other) const; static IllumObserver getIllumObservers(IllumObserverType illumobserver); @@ -50,4 +50,4 @@ std::vector xyY2XYZ(const std::vector& xyY); } } // namespace cv::ccm -#endif \ No newline at end of file +#endif diff --git a/modules/photo/src/ccm/linearize.hpp b/modules/photo/src/ccm/linearize.hpp index 6fad0f51e9..c6e14796e4 100644 --- a/modules/photo/src/ccm/linearize.hpp +++ b/modules/photo/src/ccm/linearize.hpp @@ -31,7 +31,7 @@ public: and deduct: Ax = y */ Polyfit(Mat x, Mat y, int deg); - virtual ~Polyfit() {}; + virtual ~Polyfit() {} Mat operator()(const Mat& inp); // Serialization support @@ -59,7 +59,7 @@ public: /** @brief Logpolyfit method. */ LogPolyfit(Mat x, Mat y, int deg); - virtual ~LogPolyfit() {}; + virtual ~LogPolyfit() {} Mat operator()(const Mat& inp); // Serialization support @@ -77,8 +77,8 @@ void read(const cv::FileNode& node, LogPolyfit& logpolyfit, const LogPolyfit& de class Linear { public: - Linear() {}; - virtual ~Linear() {}; + Linear() {} + virtual ~Linear() {} /** @brief Inference. @param inp the input array, type of cv::Mat. @@ -86,7 +86,7 @@ public: virtual Mat linearize(Mat inp); /** @brief Evaluate linearization model. */ - virtual void value(void) {}; + virtual void value(void) {} // Serialization support virtual void write(cv::FileStorage& fs) const; @@ -119,10 +119,10 @@ public: double gamma; LinearGamma() - : gamma(1.0) {}; + : gamma(1.0) {} LinearGamma(double gamma_) - : gamma(gamma_) {}; + : gamma(gamma_) {} Mat linearize(Mat inp) CV_OVERRIDE; @@ -145,7 +145,7 @@ public: int deg; T p; - LinearGray(): deg(3) {}; + LinearGray(): deg(3) {} LinearGray(int deg_, Mat src, Color dst, Mat mask, RGBBase_ cs) : deg(deg_) @@ -169,12 +169,12 @@ public: void calc(const Mat& src, const Mat& dst) { p = T(src, dst, deg); - }; + } Mat linearize(Mat inp) CV_OVERRIDE { return p(inp); - }; + } // Serialization support void write(cv::FileStorage& fs) const CV_OVERRIDE; @@ -199,7 +199,7 @@ public: T pg; T pb; - LinearColor(): deg(3) {}; + LinearColor(): deg(3) {} LinearColor(int deg_, Mat src_, Color dst, Mat mask, RGBBase_ cs) : deg(deg_) @@ -218,7 +218,7 @@ public: pr = T(schannels[0], dchannels[0], deg); pg = T(schannels[1], dchannels[1], deg); pb = T(schannels[2], dchannels[2], deg); - }; + } Mat linearize(Mat inp) CV_OVERRIDE { @@ -228,7 +228,7 @@ public: Mat res; merge(std::vector { pr(channels[0]), pg(channels[1]), pb(channels[2]) }, res); return res; - }; + } // Serialization support void write(cv::FileStorage& fs) const CV_OVERRIDE; diff --git a/modules/photo/src/ccm/operations.hpp b/modules/photo/src/ccm/operations.hpp index 1459be0314..54ff49ccd9 100644 --- a/modules/photo/src/ccm/operations.hpp +++ b/modules/photo/src/ccm/operations.hpp @@ -27,14 +27,14 @@ public: Operation() : linear(true) - , M(Mat()) {}; + , M(Mat()) {} Operation(Mat M_) : linear(true) - , M(M_) {}; + , M(M_) {} Operation(MatFunc f_) : linear(false) - , f(f_) {}; - virtual ~Operation() {}; + , f(f_) {} + virtual ~Operation() {} /** @brief operator function will run operation */ @@ -58,10 +58,10 @@ class Operations public: std::vector ops; Operations() - : ops {} {}; + : ops {} {} Operations(std::initializer_list op) - : ops { op } {}; - virtual ~Operations() {}; + : ops { op } {} + virtual ~Operations() {} /** @brief add function will conbine this operation with other transformation operations */ @@ -80,4 +80,4 @@ public: } } // namespace cv::ccm -#endif \ No newline at end of file +#endif diff --git a/modules/ptcloud/include/opencv2/ptcloud/odometry_frame.hpp b/modules/ptcloud/include/opencv2/ptcloud/odometry_frame.hpp index 165f8d3ea4..0c800ec542 100644 --- a/modules/ptcloud/include/opencv2/ptcloud/odometry_frame.hpp +++ b/modules/ptcloud/include/opencv2/ptcloud/odometry_frame.hpp @@ -50,7 +50,7 @@ public: * @param normals A user-provided normals to the depth surface, should be CV_32FC4 */ CV_WRAP explicit OdometryFrame(InputArray depth = noArray(), InputArray image = noArray(), InputArray mask = noArray(), InputArray normals = noArray()); - ~OdometryFrame() {}; + ~OdometryFrame() {} /** * @brief Get the original user-provided BGR/Gray image diff --git a/modules/ptcloud/include/opencv2/ptcloud/odometry_settings.hpp b/modules/ptcloud/include/opencv2/ptcloud/odometry_settings.hpp index b9bde47db3..310ff7b82b 100644 --- a/modules/ptcloud/include/opencv2/ptcloud/odometry_settings.hpp +++ b/modules/ptcloud/include/opencv2/ptcloud/odometry_settings.hpp @@ -19,7 +19,7 @@ public: CV_WRAP OdometrySettings(); OdometrySettings(const OdometrySettings&); OdometrySettings& operator=(const OdometrySettings&); - ~OdometrySettings() {}; + ~OdometrySettings() {} CV_WRAP void setCameraMatrix(InputArray val); CV_WRAP void getCameraMatrix(OutputArray val) const; CV_WRAP void setIterCounts(InputArray val); diff --git a/modules/ptcloud/src/hash_tsdf_functions.hpp b/modules/ptcloud/src/hash_tsdf_functions.hpp index 52c42675be..c3fb40c447 100644 --- a/modules/ptcloud/src/hash_tsdf_functions.hpp +++ b/modules/ptcloud/src/hash_tsdf_functions.hpp @@ -199,7 +199,7 @@ public: this->bufferNums = vt.bufferNums; return *this; } - ~VolumesTable() {}; + ~VolumesTable() {} bool insert(Vec3i idx, int row) { diff --git a/modules/ptcloud/src/odometry.cpp b/modules/ptcloud/src/odometry.cpp index 835566709a..a121c2c095 100644 --- a/modules/ptcloud/src/odometry.cpp +++ b/modules/ptcloud/src/odometry.cpp @@ -13,8 +13,8 @@ namespace cv class Odometry::Impl { public: - Impl() {}; - virtual ~Impl() {}; + Impl() {} + virtual ~Impl() {} virtual void prepareFrame(OdometryFrame& frame) const = 0; virtual void prepareFrames(OdometryFrame& srcFrame, OdometryFrame& dstFrame) const = 0; virtual bool compute(const OdometryFrame& srcFrame, const OdometryFrame& dstFrame, OutputArray Rt) const = 0; diff --git a/modules/ptcloud/src/odometry_settings_impl.cpp b/modules/ptcloud/src/odometry_settings_impl.cpp index a5716d1714..08fcd2b693 100644 --- a/modules/ptcloud/src/odometry_settings_impl.cpp +++ b/modules/ptcloud/src/odometry_settings_impl.cpp @@ -11,8 +11,8 @@ namespace cv class OdometrySettings::Impl { public: - Impl() {}; - virtual ~Impl() {}; + Impl() {} + virtual ~Impl() {} virtual void setCameraMatrix(InputArray val) = 0; virtual void getCameraMatrix(OutputArray val) const = 0; virtual void setIterCounts(InputArray val) = 0; @@ -56,7 +56,7 @@ class OdometrySettingsImplCommon : public OdometrySettings::Impl { public: OdometrySettingsImplCommon(); - ~OdometrySettingsImplCommon() {}; + ~OdometrySettingsImplCommon() {} virtual void setCameraMatrix(InputArray val) override; virtual void getCameraMatrix(OutputArray val) const override; virtual void setIterCounts(InputArray val) override; diff --git a/modules/ptcloud/src/volume_impl.hpp b/modules/ptcloud/src/volume_impl.hpp index 94cd4ed862..18c9c3fd27 100644 --- a/modules/ptcloud/src/volume_impl.hpp +++ b/modules/ptcloud/src/volume_impl.hpp @@ -20,7 +20,7 @@ private: // make this function run with debug lvl == 10 public: Impl(const VolumeSettings& settings); - virtual ~Impl() {}; + virtual ~Impl() {} virtual void integrate(const OdometryFrame& frame, InputArray pose) = 0; virtual void integrate(InputArray depth, InputArray pose) = 0; diff --git a/modules/ptcloud/src/volume_settings_impl.cpp b/modules/ptcloud/src/volume_settings_impl.cpp index ba66e97aba..a11307894e 100644 --- a/modules/ptcloud/src/volume_settings_impl.cpp +++ b/modules/ptcloud/src/volume_settings_impl.cpp @@ -33,8 +33,8 @@ static Vec4i calcVolumeStrides(Point3i volumeResolution, bool ZFirstMemOrder) class VolumeSettings::Impl { public: - Impl() {}; - virtual ~Impl() {}; + Impl() {} + virtual ~Impl() {} virtual void setIntegrateWidth(int val) = 0; virtual int getIntegrateWidth() const = 0; diff --git a/modules/ptcloud/test/test_normal.cpp b/modules/ptcloud/test/test_normal.cpp index 0bcbc665ac..582f131367 100644 --- a/modules/ptcloud/test/test_normal.cpp +++ b/modules/ptcloud/test/test_normal.cpp @@ -375,7 +375,7 @@ struct RenderedNormals: public ::testing::TestWithParam> img; } return img; - }; + } static Mat nanMask(Mat img) {