From a1aa0a1801e75797656bcc36c3ff305cdf62836b Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Thu, 12 Nov 2026 22:10:20 -0600 Subject: [PATCH] Change LiSendMultiControllerEvent number/mask arguments to unsigned The modulo operator will not work as expected with negative numbers. --- src/InputStream.c | 4 ++-- src/Limelight.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/InputStream.c b/src/InputStream.c index 2df6de2..95e54de 100644 --- a/src/InputStream.c +++ b/src/InputStream.c @@ -1072,7 +1072,7 @@ int LiSendUtf8TextEvent(const char *text, unsigned int length) { return err; } -static int sendControllerEventInternal(short controllerNumber, short activeGamepadMask, +static int sendControllerEventInternal(uint8_t controllerNumber, uint16_t activeGamepadMask, int buttonFlags, unsigned char leftTrigger, unsigned char rightTrigger, short leftStickX, short leftStickY, short rightStickX, short rightStickY) { @@ -1262,7 +1262,7 @@ int LiSendControllerEvent(int buttonFlags, unsigned char leftTrigger, unsigned c } // Send a controller event to the streaming machine -int LiSendMultiControllerEvent(short controllerNumber, short activeGamepadMask, +int LiSendMultiControllerEvent(uint8_t controllerNumber, uint16_t activeGamepadMask, int buttonFlags, unsigned char leftTrigger, unsigned char rightTrigger, short leftStickX, short leftStickY, short rightStickX, short rightStickY) { diff --git a/src/Limelight.h b/src/Limelight.h index 4645178..22d5838 100644 --- a/src/Limelight.h +++ b/src/Limelight.h @@ -762,7 +762,7 @@ int LiSendControllerEvent(int buttonFlags, unsigned char leftTrigger, unsigned c // // To indicate removal of a gamepad, send an empty event with the controller number set to the // removed controller and the bit of the removed controller cleared in the active gamepad mask. -int LiSendMultiControllerEvent(short controllerNumber, short activeGamepadMask, +int LiSendMultiControllerEvent(uint8_t controllerNumber, uint16_t activeGamepadMask, int buttonFlags, unsigned char leftTrigger, unsigned char rightTrigger, short leftStickX, short leftStickY, short rightStickX, short rightStickY);