diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/process.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/command_classes/sync_manager.cpp | 14 | ||||
| -rw-r--r-- | src/video_core/command_classes/sync_manager.h | 4 | ||||
| -rw-r--r-- | src/web_service/web_backend.cpp | 5 |
4 files changed, 11 insertions, 15 deletions
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index ff9d9248b..b17529dee 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <bitset> | 6 | #include <bitset> |
| 7 | #include <ctime> | ||
| 7 | #include <memory> | 8 | #include <memory> |
| 8 | #include <random> | 9 | #include <random> |
| 9 | #include "common/alignment.h" | 10 | #include "common/alignment.h" |
| @@ -123,7 +124,7 @@ std::shared_ptr<Process> Process::Create(Core::System& system, std::string name, | |||
| 123 | : kernel.CreateNewUserProcessID(); | 124 | : kernel.CreateNewUserProcessID(); |
| 124 | process->capabilities.InitializeForMetadatalessProcess(); | 125 | process->capabilities.InitializeForMetadatalessProcess(); |
| 125 | 126 | ||
| 126 | std::mt19937 rng(Settings::values.rng_seed.GetValue().value_or(0)); | 127 | std::mt19937 rng(Settings::values.rng_seed.GetValue().value_or(std::time(nullptr))); |
| 127 | std::uniform_int_distribution<u64> distribution; | 128 | std::uniform_int_distribution<u64> distribution; |
| 128 | std::generate(process->random_entropy.begin(), process->random_entropy.end(), | 129 | std::generate(process->random_entropy.begin(), process->random_entropy.end(), |
| 129 | [&] { return distribution(rng); }); | 130 | [&] { return distribution(rng); }); |
diff --git a/src/video_core/command_classes/sync_manager.cpp b/src/video_core/command_classes/sync_manager.cpp index a0ab44855..19dc9e0ab 100644 --- a/src/video_core/command_classes/sync_manager.cpp +++ b/src/video_core/command_classes/sync_manager.cpp | |||
| @@ -27,22 +27,22 @@ SyncptIncrManager::SyncptIncrManager(GPU& gpu_) : gpu(gpu_) {} | |||
| 27 | SyncptIncrManager::~SyncptIncrManager() = default; | 27 | SyncptIncrManager::~SyncptIncrManager() = default; |
| 28 | 28 | ||
| 29 | void SyncptIncrManager::Increment(u32 id) { | 29 | void SyncptIncrManager::Increment(u32 id) { |
| 30 | increments.push_back(SyncptIncr{0, id, true}); | 30 | increments.emplace_back(0, 0, id, true); |
| 31 | IncrementAllDone(); | 31 | IncrementAllDone(); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | u32 SyncptIncrManager::IncrementWhenDone(u32 class_id, u32 id) { | 34 | u32 SyncptIncrManager::IncrementWhenDone(u32 class_id, u32 id) { |
| 35 | const u32 handle = current_id++; | 35 | const u32 handle = current_id++; |
| 36 | increments.push_back(SyncptIncr{handle, class_id, id}); | 36 | increments.emplace_back(handle, class_id, id); |
| 37 | return handle; | 37 | return handle; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | void SyncptIncrManager::SignalDone(u32 handle) { | 40 | void SyncptIncrManager::SignalDone(u32 handle) { |
| 41 | auto done_incr = std::find_if(increments.begin(), increments.end(), | 41 | const auto done_incr = |
| 42 | [handle](SyncptIncr incr) { return incr.id == handle; }); | 42 | std::find_if(increments.begin(), increments.end(), |
| 43 | if (done_incr != increments.end()) { | 43 | [handle](const SyncptIncr& incr) { return incr.id == handle; }); |
| 44 | const SyncptIncr incr = *done_incr; | 44 | if (done_incr != increments.cend()) { |
| 45 | *done_incr = SyncptIncr{incr.id, incr.class_id, incr.syncpt_id, true}; | 45 | done_incr->complete = true; |
| 46 | } | 46 | } |
| 47 | IncrementAllDone(); | 47 | IncrementAllDone(); |
| 48 | } | 48 | } |
diff --git a/src/video_core/command_classes/sync_manager.h b/src/video_core/command_classes/sync_manager.h index 353b67573..2c321ec58 100644 --- a/src/video_core/command_classes/sync_manager.h +++ b/src/video_core/command_classes/sync_manager.h | |||
| @@ -32,8 +32,8 @@ struct SyncptIncr { | |||
| 32 | u32 syncpt_id; | 32 | u32 syncpt_id; |
| 33 | bool complete; | 33 | bool complete; |
| 34 | 34 | ||
| 35 | SyncptIncr(u32 id, u32 syncpt_id_, u32 class_id_, bool done = false) | 35 | SyncptIncr(u32 id_, u32 class_id_, u32 syncpt_id_, bool done = false) |
| 36 | : id(id), class_id(class_id_), syncpt_id(syncpt_id_), complete(done) {} | 36 | : id(id_), class_id(class_id_), syncpt_id(syncpt_id_), complete(done) {} |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | class SyncptIncrManager { | 39 | class SyncptIncrManager { |
diff --git a/src/web_service/web_backend.cpp b/src/web_service/web_backend.cpp index f264b98a0..67183e64c 100644 --- a/src/web_service/web_backend.cpp +++ b/src/web_service/web_backend.cpp | |||
| @@ -71,11 +71,6 @@ struct Client::Impl { | |||
| 71 | return {}; | 71 | return {}; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | if (!cli->is_socket_open()) { | ||
| 75 | LOG_ERROR(WebService, "Failed to open socket, skipping request!"); | ||
| 76 | return {}; | ||
| 77 | } | ||
| 78 | |||
| 79 | cli->set_connection_timeout(TIMEOUT_SECONDS); | 74 | cli->set_connection_timeout(TIMEOUT_SECONDS); |
| 80 | cli->set_read_timeout(TIMEOUT_SECONDS); | 75 | cli->set_read_timeout(TIMEOUT_SECONDS); |
| 81 | cli->set_write_timeout(TIMEOUT_SECONDS); | 76 | cli->set_write_timeout(TIMEOUT_SECONDS); |