From e3e14a9943fafb1f8a8b3a213bcd6d8f969f8670 Mon Sep 17 00:00:00 2001 From: emoose Date: Thu, 26 Dec 2019 06:49:20 +0000 Subject: [PATCH] [Base] Change DEFINE_uint64 -> DEFINE_int64, cpptoml seems to have issues with uint64.. Tried setting a uint64 setting to -1 (FFFF FFFF FFFF FFFF), which made it throw a out of range exception when loading the toml... Internally it uses int64 to parse numbers, so I guess it doesn't work well with converting to uint64? Changing everything from uint64->int64 seems to solve it though, now -1 works fine. --- src/xenia/base/cvar.h | 6 +++--- src/xenia/cpu/cpu_flags.cc | 6 +++--- src/xenia/cpu/cpu_flags.h | 4 ++-- src/xenia/ui/vulkan/vulkan_provider.cc | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/xenia/base/cvar.h b/src/xenia/base/cvar.h index 6c55d9f30..098347108 100644 --- a/src/xenia/base/cvar.h +++ b/src/xenia/base/cvar.h @@ -240,8 +240,8 @@ T* define_cmdvar(const char* name, T* default_value, const char* description) { #define DEFINE_int32(name, default_value, description, category) \ DEFINE_CVar(name, default_value, description, category, false, int32_t) -#define DEFINE_uint64(name, default_value, description, category) \ - DEFINE_CVar(name, default_value, description, category, false, uint64_t) +#define DEFINE_int64(name, default_value, description, category) \ + DEFINE_CVar(name, default_value, description, category, false, int64_t) #define DEFINE_double(name, default_value, description, category) \ DEFINE_CVar(name, default_value, description, category, false, double) @@ -283,7 +283,7 @@ T* define_cmdvar(const char* name, T* default_value, const char* description) { #define DECLARE_int32(name) DECLARE_CVar(name, int32_t) -#define DECLARE_uint64(name) DECLARE_CVar(name, uint64_t) +#define DECLARE_int64(name) DECLARE_CVar(name, int64_t) #define DECLARE_CVar(name, type) \ namespace cvars { \ diff --git a/src/xenia/cpu/cpu_flags.cc b/src/xenia/cpu/cpu_flags.cc index fab5ef2f0..59223d498 100644 --- a/src/xenia/cpu/cpu_flags.cc +++ b/src/xenia/cpu/cpu_flags.cc @@ -39,10 +39,10 @@ DEFINE_bool(validate_hir, false, "Perform validation checks on the HIR during compilation.", "CPU"); // Breakpoints: -DEFINE_uint64(break_on_instruction, 0, - "int3 before the given guest address is executed.", "CPU"); +DEFINE_int64(break_on_instruction, 0, + "int3 before the given guest address is executed.", "CPU"); DEFINE_int32(break_condition_gpr, -1, "GPR compared to", "CPU"); -DEFINE_uint64(break_condition_value, 0, "value compared against", "CPU"); +DEFINE_int64(break_condition_value, 0, "value compared against", "CPU"); DEFINE_string(break_condition_op, "eq", "comparison operator", "CPU"); DEFINE_bool(break_condition_truncate, true, "truncate value to 32-bits", "CPU"); diff --git a/src/xenia/cpu/cpu_flags.h b/src/xenia/cpu/cpu_flags.h index 65a15a87d..6e37d4f28 100644 --- a/src/xenia/cpu/cpu_flags.h +++ b/src/xenia/cpu/cpu_flags.h @@ -26,9 +26,9 @@ DECLARE_bool(disable_global_lock); DECLARE_bool(validate_hir); -DECLARE_uint64(break_on_instruction); +DECLARE_int64(break_on_instruction); DECLARE_int32(break_condition_gpr); -DECLARE_uint64(break_condition_value); +DECLARE_int64(break_condition_value); DECLARE_string(break_condition_op); DECLARE_bool(break_condition_truncate); diff --git a/src/xenia/ui/vulkan/vulkan_provider.cc b/src/xenia/ui/vulkan/vulkan_provider.cc index 119f03992..2303202f3 100644 --- a/src/xenia/ui/vulkan/vulkan_provider.cc +++ b/src/xenia/ui/vulkan/vulkan_provider.cc @@ -17,8 +17,8 @@ #include "xenia/ui/vulkan/vulkan_instance.h" #include "xenia/ui/vulkan/vulkan_util.h" -DEFINE_uint64(vulkan_device_index, 0, "Index of the physical device to use.", - "Vulkan"); +DEFINE_int64(vulkan_device_index, 0, "Index of the physical device to use.", + "Vulkan"); namespace xe { namespace ui { @@ -72,7 +72,7 @@ bool VulkanProvider::Initialize() { return false; } size_t device_index = - std::min(available_devices.size(), cvars::vulkan_device_index); + std::min(available_devices.size(), (size_t)cvars::vulkan_device_index); auto& device_info = available_devices[device_index]; // Create the device.