Please sign in to comment.
PowerPC: Convert CPUCore enum into an enum class
Makes the enum values strongly-typed and prevents the identifiers from polluting the PowerPC namespace. This also cleans up the parameters of some functions where we were accepting an ambiguous int type and expecting the correct values to be passed in. Now those parameters accept a PowerPC::CPUCore type only, making it immediately obvious which values should be passed in. It also turns out we were storing these core types into other structures as plain ints, which have also been corrected. As this type is used directly with the configuration code, we need to provide our own overloaded insertion (<<) and extraction (>>) operators in order to make it compatible with it. These are fairly trivial to implement, so there's no issue here. A minor adjustment to TryParse() was required, as our generic function was doing the following: N tmp = 0; which is problematic, as custom types may not be able to have that assignment performed (e.g. strongly-typed enums), so we change this to: N tmp; which is sufficient, as the value is attempted to be initialized immediately under that statement.
- Loading branch information...
Showing with 147 additions and 76 deletions.
- +1 −1 Source/Android/jni/MainAndroid.cpp
- +3 −3 Source/Core/Common/StringUtil.h
- +7 −10 Source/Core/Core/BootManager.cpp
- +2 −1 Source/Core/Core/Config/MainSettings.cpp
- +6 −1 Source/Core/Core/Config/MainSettings.h
- +7 −4 Source/Core/Core/ConfigLoaders/MovieConfigLoader.cpp
- +5 −5 Source/Core/Core/ConfigManager.cpp
- +7 −1 Source/Core/Core/ConfigManager.h
- +1 −1 Source/Core/Core/Core.cpp
- +1 −1 Source/Core/Core/HW/CPU.cpp
- +6 −1 Source/Core/Core/HW/CPU.h
- +1 −1 Source/Core/Core/HW/HW.cpp
- +11 −1 Source/Core/Core/NetPlayClient.cpp
- +6 −1 Source/Core/Core/NetPlayProto.h
- +5 −4 Source/Core/Core/NetPlayServer.cpp
- +5 −5 Source/Core/Core/PowerPC/JitInterface.cpp
- +6 −1 Source/Core/Core/PowerPC/JitInterface.h
- +37 −10 Source/Core/Core/PowerPC/PowerPC.cpp
- +11 −6 Source/Core/Core/PowerPC/PowerPC.h
- +2 −1 Source/Core/DolphinQt2/MenuBar.cpp
- +1 −1 Source/Core/DolphinQt2/NetPlay/NetPlayDialog.cpp
- +6 −6 Source/Core/DolphinQt2/Settings/GeneralPane.cpp
- +6 −6 Source/Core/DolphinWX/Config/GeneralConfigPane.cpp
- +1 −1 Source/Core/DolphinWX/FrameTools.cpp
- +1 −1 Source/Core/DolphinWX/MainMenuBar.cpp
- +1 −1 Source/Core/DolphinWX/NetPlay/NetWindow.cpp
- +1 −1 Source/UnitTests/Core/CoreTimingTest.cpp
Oops, something went wrong.