From dee0598edf3edd2dbd32690ad99ca5f5209dc738 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 9 Feb 2023 13:14:39 -0800 Subject: [PATCH] clang-tidy fixes for recent stuff Signed-off-by: Rosen Penev --- include/exiv2/riffvideo.hpp | 8 ++++---- src/riffvideo.cpp | 9 ++++----- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/exiv2/riffvideo.hpp b/include/exiv2/riffvideo.hpp index 3c6c2605..4112e11f 100644 --- a/include/exiv2/riffvideo.hpp +++ b/include/exiv2/riffvideo.hpp @@ -44,7 +44,7 @@ class EXIV2API RiffVideo : public Image { protected: class HeaderReader { - std::string id_ = ""; + std::string id_; uint64_t size_ = 0; public: @@ -54,7 +54,7 @@ class EXIV2API RiffVideo : public Image { return size_; } - [[nodiscard]] std::string& getId() { + [[nodiscard]] const std::string& getId() const { return id_; } }; @@ -66,7 +66,7 @@ class EXIV2API RiffVideo : public Image { void decodeBlocks(); private: - bool equal(const std::string& str1, const std::string& str2); + static bool equal(const std::string& str1, const std::string& str2); /*! @brief Interpret MainAVIHeader (avih) structure, and save it in the respective XMP container. @@ -130,7 +130,7 @@ class EXIV2API RiffVideo : public Image { */ void readJunk(uint64_t size_); - std::string getStreamType(uint32_t stream); + static std::string getStreamType(uint32_t stream); /*! @brief Calculates Duration of a video, and stores it in the respective XMP container. @param frame_rate Frame rate of the video. diff --git a/src/riffvideo.cpp b/src/riffvideo.cpp index c733ecd7..f7844430 100644 --- a/src/riffvideo.cpp +++ b/src/riffvideo.cpp @@ -740,14 +740,13 @@ void RiffVideo::readJunk(uint64_t size_) { std::string RiffVideo::getStreamType(uint32_t stream) { if (stream == 1) return "Mono"; - else if (stream == 2) + if (stream == 2) return "Stereo"; - else if (stream == 5) + if (stream == 5) return "5.1 Surround Sound"; - else if (stream == 7) + if (stream == 7) return "7.1 Surround Sound"; - else - return "Mono"; + return "Mono"; } void RiffVideo::fillDuration(double frame_rate, size_t frame_count) {