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/utility | |
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/utility')
-rw-r--r-- | source/utility/asset_unpacker.cpp | 2 | ||||
-rw-r--r-- | source/utility/btree_repacker.cpp | 4 | ||||
-rw-r--r-- | source/utility/dungeon_generation_benchmark.cpp | 2 | ||||
-rw-r--r-- | source/utility/game_repl.cpp | 2 | ||||
-rw-r--r-- | source/utility/generation_benchmark.cpp | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/source/utility/asset_unpacker.cpp b/source/utility/asset_unpacker.cpp index 487d0b7..9e5d5f3 100644 --- a/source/utility/asset_unpacker.cpp +++ b/source/utility/asset_unpacker.cpp @@ -42,7 +42,7 @@ int main(int argc, char** argv) { auto metadata = assetsPack.metadata(); if (!metadata.empty()) - File::writeFile(Json(move(metadata)).printJson(2), "_metadata"); + File::writeFile(Json(std::move(metadata)).printJson(2), "_metadata"); coutf("Unpacked assets to {} in {}s\n", outputFolderPath, Time::monotonicTime() - startTime); return 0; diff --git a/source/utility/btree_repacker.cpp b/source/utility/btree_repacker.cpp index ee65609..4276571 100644 --- a/source/utility/btree_repacker.cpp +++ b/source/utility/btree_repacker.cpp @@ -22,7 +22,7 @@ int main(int argc, char** argv) { outputFilename = File::relativeTo(File::fullPath(File::dirName(outputFilename)), File::baseName(outputFilename)); //open the old db BTreeDatabase db; - db.setIODevice(std::move(File::open(bTreePath, IOMode::Read))); + db.setIODevice(File::open(bTreePath, IOMode::Read)); db.open(); //make a new db @@ -32,7 +32,7 @@ int main(int argc, char** argv) { newDb.setKeySize(db.keySize()); newDb.setAutoCommit(false); - newDb.setIODevice(std::move(File::open(outputFilename, IOMode::ReadWrite | IOMode::Truncate))); + newDb.setIODevice(File::open(outputFilename, IOMode::ReadWrite | IOMode::Truncate)); newDb.open(); coutf("Repacking {}...\n", bTreePath); //copy the data over diff --git a/source/utility/dungeon_generation_benchmark.cpp b/source/utility/dungeon_generation_benchmark.cpp index 70cbe9e..1467e02 100644 --- a/source/utility/dungeon_generation_benchmark.cpp +++ b/source/utility/dungeon_generation_benchmark.cpp @@ -47,7 +47,7 @@ int main(int argc, char** argv) { VisitableWorldParametersPtr worldParameters = generateFloatingDungeonWorldParameters(dungeonWorldName); auto worldTemplate = make_shared<WorldTemplate>(worldParameters, SkyParameters(), 1234); - WorldServer worldServer(move(worldTemplate), File::ephemeralFile()); + WorldServer worldServer(std::move(worldTemplate), File::ephemeralFile()); } coutf("Finished {} generations of dungeonWorld {} in {} seconds", repetitions, dungeonWorldName, Time::monotonicTime() - start); diff --git a/source/utility/game_repl.cpp b/source/utility/game_repl.cpp index 3ffc300..08ea8e1 100644 --- a/source/utility/game_repl.cpp +++ b/source/utility/game_repl.cpp @@ -22,7 +22,7 @@ int main(int argc, char** argv) { auto getline = [](std::istream& stream) -> String { std::string line; std::getline(stream, line); - return String(move(line)); + return String(std::move(line)); }; if (continuation) { diff --git a/source/utility/generation_benchmark.cpp b/source/utility/generation_benchmark.cpp index 8e1631c..c96095e 100644 --- a/source/utility/generation_benchmark.cpp +++ b/source/utility/generation_benchmark.cpp @@ -51,7 +51,7 @@ int main(int argc, char** argv) { auto rand = RandomSource(worldTemplate->worldSeed()); - WorldServer worldServer(move(worldTemplate), File::ephemeralFile()); + WorldServer worldServer(std::move(worldTemplate), File::ephemeralFile()); Vec2U worldSize = worldServer.geometry().size(); double start = Time::monotonicTime(); |