diff options
author | bunnei <bunneidev@gmail.com> | 2018-10-12 18:08:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-12 18:08:08 +0200 |
commit | 2946d4bdbe8d2432a0991e750adb9ef5a04cee09 (patch) | |
tree | 8d43f916215bb0e25c5cdd5061c5f1dbc1361673 /src/core/hle/kernel/svc_wrap.h | |
parent | Merge pull request #1478 from ogniK5377/remap-invalidhandle-remap (diff) | |
parent | Changed all casts in svc_wrap.h to be static_cast instead (diff) | |
download | yuzu-2946d4bdbe8d2432a0991e750adb9ef5a04cee09.tar yuzu-2946d4bdbe8d2432a0991e750adb9ef5a04cee09.tar.gz yuzu-2946d4bdbe8d2432a0991e750adb9ef5a04cee09.tar.bz2 yuzu-2946d4bdbe8d2432a0991e750adb9ef5a04cee09.tar.lz yuzu-2946d4bdbe8d2432a0991e750adb9ef5a04cee09.tar.xz yuzu-2946d4bdbe8d2432a0991e750adb9ef5a04cee09.tar.zst yuzu-2946d4bdbe8d2432a0991e750adb9ef5a04cee09.zip |
Diffstat (limited to 'src/core/hle/kernel/svc_wrap.h')
-rw-r--r-- | src/core/hle/kernel/svc_wrap.h | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h index 22712e64f..cbb80c3c4 100644 --- a/src/core/hle/kernel/svc_wrap.h +++ b/src/core/hle/kernel/svc_wrap.h @@ -35,18 +35,18 @@ void SvcWrap() { template <ResultCode func(u32)> void SvcWrap() { - FuncReturn(func((u32)Param(0)).raw); + FuncReturn(func(static_cast<u32>(Param(0))).raw); } template <ResultCode func(u32, u32)> void SvcWrap() { - FuncReturn(func((u32)Param(0), (u32)Param(1)).raw); + FuncReturn(func(static_cast<u32>(Param(0)), static_cast<u32>(Param(1))).raw); } template <ResultCode func(u32*, u32)> void SvcWrap() { u32 param_1 = 0; - u32 retval = func(¶m_1, (u32)Param(1)).raw; + u32 retval = func(¶m_1, static_cast<u32>(Param(1))).raw; Core::CurrentArmInterface().SetReg(1, param_1); FuncReturn(retval); } @@ -61,7 +61,7 @@ void SvcWrap() { template <ResultCode func(u64, s32)> void SvcWrap() { - FuncReturn(func(Param(0), (s32)Param(1)).raw); + FuncReturn(func(Param(0), static_cast<s32>(Param(1))).raw); } template <ResultCode func(u64, u32)> @@ -79,19 +79,19 @@ void SvcWrap() { template <ResultCode func(u32, u64)> void SvcWrap() { - FuncReturn(func((u32)(Param(0) & 0xFFFFFFFF), Param(1)).raw); + FuncReturn(func(static_cast<u32>(Param(0)), Param(1)).raw); } template <ResultCode func(u32, u32, u64)> void SvcWrap() { - FuncReturn(func((u32)(Param(0) & 0xFFFFFFFF), (u32)(Param(1) & 0xFFFFFFFF), Param(2)).raw); + FuncReturn(func(static_cast<u32>(Param(0)), static_cast<u32>(Param(1)), Param(2)).raw); } template <ResultCode func(u32, u32*, u64*)> void SvcWrap() { u32 param_1 = 0; u64 param_2 = 0; - ResultCode retval = func((u32)(Param(2) & 0xFFFFFFFF), ¶m_1, ¶m_2); + ResultCode retval = func(static_cast<u32>(Param(2)), ¶m_1, ¶m_2); Core::CurrentArmInterface().SetReg(1, param_1); Core::CurrentArmInterface().SetReg(2, param_2); FuncReturn(retval.raw); @@ -100,12 +100,12 @@ void SvcWrap() { template <ResultCode func(u64, u64, u32, u32)> void SvcWrap() { FuncReturn( - func(Param(0), Param(1), (u32)(Param(3) & 0xFFFFFFFF), (u32)(Param(3) & 0xFFFFFFFF)).raw); + func(Param(0), Param(1), static_cast<u32>(Param(3)), static_cast<u32>(Param(3))).raw); } template <ResultCode func(u32, u64, u32)> void SvcWrap() { - FuncReturn(func((u32)Param(0), Param(1), (u32)Param(2)).raw); + FuncReturn(func(static_cast<u32>(Param(0)), Param(1), static_cast<u32>(Param(2))).raw); } template <ResultCode func(u64, u64, u64)> @@ -115,25 +115,28 @@ void SvcWrap() { template <ResultCode func(u32, u64, u64, u32)> void SvcWrap() { - FuncReturn(func((u32)Param(0), Param(1), Param(2), (u32)Param(3)).raw); + FuncReturn( + func(static_cast<u32>(Param(0)), Param(1), Param(2), static_cast<u32>(Param(3))).raw); } template <ResultCode func(u32, u64, u64)> void SvcWrap() { - FuncReturn(func((u32)Param(0), Param(1), Param(2)).raw); + FuncReturn(func(static_cast<u32>(Param(0)), Param(1), Param(2)).raw); } template <ResultCode func(u32*, u64, u64, s64)> void SvcWrap() { u32 param_1 = 0; - ResultCode retval = func(¶m_1, Param(1), (u32)(Param(2) & 0xFFFFFFFF), (s64)Param(3)); + ResultCode retval = + func(¶m_1, Param(1), static_cast<u32>(Param(2)), static_cast<s64>(Param(3))); Core::CurrentArmInterface().SetReg(1, param_1); FuncReturn(retval.raw); } template <ResultCode func(u64, u64, u32, s64)> void SvcWrap() { - FuncReturn(func(Param(0), Param(1), (u32)Param(2), (s64)Param(3)).raw); + FuncReturn( + func(Param(0), Param(1), static_cast<u32>(Param(2)), static_cast<s64>(Param(3))).raw); } template <ResultCode func(u64*, u64, u64, u64)> @@ -147,9 +150,9 @@ void SvcWrap() { template <ResultCode func(u32*, u64, u64, u64, u32, s32)> void SvcWrap() { u32 param_1 = 0; - u32 retval = - func(¶m_1, Param(1), Param(2), Param(3), (u32)Param(4), (s32)(Param(5) & 0xFFFFFFFF)) - .raw; + u32 retval = func(¶m_1, Param(1), Param(2), Param(3), static_cast<u32>(Param(4)), + static_cast<s32>(Param(5))) + .raw; Core::CurrentArmInterface().SetReg(1, param_1); FuncReturn(retval); } @@ -172,7 +175,7 @@ void SvcWrap() { template <ResultCode func(u32*, u64, u64, u32)> void SvcWrap() { u32 param_1 = 0; - u32 retval = func(¶m_1, Param(1), Param(2), (u32)(Param(3) & 0xFFFFFFFF)).raw; + u32 retval = func(¶m_1, Param(1), Param(2), static_cast<u32>(Param(3))).raw; Core::CurrentArmInterface().SetReg(1, param_1); FuncReturn(retval); } @@ -181,22 +184,22 @@ template <ResultCode func(Handle*, u64, u32, u32)> void SvcWrap() { u32 param_1 = 0; u32 retval = - func(¶m_1, Param(1), (u32)(Param(2) & 0xFFFFFFFF), (u32)(Param(3) & 0xFFFFFFFF)).raw; + func(¶m_1, Param(1), static_cast<u32>(Param(2)), static_cast<u32>(Param(3))).raw; Core::CurrentArmInterface().SetReg(1, param_1); FuncReturn(retval); } template <ResultCode func(u64, u32, s32, s64)> void SvcWrap() { - FuncReturn( - func(Param(0), (u32)(Param(1) & 0xFFFFFFFF), (s32)(Param(2) & 0xFFFFFFFF), (s64)Param(3)) - .raw); + FuncReturn(func(Param(0), static_cast<u32>(Param(1)), static_cast<s32>(Param(2)), + static_cast<s64>(Param(3))) + .raw); } template <ResultCode func(u64, u32, s32, s32)> void SvcWrap() { - FuncReturn(func(Param(0), (u32)(Param(1) & 0xFFFFFFFF), (s32)(Param(2) & 0xFFFFFFFF), - (s32)(Param(3) & 0xFFFFFFFF)) + FuncReturn(func(Param(0), static_cast<u32>(Param(1)), static_cast<s32>(Param(2)), + static_cast<s32>(Param(3))) .raw); } @@ -226,7 +229,7 @@ void SvcWrap() { template <void func(s64)> void SvcWrap() { - func((s64)Param(0)); + func(static_cast<s64>(Param(0))); } template <void func(u64, u64 len)> @@ -239,4 +242,9 @@ void SvcWrap() { func(Param(0), Param(1), Param(2)); } +template <void func(u32, u64, u64)> +void SvcWrap() { + func(static_cast<u32>(Param(0)), Param(1), Param(2)); +} + } // namespace Kernel |