From 687a17acae0944c0c585c58c69aca0391085f3ef Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 21 Jan 2018 16:56:58 -0500 Subject: nvmap: Make IoctlCommands an enum class Prevents the enum values from polluting the surrounding scope --- src/core/hle/service/nvdrv/devices/nvmap.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/core/hle/service/nvdrv/devices/nvmap.cpp') diff --git a/src/core/hle/service/nvdrv/devices/nvmap.cpp b/src/core/hle/service/nvdrv/devices/nvmap.cpp index d37b5b159..ca65d9d35 100644 --- a/src/core/hle/service/nvdrv/devices/nvmap.cpp +++ b/src/core/hle/service/nvdrv/devices/nvmap.cpp @@ -22,16 +22,16 @@ VAddr nvmap::GetObjectAddress(u32 handle) const { } u32 nvmap::ioctl(u32 command, const std::vector& input, std::vector& output) { - switch (command) { - case IocCreateCommand: + switch (static_cast(command)) { + case IoctlCommand::Create: return IocCreate(input, output); - case IocAllocCommand: + case IoctlCommand::Alloc: return IocAlloc(input, output); - case IocGetIdCommand: + case IoctlCommand::GetId: return IocGetId(input, output); - case IocFromIdCommand: + case IoctlCommand::FromId: return IocFromId(input, output); - case IocParamCommand: + case IoctlCommand::Param: return IocParam(input, output); } -- cgit v1.2.3 From 06d2e1bd23608cb5e64854c76b6e18911d9e0913 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 21 Jan 2018 17:07:44 -0500 Subject: nvmap: Add a return 0 underneath the UNIMPLEMENTED macro This macro resolves to an empty macro in release builds. --- src/core/hle/service/nvdrv/devices/nvmap.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/core/hle/service/nvdrv/devices/nvmap.cpp') diff --git a/src/core/hle/service/nvdrv/devices/nvmap.cpp b/src/core/hle/service/nvdrv/devices/nvmap.cpp index ca65d9d35..74ee7e154 100644 --- a/src/core/hle/service/nvdrv/devices/nvmap.cpp +++ b/src/core/hle/service/nvdrv/devices/nvmap.cpp @@ -36,6 +36,7 @@ u32 nvmap::ioctl(u32 command, const std::vector& input, std::vector& out } UNIMPLEMENTED(); + return 0; } u32 nvmap::IocCreate(const std::vector& input, std::vector& output) { -- cgit v1.2.3