From 431a9c00a56cf4c603be1cf5f773b193621d8150 Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Mon, 19 Feb 2024 16:55:19 +0100 Subject: 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. --- source/core/StarJson.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/core/StarJson.cpp') diff --git a/source/core/StarJson.cpp b/source/core/StarJson.cpp index 2892e1c..3feaf37 100644 --- a/source/core/StarJson.cpp +++ b/source/core/StarJson.cpp @@ -745,7 +745,7 @@ Maybe Json::optQueryObject(String const& path) const { Json Json::set(String key, Json value) const { auto map = toObject(); - map[move(key)] = move(value); + map[std::move(key)] = std::move(value); return map; } @@ -760,31 +760,31 @@ Json Json::erasePath(String path) const { Json Json::setAll(JsonObject values) const { auto map = toObject(); for (auto& p : values) - map[move(p.first)] = move(p.second); + map[std::move(p.first)] = std::move(p.second); return map; } Json Json::eraseKey(String key) const { auto map = toObject(); - map.erase(move(key)); + map.erase(std::move(key)); return map; } Json Json::set(size_t index, Json value) const { auto array = toArray(); - array[index] = move(value); + array[index] = std::move(value); return array; } Json Json::insert(size_t index, Json value) const { auto array = toArray(); - array.insertAt(index, move(value)); + array.insertAt(index, std::move(value)); return array; } Json Json::append(Json value) const { auto array = toArray(); - array.append(move(value)); + array.append(std::move(value)); return array; } @@ -927,7 +927,7 @@ DataStream& operator>>(DataStream& os, Json& v) { for (size_t i = 0; i < s; ++i) l.append(os.read()); - v = move(l); + v = std::move(l); } else if (type == Json::Type::Object) { JsonObject m; size_t s = os.readVlqU(); @@ -936,7 +936,7 @@ DataStream& operator>>(DataStream& os, Json& v) { m[k] = os.read(); } - v = move(m); + v = std::move(m); } return os; -- cgit v1.2.3