From 0abf6864068a513c90ee583b003bbeecc9ea2f65 Mon Sep 17 00:00:00 2001 From: Clang Format Date: Sun, 28 Aug 2016 18:26:47 +0200 Subject: [PATCH] pre-fomat onepad Clang doesn't move back the '{' if there is a comment on the if line --- plugins/onepad/Linux/GamepadConfiguration.cpp | 14 ++----- .../onepad/Linux/JoystickConfiguration.cpp | 7 +--- plugins/onepad/Linux/dialog.cpp | 37 +++++-------------- 3 files changed, 16 insertions(+), 42 deletions(-) diff --git a/plugins/onepad/Linux/GamepadConfiguration.cpp b/plugins/onepad/Linux/GamepadConfiguration.cpp index c5a9807fb5..19e8759405 100644 --- a/plugins/onepad/Linux/GamepadConfiguration.cpp +++ b/plugins/onepad/Linux/GamepadConfiguration.cpp @@ -173,12 +173,9 @@ void GamepadConfiguration::OnButtonClicked(wxCommandEvent &event) // Affichage d'un message à chaque clic sur le bouton wxButton* bt_tmp = (wxButton*)event.GetEventObject(); // get the button object int bt_id = bt_tmp->GetId(); // get the real ID - if(bt_id == m_bt_ok->GetId()) // If the button ID is equals to the Ok button ID - { + if(bt_id == m_bt_ok->GetId()) { // If the button ID is equals to the Ok button ID Close(); // Close the window - } - else if(bt_id == m_bt_cancel->GetId()) // If the button ID is equals to the cancel button ID - { + } else if(bt_id == m_bt_cancel->GetId()) { // If the button ID is equals to the cancel button ID reset(); // reinitialize the value of each parameters Close(); // Close the window } @@ -193,8 +190,7 @@ void GamepadConfiguration::OnSliderReleased(wxCommandEvent &event) { wxSlider* sl_tmp = (wxSlider*)event.GetEventObject(); // get the slider object int sl_id = sl_tmp->GetId(); // slider id - if(sl_id == m_sl_rumble_intensity->GetId()) // if this is the rumble intensity slider - { + if(sl_id == m_sl_rumble_intensity->GetId()) { // if this is the rumble intensity slider u32 intensity = m_sl_rumble_intensity->GetValue(); // get the new value conf->set_ff_intensity(intensity); // and set the force feedback intensity value with it // get the rumble intensity @@ -211,9 +207,7 @@ void GamepadConfiguration::OnSliderReleased(wxCommandEvent &event) * 1 : maximum value of the intensity for the sdl rumble test */ s_vgamePad[m_pad_id]->TestForce(strength/0x7FFF); - } - else if(sl_id == m_sl_joystick_sensibility->GetId()) - { + } else if(sl_id == m_sl_joystick_sensibility->GetId()) { u32 sensibility = m_sl_joystick_sensibility->GetValue(); // get the new value conf->set_sensibility(sensibility); // and set the joystick sensibility } diff --git a/plugins/onepad/Linux/JoystickConfiguration.cpp b/plugins/onepad/Linux/JoystickConfiguration.cpp index 6b8ddb628c..c1aa6f858a 100644 --- a/plugins/onepad/Linux/JoystickConfiguration.cpp +++ b/plugins/onepad/Linux/JoystickConfiguration.cpp @@ -152,12 +152,9 @@ void JoystickConfiguration::OnButtonClicked(wxCommandEvent &event) // Affichage d'un message à chaque clic sur le bouton wxButton* bt_tmp = (wxButton*)event.GetEventObject(); // get the button object int bt_id = bt_tmp->GetId(); // get the real ID - if(bt_id == m_bt_ok->GetId()) // If the button ID is equals to the Ok button ID - { + if(bt_id == m_bt_ok->GetId()) { // If the button ID is equals to the Ok button ID Close(); // Close the window - } - else if(bt_id == m_bt_cancel->GetId()) // If the button ID is equals to the cancel button ID - { + } else if(bt_id == m_bt_cancel->GetId()) { // If the button ID is equals to the cancel button ID reset(); // reinitialize the value of each parameters Close(); // Close the window } diff --git a/plugins/onepad/Linux/dialog.cpp b/plugins/onepad/Linux/dialog.cpp index b3852b345c..831fc70744 100644 --- a/plugins/onepad/Linux/dialog.cpp +++ b/plugins/onepad/Linux/dialog.cpp @@ -312,35 +312,26 @@ void Dialog::OnButtonClicked(wxCommandEvent &event) wxButton* bt_tmp = (wxButton*)event.GetEventObject(); // get the button object int bt_id = bt_tmp->GetId()-wxID_HIGHEST-1; // get the real ID int gamepad_id = m_tab_gamepad->GetSelection(); // get the tab ID (equivalent to the gamepad id) - if(bt_id >= 0 && bt_id <= PAD_R_LEFT) // if the button ID is a gamepad button - { + if(bt_id >= 0 && bt_id <= PAD_R_LEFT) { // if the button ID is a gamepad button bt_tmp->Disable(); // switch the button state to "Disable" config_key(gamepad_id, bt_id); bt_tmp->Enable(); // switch the button state to "Enable" - } - else if(bt_id == Gamepad_config) // If the button ID is equals to the Gamepad_config button ID - { + } else if(bt_id == Gamepad_config) { // If the button ID is equals to the Gamepad_config button ID GamepadConfiguration gamepad_config(gamepad_id, this); gamepad_config.InitGamepadConfiguration(); gamepad_config.ShowModal(); - } - else if(bt_id == JoyL_config) // If the button ID is equals to the JoyL_config button ID - { + } else if(bt_id == JoyL_config) { // If the button ID is equals to the JoyL_config button ID JoystickConfiguration joystick_config(gamepad_id, true, this); joystick_config.InitJoystickConfiguration(); joystick_config.ShowModal(); - } - else if(bt_id == JoyR_config) // If the button ID is equals to the JoyR_config button ID - { + } else if(bt_id == JoyR_config) { // If the button ID is equals to the JoyR_config button ID JoystickConfiguration joystick_config(gamepad_id, false, this); joystick_config.InitJoystickConfiguration(); joystick_config.ShowModal(); - } - else if(bt_id == Set_all) // If the button ID is equals to the Set_all button ID - { + } else if(bt_id == Set_all) { // If the button ID is equals to the Set_all button ID for(int i=0; iUpdate(); usleep(500000); // give enough time to the user to release the button } - } - else if(bt_id == Ok) // If the button ID is equals to the Ok button ID - { + } else if(bt_id == Ok) { // If the button ID is equals to the Ok button ID SaveConfig(); // Save the configuration Close(); // Close the window - } - else if(bt_id == Apply) // If the button ID is equals to the Apply button ID - { + } else if(bt_id == Apply) { // If the button ID is equals to the Apply button ID SaveConfig(); // Save the configuration - } - else if(bt_id == Cancel) // If the button ID is equals to the cancel button ID - { + } else if(bt_id == Cancel) { // If the button ID is equals to the cancel button ID Close(); // Close the window } } @@ -472,8 +457,7 @@ void Dialog::JoystickEvent(wxTimerEvent& event) m_pan_tabs[events.jaxis.which]->MoveJoystick(events.jaxis.axis, events.jaxis.value); m_pan_tabs[events.jaxis.which]->ShowImg(img_right_cursor); } - else if(map < PAD_L_UP) // if this is not a joystick - { + else if(map < PAD_L_UP) { // if this is not a joystick m_pan_tabs[events.jaxis.which]->ShowImg(map); } } @@ -485,8 +469,7 @@ void Dialog::JoystickEvent(wxTimerEvent& event) if(it2 != m_map_images[events.jaxis.which].end()) { map = m_map_images[events.jaxis.which][key]; - if(map < PAD_L_UP) // if this is not a joystick - { + if(map < PAD_L_UP) { // if this is not a joystick m_pan_tabs[events.jaxis.which]->HideImg(map); } break;