diff options
author | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 16:55:19 +0100 |
---|---|---|
committer | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 16:55:19 +0100 |
commit | 431a9c00a56cf4c603be1cf5f773b193621d8150 (patch) | |
tree | 95843aeea9fb6dc18279ee05ff6961f40b19798f /source/base/StarAssets.cpp | |
parent | 30e1871d3f44629e00a1f66d8164e3e62c7f889f (diff) |
Fixed a huge amount of Clang warnings
On Linux and macOS, using Clang to compile OpenStarbound produces about 400 MB worth of warnings during the build, making the compiler output unreadable and slowing the build down considerably.
99% of the warnings were unqualified uses of std::move and std::forward, which are now all properly qualified.
Fixed a few other minor warnings about non-virtual destructors and some uses of std::move preventing copy elision on temporary objects.
Most remaining warnings are now unused parameters.
Diffstat (limited to 'source/base/StarAssets.cpp')
-rw-r--r-- | source/base/StarAssets.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/source/base/StarAssets.cpp b/source/base/StarAssets.cpp index 8956ba9..135945c 100644 --- a/source/base/StarAssets.cpp +++ b/source/base/StarAssets.cpp @@ -71,17 +71,17 @@ Maybe<RectU> FramesSpecification::getRect(String const& frame) const { Assets::Assets(Settings settings, StringList assetSources) { const char* const AssetsPatchSuffix = ".patch"; - m_settings = move(settings); + m_settings = std::move(settings); m_stopThreads = false; - m_assetSources = move(assetSources); + m_assetSources = std::move(assetSources); for (auto& sourcePath : m_assetSources) { Logger::info("Loading assets from: '{}'", sourcePath); AssetSourcePtr source; if (File::isDirectory(sourcePath)) - source = make_shared<DirectoryAssetSource>(sourcePath, m_settings.pathIgnore); + source = std::make_shared<DirectoryAssetSource>(sourcePath, m_settings.pathIgnore); else - source = make_shared<PackedAssetSource>(sourcePath); + source = std::make_shared<PackedAssetSource>(sourcePath); m_assetSourcePaths.add(sourcePath, source); @@ -225,7 +225,7 @@ Json Assets::json(String const& path) const { auto components = AssetPath::split(path); validatePath(components, true, false); - return as<JsonData>(getAsset(AssetId{AssetType::Json, move(components)}))->json; + return as<JsonData>(getAsset(AssetId{AssetType::Json, std::move(components)}))->json; } Json Assets::fetchJson(Json const& v, String const& dir) const { @@ -255,7 +255,7 @@ void Assets::queueImages(StringList const& paths) const { auto components = AssetPath::split(path); validatePath(components, true, true); - return AssetId{AssetType::Image, move(components)}; + return AssetId{AssetType::Image, std::move(components)}; })); } @@ -280,7 +280,7 @@ AudioConstPtr Assets::audio(String const& path) const { auto components = AssetPath::split(path); validatePath(components, false, false); - return as<AudioData>(getAsset(AssetId{AssetType::Audio, move(components)}))->audio; + return as<AudioData>(getAsset(AssetId{AssetType::Audio, std::move(components)}))->audio; } void Assets::queueAudios(StringList const& paths) const { @@ -288,7 +288,7 @@ void Assets::queueAudios(StringList const& paths) const { const auto components = AssetPath::split(path); validatePath(components, false, false); - return AssetId{AssetType::Audio, move(components)}; + return AssetId{AssetType::Audio, std::move(components)}; })); } @@ -296,7 +296,7 @@ AudioConstPtr Assets::tryAudio(String const& path) const { auto components = AssetPath::split(path); validatePath(components, false, false); - if (auto audioData = as<AudioData>(tryAsset(AssetId{AssetType::Audio, move(components)}))) + if (auto audioData = as<AudioData>(tryAsset(AssetId{AssetType::Audio, std::move(components)}))) return audioData->audio; else return {}; @@ -306,14 +306,14 @@ FontConstPtr Assets::font(String const& path) const { auto components = AssetPath::split(path); validatePath(components, false, false); - return as<FontData>(getAsset(AssetId{AssetType::Font, move(components)}))->font; + return as<FontData>(getAsset(AssetId{AssetType::Font, std::move(components)}))->font; } ByteArrayConstPtr Assets::bytes(String const& path) const { auto components = AssetPath::split(path); validatePath(components, false, false); - return as<BytesData>(getAsset(AssetId{AssetType::Bytes, move(components)}))->bytes; + return as<BytesData>(getAsset(AssetId{AssetType::Bytes, std::move(components)}))->bytes; } IODevicePtr Assets::openFile(String const& path) const { @@ -386,7 +386,7 @@ bool Assets::BytesData::shouldPersist() const { FramesSpecification Assets::parseFramesSpecification(Json const& frameConfig, String path) { FramesSpecification framesSpecification; - framesSpecification.framesFile = move(path); + framesSpecification.framesFile = std::move(path); if (frameConfig.contains("frameList")) { for (auto const& pair : frameConfig.get("frameList").toObject()) { @@ -469,7 +469,7 @@ FramesSpecification Assets::parseFramesSpecification(Json const& frameConfig, St if (!framesSpecification.frames.contains(value)) throw AssetException(strf("No such frame '{}' found for alias '{}'", value, key)); - framesSpecification.aliases[key] = move(value); + framesSpecification.aliases[key] = std::move(value); } } @@ -866,7 +866,7 @@ shared_ptr<Assets::AssetData> Assets::loadImage(AssetPath const& path) const { for (auto const& ref : referencePaths) { auto components = AssetPath::split(ref); validatePath(components, true, false); - auto refImage = as<ImageData>(loadAsset(AssetId{AssetType::Image, move(components)})); + auto refImage = as<ImageData>(loadAsset(AssetId{AssetType::Image, std::move(components)})); if (!refImage) return {}; references[ref] = refImage->image; @@ -881,7 +881,7 @@ shared_ptr<Assets::AssetData> Assets::loadImage(AssetPath const& path) const { else processImageOperation(entry.operation, newImage, [&](String const& ref) { return references.get(ref).get(); }); }); - newData->image = make_shared<Image>(move(newImage)); + newData->image = make_shared<Image>(std::move(newImage)); return newData; }); |