Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/core/StarRpcPromise.hpp
diff options
context:
space:
mode:
authorKai Blaschke <kai.blaschke@kb-dev.net>2024-02-19 16:55:19 +0100
committerKai Blaschke <kai.blaschke@kb-dev.net>2024-02-19 16:55:19 +0100
commit431a9c00a56cf4c603be1cf5f773b193621d8150 (patch)
tree95843aeea9fb6dc18279ee05ff6961f40b19798f /source/core/StarRpcPromise.hpp
parent30e1871d3f44629e00a1f66d8164e3e62c7f889f (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/core/StarRpcPromise.hpp')
-rw-r--r--source/core/StarRpcPromise.hpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/core/StarRpcPromise.hpp b/source/core/StarRpcPromise.hpp
index dcfd242..7a08750 100644
--- a/source/core/StarRpcPromise.hpp
+++ b/source/core/StarRpcPromise.hpp
@@ -70,17 +70,17 @@ private:
template <typename Result, typename Error>
void RpcPromiseKeeper<Result, Error>::fulfill(Result result) {
- m_fulfill(move(result));
+ m_fulfill(std::move(result));
}
template <typename Result, typename Error>
void RpcPromiseKeeper<Result, Error>::fail(Error error) {
- m_fail(move(error));
+ m_fail(std::move(error));
}
template <typename Result, typename Error>
pair<RpcPromise<Result, Error>, RpcPromiseKeeper<Result, Error>> RpcPromise<Result, Error>::createPair() {
- auto valuePtr = make_shared<Value>();
+ auto valuePtr = std::make_shared<Value>();
RpcPromise promise;
promise.m_getValue = [valuePtr]() {
@@ -91,21 +91,21 @@ pair<RpcPromise<Result, Error>, RpcPromiseKeeper<Result, Error>> RpcPromise<Resu
keeper.m_fulfill = [valuePtr](Result result) {
if (valuePtr->result || valuePtr->error)
throw RpcPromiseException("fulfill called on already finished RpcPromise");
- valuePtr->result = move(result);
+ valuePtr->result = std::move(result);
};
keeper.m_fail = [valuePtr](Error error) {
if (valuePtr->result || valuePtr->error)
throw RpcPromiseException("fail called on already finished RpcPromise");
- valuePtr->error = move(error);
+ valuePtr->error = std::move(error);
};
- return {move(promise), move(keeper)};
+ return {std::move(promise), std::move(keeper)};
}
template <typename Result, typename Error>
RpcPromise<Result, Error> RpcPromise<Result, Error>::createFulfilled(Result result) {
- auto valuePtr = make_shared<Value>();
- valuePtr->result = move(result);
+ auto valuePtr = std::make_shared<Value>();
+ valuePtr->result = std::move(result);
RpcPromise<Result, Error> promise;
promise.m_getValue = [valuePtr]() {
@@ -116,8 +116,8 @@ RpcPromise<Result, Error> RpcPromise<Result, Error>::createFulfilled(Result resu
template <typename Result, typename Error>
RpcPromise<Result, Error> RpcPromise<Result, Error>::createFailed(Error error) {
- auto valuePtr = make_shared<Value>();
- valuePtr->error = move(error);
+ auto valuePtr = std::make_shared<Value>();
+ valuePtr->error = std::move(error);
RpcPromise<Result, Error> promise;
promise.m_getValue = [valuePtr]() {
@@ -157,7 +157,7 @@ template <typename Function>
decltype(auto) RpcPromise<Result, Error>::wrap(Function function) {
typedef RpcPromise<typename std::decay<decltype(function(std::declval<Result>()))>::type, Error> WrappedPromise;
WrappedPromise wrappedPromise;
- wrappedPromise.m_getValue = [wrapper = move(function), valuePtr = make_shared<typename WrappedPromise::Value>(), otherGetValue = m_getValue]() {
+ wrappedPromise.m_getValue = [wrapper = std::move(function), valuePtr = std::make_shared<typename WrappedPromise::Value>(), otherGetValue = m_getValue]() {
if (!valuePtr->result && !valuePtr->error) {
auto otherValue = otherGetValue();
if (otherValue->result)