diff --git a/sources/Helpers.h b/sources/Helpers.h index efe93397..1ae98d52 100644 --- a/sources/Helpers.h +++ b/sources/Helpers.h @@ -35,7 +35,7 @@ inline std::string_view trim(std::string_view s) inline constexpr unsigned int Fnv1aBasis = 0x811C9DC5; inline constexpr unsigned int Fnv1aPrime = 0x01000193; -inline constexpr unsigned int hash(const char *s, unsigned int h = Fnv1aBasis) +inline constexpr unsigned int hash(const char *s, unsigned int h = Fnv1aBasis) { return !*s ? h : hash(s + 1, static_cast((h ^ *s) * static_cast(Fnv1aPrime))); } diff --git a/sources/ParserMain.cpp b/sources/ParserMain.cpp index 525b3ed9..29650257 100644 --- a/sources/ParserMain.cpp +++ b/sources/ParserMain.cpp @@ -14,7 +14,7 @@ public: int getNumMasters() const noexcept { return numMasters; } int getNumCurves() const noexcept { return numCurves; } protected: - void callback(std::string_view header, std::vector members) override + void callback(std::string_view header, std::vector members) final { switch (hash(header)) { diff --git a/sources/Synth.h b/sources/Synth.h index aeee3797..c519ad90 100644 --- a/sources/Synth.h +++ b/sources/Synth.h @@ -12,14 +12,14 @@ namespace sfz class Synth: public Parser { public: - bool loadSfzFile(const std::filesystem::path& file) override; + bool loadSfzFile(const std::filesystem::path& file) final; int getNumRegions() const noexcept { return regions.size(); } int getNumGroups() const noexcept { return numGroups; } int getNumMasters() const noexcept { return numMasters; } int getNumCurves() const noexcept { return numCurves; } - const Region* getRegionView(int idx) { return idx < regions.size() ? ®ions[idx] : nullptr; } + const Region* getRegionView(int idx) const noexcept { return idx < regions.size() ? ®ions[idx] : nullptr; } protected: - void callback(std::string_view header, std::vector members) override; + void callback(std::string_view header, std::vector members) final; private: bool hasGlobal { false }; bool hasControl { false };