Răsfoiți Sursa

Merge pull request #247 from lioncash/const

hid_user: Pass by reference with PadButtonPress/PadButtonRelease
bunnei 11 ani în urmă
părinte
comite
306b5392ca
2 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 2 2
      src/core/hle/service/hid_user.cpp
  2. 2 2
      src/core/hle/service/hid_user.h

+ 2 - 2
src/core/hle/service/hid_user.cpp

@@ -55,7 +55,7 @@ static void UpdateNextCirclePadState() {
 /**
 /**
  * Sets a Pad state (button or button combo) as pressed
  * Sets a Pad state (button or button combo) as pressed
  */
  */
-void PadButtonPress(PadState pad_state) {
+void PadButtonPress(const PadState& pad_state) {
     next_state.hex |= pad_state.hex;
     next_state.hex |= pad_state.hex;
     UpdateNextCirclePadState();
     UpdateNextCirclePadState();
 }
 }
@@ -63,7 +63,7 @@ void PadButtonPress(PadState pad_state) {
 /**
 /**
  * Sets a Pad state (button or button combo) as released
  * Sets a Pad state (button or button combo) as released
  */
  */
-void PadButtonRelease(PadState pad_state) {
+void PadButtonRelease(const PadState& pad_state) {
     next_state.hex &= ~pad_state.hex;
     next_state.hex &= ~pad_state.hex;
     UpdateNextCirclePadState();
     UpdateNextCirclePadState();
 }
 }

+ 2 - 2
src/core/hle/service/hid_user.h

@@ -93,8 +93,8 @@ const PadState PAD_CIRCLE_UP    = {{1u << 30}};
 const PadState PAD_CIRCLE_DOWN  = {{1u << 31}};
 const PadState PAD_CIRCLE_DOWN  = {{1u << 31}};
 
 
 // Methods for updating the HID module's state
 // Methods for updating the HID module's state
-void PadButtonPress(PadState pad_state);
-void PadButtonRelease(PadState pad_state);
+void PadButtonPress(const PadState& pad_state);
+void PadButtonRelease(const PadState& pad_state);
 void PadUpdateComplete();
 void PadUpdateComplete();
 
 
 /**
 /**