Apply suggestions from code review

Co-Authored-By: Mat M. <mathew1800@gmail.com>
This commit is contained in:
Hamish Milne 2020-03-29 11:39:46 +01:00 committed by GitHub
parent 841255cd16
commit 8f059ae398
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 23 additions and 22 deletions

View file

@ -58,7 +58,7 @@ public:
ConfigMemDef& GetConfigMem();
u8* GetPtr() override {
return static_cast<u8*>(static_cast<void*>(&config_mem));
return reinterpret_cast<u8*>(&config_mem));
}
u32 GetSize() const override {

View file

@ -21,7 +21,7 @@ class HLERequestContext::ThreadCallback : public Kernel::WakeupCallback {
public:
ThreadCallback(std::shared_ptr<HLERequestContext> context_,
std::shared_ptr<HLERequestContext::WakeupCallback> callback_)
: context(context_), callback(callback_) {}
: context(std::move(context_)), callback(std::move(callback_)) {}
void WakeUp(ThreadWakeupReason reason, std::shared_ptr<Thread> thread,
std::shared_ptr<WaitObject> object) {
ASSERT(thread->status == ThreadStatus::WaitHleEvent);
@ -296,7 +296,7 @@ MappedBuffer::MappedBuffer() : memory(&Core::Global<Core::System>().Memory()) {}
MappedBuffer::MappedBuffer(Memory::MemorySystem& memory, std::shared_ptr<Process> process,
u32 descriptor, VAddr address, u32 id)
: memory(&memory), id(id), address(address), process(process) {
: memory(&memory), id(id), address(address), process(std::move(process)) {
IPC::MappedBufferDescInfo desc{descriptor};
size = desc.size;
perms = desc.perms;

View file

@ -24,7 +24,8 @@ KernelSystem::KernelSystem(Memory::MemorySystem& memory, Core::Timing& timing,
u32 num_cores, u8 n3ds_mode)
: memory(memory), timing(timing),
prepare_reschedule_callback(std::move(prepare_reschedule_callback)) {
for (auto i = 0; i < memory_regions.size(); i++) {
std::generate(memory_regions.begin(), memory_regions.end(),
[] { return std::make_shared<MemoryRegionInfo>(); });
memory_regions[i] = std::make_shared<MemoryRegionInfo>();
}
MemoryInit(system_mode, n3ds_mode);

View file

@ -409,7 +409,7 @@ static ResultCode ReceiveIPCRequest(Kernel::KernelSystem& kernel, Memory::Memory
class SVC_SyncCallback : public Kernel::WakeupCallback {
public:
SVC_SyncCallback(bool do_output_) : do_output(do_output_) {}
explicit SVC_SyncCallback(bool do_output_) : do_output(do_output_) {}
void WakeUp(ThreadWakeupReason reason, std::shared_ptr<Thread> thread,
std::shared_ptr<WaitObject> object) {
@ -442,7 +442,7 @@ private:
class SVC_IPCCallback : public Kernel::WakeupCallback {
public:
SVC_IPCCallback(Core::System& system_) : system(system_) {}
explicit SVC_IPCCallback(Core::System& system_) : system(system_) {}
void WakeUp(ThreadWakeupReason reason, std::shared_ptr<Thread> thread,
std::shared_ptr<WaitObject> object) {