misc: Use nint/nuint instead of IntPtr/UIntPtr

This commit is contained in:
KeatonTheBot
2025-11-23 13:42:38 -06:00
parent 2d720fea03
commit c1e24961f9
163 changed files with 845 additions and 845 deletions
+5 -5
View File
@@ -69,11 +69,11 @@ namespace Ryujinx.Input.SDL2
public GamepadFeaturesFlag Features { get; }
private IntPtr _gamepadHandle;
private nint _gamepadHandle;
private float _triggerThreshold;
public SDL2Gamepad(IntPtr gamepadHandle, string driverId)
public SDL2Gamepad(nint gamepadHandle, string driverId)
{
_gamepadHandle = gamepadHandle;
_buttonsUserMapping = new List<ButtonMappingEntry>(20);
@@ -125,11 +125,11 @@ namespace Ryujinx.Input.SDL2
protected virtual void Dispose(bool disposing)
{
if (disposing && _gamepadHandle != IntPtr.Zero)
if (disposing && _gamepadHandle != nint.Zero)
{
SDL_GameControllerClose(_gamepadHandle);
_gamepadHandle = IntPtr.Zero;
_gamepadHandle = nint.Zero;
}
}
@@ -192,7 +192,7 @@ namespace Ryujinx.Input.SDL2
{
float* values = stackalloc float[ElementCount];
int result = SDL_GameControllerGetSensorData(_gamepadHandle, sensorType, (IntPtr)values, ElementCount);
int result = SDL_GameControllerGetSensorData(_gamepadHandle, sensorType, (nint)values, ElementCount);
if (result == 0)
{
+2 -2
View File
@@ -210,9 +210,9 @@ namespace Ryujinx.Input.SDL2
return null;
}
IntPtr gamepadHandle = SDL_GameControllerOpen(joystickIndex);
nint gamepadHandle = SDL_GameControllerOpen(joystickIndex);
if (gamepadHandle == IntPtr.Zero)
if (gamepadHandle == nint.Zero)
{
return null;
}
+1 -1
View File
@@ -226,7 +226,7 @@ namespace Ryujinx.Input.SDL2
unsafe
{
IntPtr statePtr = SDL_GetKeyboardState(out int numKeys);
nint statePtr = SDL_GetKeyboardState(out int numKeys);
rawKeyboardState = new ReadOnlySpan<byte>((byte*)statePtr, numKeys);
}