summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Morph2022-05-26 19:57:11 -0400
committerGravatar Morph2022-06-13 18:19:22 -0400
commit12156b199a13d7147f3fe6aebe72ae0c257986a5 (patch)
treecc315cb877b7555cb80c6f4322de8beb6bb12cdb
parentMerge pull request #8446 from liamwhite/cmd-gdb (diff)
downloadyuzu-12156b199a13d7147f3fe6aebe72ae0c257986a5.tar.gz
yuzu-12156b199a13d7147f3fe6aebe72ae0c257986a5.tar.xz
yuzu-12156b199a13d7147f3fe6aebe72ae0c257986a5.zip
web_service: Eliminate variable shadowing
-rw-r--r--src/web_service/telemetry_json.cpp4
-rw-r--r--src/web_service/web_backend.cpp20
2 files changed, 12 insertions, 12 deletions
diff --git a/src/web_service/telemetry_json.cpp b/src/web_service/telemetry_json.cpp
index 6215c914f..46faddb61 100644
--- a/src/web_service/telemetry_json.cpp
+++ b/src/web_service/telemetry_json.cpp
@@ -13,8 +13,8 @@ namespace WebService {
13namespace Telemetry = Common::Telemetry; 13namespace Telemetry = Common::Telemetry;
14 14
15struct TelemetryJson::Impl { 15struct TelemetryJson::Impl {
16 Impl(std::string host, std::string username, std::string token) 16 Impl(std::string host_, std::string username_, std::string token_)
17 : host{std::move(host)}, username{std::move(username)}, token{std::move(token)} {} 17 : host{std::move(host_)}, username{std::move(username_)}, token{std::move(token_)} {}
18 18
19 nlohmann::json& TopSection() { 19 nlohmann::json& TopSection() {
20 return sections[static_cast<u8>(Telemetry::FieldType::None)]; 20 return sections[static_cast<u8>(Telemetry::FieldType::None)];
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp
index 58b0c2f10..dce9772fe 100644
--- a/src/web_service/web_backend.cpp
+++ b/src/web_service/web_backend.cpp
@@ -30,10 +30,10 @@ constexpr std::array<const char, 1> API_VERSION{'1'};
30constexpr std::size_t TIMEOUT_SECONDS = 30; 30constexpr std::size_t TIMEOUT_SECONDS = 30;
31 31
32struct Client::Impl { 32struct Client::Impl {
33 Impl(std::string host, std::string username, std::string token) 33 Impl(std::string host_, std::string username_, std::string token_)
34 : host{std::move(host)}, username{std::move(username)}, token{std::move(token)} { 34 : host{std::move(host_)}, username{std::move(username_)}, token{std::move(token_)} {
35 std::scoped_lock lock{jwt_cache.mutex}; 35 std::scoped_lock lock{jwt_cache.mutex};
36 if (this->username == jwt_cache.username && this->token == jwt_cache.token) { 36 if (username == jwt_cache.username && token == jwt_cache.token) {
37 jwt = jwt_cache.jwt; 37 jwt = jwt_cache.jwt;
38 } 38 }
39 } 39 }
@@ -69,8 +69,8 @@ struct Client::Impl {
69 */ 69 */
70 WebResult GenericRequest(const std::string& method, const std::string& path, 70 WebResult GenericRequest(const std::string& method, const std::string& path,
71 const std::string& data, const std::string& accept, 71 const std::string& data, const std::string& accept,
72 const std::string& jwt = "", const std::string& username = "", 72 const std::string& jwt_ = "", const std::string& username_ = "",
73 const std::string& token = "") { 73 const std::string& token_ = "") {
74 if (cli == nullptr) { 74 if (cli == nullptr) {
75 cli = std::make_unique<httplib::Client>(host.c_str()); 75 cli = std::make_unique<httplib::Client>(host.c_str());
76 } 76 }
@@ -85,14 +85,14 @@ struct Client::Impl {
85 cli->set_write_timeout(TIMEOUT_SECONDS); 85 cli->set_write_timeout(TIMEOUT_SECONDS);
86 86
87 httplib::Headers params; 87 httplib::Headers params;
88 if (!jwt.empty()) { 88 if (!jwt_.empty()) {
89 params = { 89 params = {
90 {std::string("Authorization"), fmt::format("Bearer {}", jwt)}, 90 {std::string("Authorization"), fmt::format("Bearer {}", jwt_)},
91 }; 91 };
92 } else if (!username.empty()) { 92 } else if (!username_.empty()) {
93 params = { 93 params = {
94 {std::string("x-username"), username}, 94 {std::string("x-username"), username_},
95 {std::string("x-token"), token}, 95 {std::string("x-token"), token_},
96 }; 96 };
97 } 97 }
98 98