Commit bf4f9aaa636863555a6edd7a611a3fb4191cd1c7

Pierre Wendling 2022-11-14T16:11:58

N3DS: Use designated initialiser for drivers. Just a sanity check that the functions are actually mapped correctly.

diff --git a/src/joystick/n3ds/SDL_sysjoystick.c b/src/joystick/n3ds/SDL_sysjoystick.c
index ea00a6d..933f64e 100644
--- a/src/joystick/n3ds/SDL_sysjoystick.c
+++ b/src/joystick/n3ds/SDL_sysjoystick.c
@@ -279,26 +279,26 @@ N3DS_JoystickSendEffect(SDL_Joystick *joystick, const void *data, int size)
 }
 
 SDL_JoystickDriver SDL_N3DS_JoystickDriver = {
-    N3DS_JoystickInit,
-    N3DS_JoystickGetCount,
-    N3DS_JoystickDetect,
-    N3DS_JoystickGetDeviceName,
-    N3DS_JoystickGetDevicePath,
-    N3DS_JoystickGetDevicePlayerIndex,
-    N3DS_JoystickSetDevicePlayerIndex,
-    N3DS_JoystickGetDeviceGUID,
-    N3DS_JoystickGetDeviceInstanceID,
-    N3DS_JoystickOpen,
-    N3DS_JoystickRumble,
-    N3DS_JoystickRumbleTriggers,
-    N3DS_JoystickGetCapabilities,
-    N3DS_JoystickSetLED,
-    N3DS_JoystickSendEffect,
-    N3DS_JoystickSetSensorsEnabled,
-    N3DS_JoystickUpdate,
-    N3DS_JoystickClose,
-    N3DS_JoystickQuit,
-    N3DS_JoystickGetGamepadMapping
+    .Init = N3DS_JoystickInit,
+    .GetCount = N3DS_JoystickGetCount,
+    .Detect = N3DS_JoystickDetect,
+    .GetDeviceName = N3DS_JoystickGetDeviceName,
+    .GetDevicePath = N3DS_JoystickGetDevicePath,
+    .GetDevicePlayerIndex = N3DS_JoystickGetDevicePlayerIndex,
+    .SetDevicePlayerIndex = N3DS_JoystickSetDevicePlayerIndex,
+    .GetDeviceGUID = N3DS_JoystickGetDeviceGUID,
+    .GetDeviceInstanceID = N3DS_JoystickGetDeviceInstanceID,
+    .Open = N3DS_JoystickOpen,
+    .Rumble = N3DS_JoystickRumble,
+    .RumbleTriggers = N3DS_JoystickRumbleTriggers,
+    .GetCapabilities = N3DS_JoystickGetCapabilities,
+    .SetLED = N3DS_JoystickSetLED,
+    .SendEffect = N3DS_JoystickSendEffect,
+    .SetSensorsEnabled = N3DS_JoystickSetSensorsEnabled,
+    .Update = N3DS_JoystickUpdate,
+    .Close = N3DS_JoystickClose,
+    .Quit = N3DS_JoystickQuit,
+    .GetGamepadMapping = N3DS_JoystickGetGamepadMapping
 };
 
 #endif /* SDL_JOYSTICK_N3DS */
diff --git a/src/sensor/n3ds/SDL_n3dssensor.c b/src/sensor/n3ds/SDL_n3dssensor.c
index a435ae2..ea22ef2 100644
--- a/src/sensor/n3ds/SDL_n3dssensor.c
+++ b/src/sensor/n3ds/SDL_n3dssensor.c
@@ -200,17 +200,17 @@ N3DS_SensorQuit(void)
 }
 
 SDL_SensorDriver SDL_N3DS_SensorDriver = {
-    N3DS_SensorInit,
-    N3DS_SensorGetCount,
-    N3DS_SensorDetect,
-    N3DS_SensorGetDeviceName,
-    N3DS_SensorGetDeviceType,
-    N3DS_SensorGetDeviceNonPortableType,
-    N3DS_SensorGetDeviceInstanceID,
-    N3DS_SensorOpen,
-    N3DS_SensorUpdate,
-    N3DS_SensorClose,
-    N3DS_SensorQuit,
+    .Init = N3DS_SensorInit,
+    .GetCount = N3DS_SensorGetCount,
+    .Detect = N3DS_SensorDetect,
+    .GetDeviceName = N3DS_SensorGetDeviceName,
+    .GetDeviceType = N3DS_SensorGetDeviceType,
+    .GetDeviceNonPortableType = N3DS_SensorGetDeviceNonPortableType,
+    .GetDeviceInstanceID = N3DS_SensorGetDeviceInstanceID,
+    .Open = N3DS_SensorOpen,
+    .Update = N3DS_SensorUpdate,
+    .Close = N3DS_SensorClose,
+    .Quit = N3DS_SensorQuit,
 };
 
 #endif /* SDL_SENSOR_N3DS */