Skip to content

Commit

Permalink
Fixing various issues reported by static code analysis and compiler w…
Browse files Browse the repository at this point in the history
…arnings
  • Loading branch information
jgaa committed Aug 17, 2024
1 parent 1cacbfe commit e2020a5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ if (MSVC)
# Thank you Microsoft. Its so nice of you to give us all these meaningful reasons to stay up all night.
check_cxx_compiler_flag("/std:c++20" COMPILER_SUPPORTS_CXX20)
check_cxx_compiler_flag("/std:c++17" COMPILER_SUPPORTS_CXX17)
add_compile_options(/Zc:__cplusplus)
else()
check_cxx_compiler_flag("-std=c++20" COMPILER_SUPPORTS_CXX20)
check_cxx_compiler_flag("-std=c++17" COMPILER_SUPPORTS_CXX17)
Expand Down
6 changes: 3 additions & 3 deletions include/restc-cpp/IteratorFromJsonSerializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class IteratorFromJsonSerializer
}

Iterator(Iterator&& it)
: owner_{it.owner_}, data_{move(it.data_)} {}
: owner_{it.owner_}, data_{std::move(it.data_)} {}

Iterator(IteratorFromJsonSerializer *owner)
: owner_{owner} {}
Expand Down Expand Up @@ -71,7 +71,7 @@ class IteratorFromJsonSerializer

Iterator& operator = (Iterator&& it) {
owner_ = it.owner_;
it.data_ = move(it.data_);
it.data_ = std::move(it.data_);
}

bool operator == (const Iterator& other) const {
Expand Down Expand Up @@ -171,7 +171,7 @@ class IteratorFromJsonSerializer
RapidJsonDeserializer<objectT> handler(
*data, *properties_);
json_reader_.Parse(reply_stream_, handler);
return move(data);
return std::move(data);
} else if (ch == ']') {
reply_stream_.Take();
state_ = State::DONE;
Expand Down
10 changes: 5 additions & 5 deletions include/restc-cpp/RequestBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class RequestBuilder
args_ = Request::args_t();
}

args_->push_back({move(name), move(value)});
args_->push_back({std::move(name), std::move(value)});
return *this;
}

Expand All @@ -202,14 +202,14 @@ class RequestBuilder
* \param value Value of the argument
*/
RequestBuilder& Argument(std::string name, int64_t value) {
return Argument(move(name), std::to_string(value));
return Argument(std::move(name), std::to_string(value));
}

/*! Supply your own RequestBody to the request
*/
RequestBuilder& Body(std::unique_ptr<RequestBody> body) {
assert(!body_);
body_ = move(body);
body_ = std::move(body);
return *this;
}

Expand Down Expand Up @@ -252,7 +252,7 @@ class RequestBuilder
*/
RequestBuilder& Data(std::string&& body) {
assert(!body_);
body_ = RequestBody::CreateStringBody(move(body));
body_ = RequestBody::CreateStringBody(std::move(body));
return *this;
}

Expand Down Expand Up @@ -368,7 +368,7 @@ class RequestBuilder
}
#endif
auto req = Request::Create(
url_, type_, ctx_->GetClient(), move(body_), args_, headers_, auth_);
url_, type_, ctx_->GetClient(), std::move(body_), args_, headers_, auth_);

auto orig = req->GetProperties();

Expand Down
2 changes: 1 addition & 1 deletion include/restc-cpp/restc-cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ class RestClient {
done_handler.reset();
});

return move(future);
return future;
}

/*! Process from within an existing coroutine */
Expand Down

0 comments on commit e2020a5

Please sign in to comment.