From 18e94897c45369c0810040b9ad8abe49b783eab3 Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Fri, 21 Sep 2018 20:15:55 -0400 Subject: [PATCH] hle/swkbd: specify endianness for enum and other members --- src/core/hle/applets/swkbd.cpp | 7 +++-- src/core/hle/applets/swkbd.h | 56 +++++++++++++++++----------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/core/hle/applets/swkbd.cpp b/src/core/hle/applets/swkbd.cpp index 1b19b7d68..d13050002 100644 --- a/src/core/hle/applets/swkbd.cpp +++ b/src/core/hle/applets/swkbd.cpp @@ -110,7 +110,7 @@ void SoftwareKeyboard::Update() { break; default: LOG_CRITICAL(Applet_SWKBD, "Unknown button config {}", - static_cast(config.num_buttons_m1)); + static_cast(config.num_buttons_m1)); UNREACHABLE(); } @@ -143,8 +143,9 @@ Frontend::KeyboardConfig SoftwareKeyboard::ToFrontendConfig( const SoftwareKeyboardConfig& config) const { using namespace Frontend; KeyboardConfig frontend_config; - frontend_config.button_config = static_cast(config.num_buttons_m1); - frontend_config.accept_mode = static_cast(config.valid_input); + frontend_config.button_config = + static_cast(static_cast(config.num_buttons_m1)); + frontend_config.accept_mode = static_cast(static_cast(config.valid_input)); frontend_config.multiline_mode = config.multiline; frontend_config.max_text_length = config.max_text_length; frontend_config.max_digits = config.max_digits; diff --git a/src/core/hle/applets/swkbd.h b/src/core/hle/applets/swkbd.h index d75d696ec..246d2f4c5 100644 --- a/src/core/hle/applets/swkbd.h +++ b/src/core/hle/applets/swkbd.h @@ -121,20 +121,20 @@ enum class SoftwareKeyboardResult : s32 { }; struct SoftwareKeyboardConfig { - SoftwareKeyboardType type; - SoftwareKeyboardButtonConfig num_buttons_m1; - SoftwareKeyboardValidInput valid_input; - SoftwareKeyboardPasswordMode password_mode; - s32 is_parental_screen; - s32 darken_top_screen; - u32 filter_flags; - u32 save_state_flags; - u16 max_text_length; - u16 dict_word_count; - u16 max_digits; - std::array, MAX_BUTTON> button_text; - std::array numpad_keys; - std::array + enum_le type; + enum_le num_buttons_m1; + enum_le valid_input; + enum_le password_mode; + s32_le is_parental_screen; + s32_le darken_top_screen; + u32_le filter_flags; + u32_le save_state_flags; + u16_le max_text_length; + u16_le dict_word_count; + u16_le max_digits; + std::array, MAX_BUTTON> button_text; + std::array numpad_keys; + std::array hint_text; ///< Text to display when asking the user for input bool predictive_input; bool multiline; @@ -145,25 +145,25 @@ struct SoftwareKeyboardConfig { bool unknown; bool default_qwerty; std::array button_submits_text; - u16 language; + u16_le language; - u32 initial_text_offset; ///< Offset of the default text in the output SharedMemory - u32 dict_offset; - u32 initial_status_offset; - u32 initial_learning_offset; - u32 shared_memory_size; ///< Size of the SharedMemory - u32 version; + u32_le initial_text_offset; ///< Offset of the default text in the output SharedMemory + u32_le dict_offset; + u32_le initial_status_offset; + u32_le initial_learning_offset; + u32_le shared_memory_size; ///< Size of the SharedMemory + u32_le version; - SoftwareKeyboardResult return_code; + enum_le return_code; - u32 status_offset; - u32 learning_offset; + u32_le status_offset; + u32_le learning_offset; - u32 text_offset; ///< Offset in the SharedMemory where the output text starts - u16 text_length; ///< Length in characters of the output text + u32_le text_offset; ///< Offset in the SharedMemory where the output text starts + u16_le text_length; ///< Length in characters of the output text - int callback_result; - std::array callback_msg; + s32_le callback_result; + std::array callback_msg; bool skip_at_check; INSERT_PADDING_BYTES(0xAB); };