diff --git a/include/fggl/audio/audio.hpp b/components/core/include/fggl/audio/audio.hpp similarity index 100% rename from include/fggl/audio/audio.hpp rename to components/core/include/fggl/audio/audio.hpp diff --git a/components/core/include/fggl/services/module.hpp b/components/core/include/fggl/services/module.hpp index 6278cfd852dc5eebc1d4a47834163622d890f08b..2b5153511914b5c4172e9f6954ee114b8528d3bf 100644 --- a/components/core/include/fggl/services/module.hpp +++ b/components/core/include/fggl/services/module.hpp @@ -44,6 +44,7 @@ }; using ModuleID = util::OpaqueName<std::string_view, struct ModuleTag>; + template<typename T> concept ModuleAPI = requires(T* type) { { T::MODULE_ID }; diff --git a/components/core/src/filesystem/module.cpp b/components/core/src/filesystem/module.cpp index 0a630fdc86659cd49fff834bcfaf07a7f1836996..b596af52d3c162566ff39d84ee5363593a209059 100644 --- a/components/core/src/filesystem/module.cpp +++ b/components/core/src/filesystem/module.cpp @@ -22,7 +22,7 @@ namespace fggl::filesystem { - services::Module::ServiceList NativeBacked::getProvides() const { + auto NativeBacked::getProvides() const -> services::Module::ServiceList { return { MODULE_ID, API::MODULE_ID }; } diff --git a/components/core/src/services/factory.cpp b/components/core/src/services/factory.cpp index 658c2fb7e9b55e89071e08ef04560a838f188f51..a9dd10ed7c93119a64fea8a67c01ca7097411a49 100644 --- a/components/core/src/services/factory.cpp +++ b/components/core/src/services/factory.cpp @@ -22,7 +22,8 @@ namespace fggl::services { namespace { - void dumpFactories( const std::map<ServiceName, std::shared_ptr<ServiceBinding>>& factories ){ + [[maybe_unused]] + void dump_factories( const std::map<ServiceName, std::shared_ptr<ServiceBinding>>& factories ){ std::cerr << "BEGIN registered factories" << std::endl; for ( auto& factory : factories ) { std::cerr << "\t" << factory.first.get() << std::endl; diff --git a/fggl/assets/pipeline/loader.cpp b/fggl/assets/pipeline/loader.cpp index bd1c1d0ba7ca678defbe42e2a8143724820eb003..9895e5d012cd6102cd66d21fc09ee5f453ac4608 100644 --- a/fggl/assets/pipeline/loader.cpp +++ b/fggl/assets/pipeline/loader.cpp @@ -21,7 +21,6 @@ #include <memory> #include <set> #include <map> -#include <concepts> #include "fggl/util/guid.hpp" diff --git a/fggl/audio/CMakeLists.txt b/fggl/audio/CMakeLists.txt index bb05710f54f9dfdb50fcc61c27347ee1adad19c6..7cda4a7be28873155d49868d9f1fbd25455a8c5c 100644 --- a/fggl/audio/CMakeLists.txt +++ b/fggl/audio/CMakeLists.txt @@ -1,7 +1,3 @@ -target_sources(fggl - PRIVATE - types.cpp - ) add_subdirectory(openal) add_subdirectory(fallback) \ No newline at end of file diff --git a/fggl/audio/types.cpp b/fggl/audio/types.cpp deleted file mode 100644 index ade96e01dc9a477d31d03a155aeea7be24f8824c..0000000000000000000000000000000000000000 --- a/fggl/audio/types.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This file is part of FGGL. - * - * FGGL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any - * later version. - * - * FGGL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License along with FGGL. - * If not, see <https://www.gnu.org/licenses/>. - */ - -#include "fggl/data/storage.hpp" -#include "fggl/audio/audio.hpp" - - -namespace fggl::audio { - -} // namespace fggl::audio - -namespace fggl::data { - -} // namespace fggl::data diff --git a/include/fggl/util/guid.hpp b/include/fggl/util/guid.hpp index 25c3861b91b70a63d320e60d8ab0db20b0bef055..47d38bce8cce7c809f74223947c99666af3eb581 100644 --- a/include/fggl/util/guid.hpp +++ b/include/fggl/util/guid.hpp @@ -41,7 +41,7 @@ namespace fggl::util { * @param str the string to hash. * @return the hashed value */ - constexpr uint32_t hash_fnv1a_32(const char *str) { + constexpr auto hash_fnv1a_32(const char *str) -> uint32_t { assert(str != nullptr); uint32_t hash = FNV_OFFSET_BASIS_32; for (int i = 0; str[i] != '\0'; i++) { @@ -57,7 +57,7 @@ namespace fggl::util { * @param str the string to be hashed * @return the hashed value */ - constexpr uint64_t hash_fnv1a_64(const char *str) { + constexpr auto hash_fnv1a_64(const char *str) -> uint64_t { assert(str != nullptr); uint64_t hash = FNV_OFFSET_BASIS_64; for (int i = 0; str[i] != '\0'; i++) { @@ -90,15 +90,15 @@ namespace fggl::util { // debug-only functions #ifndef NDEBUG - GUID intern_string(const char *str); - std::string guid_to_string(GUID guid); + auto intern_string(const char *str) -> GUID; + auto guid_to_string(GUID guid) -> std::string; #endif - constexpr GUID make_guid(const char *str) { + constexpr auto make_guid(const char *str) -> GUID { return GUID(hash_fnv1a_64(str)); } - inline GUID make_guid_rt(const char* str) { + inline auto make_guid_rt(const char* str) -> GUID { #ifndef NDEBUG return intern_string(str); #else @@ -106,7 +106,7 @@ namespace fggl::util { #endif } - inline GUID make_guid_rt(const std::string &str) { + inline auto make_guid_rt(const std::string &str) -> GUID { return make_guid_rt(str.c_str()); }