SDL_GetTouchDevices() follows the SDL_GetStringRule

This commit is contained in:
Sam Lantinga
2024-07-18 22:15:11 -07:00
parent 856d598d6e
commit eb22fcce35
4 changed files with 9 additions and 9 deletions

View File

@@ -502,7 +502,7 @@ SDL_DYNAPI_PROC(Uint64,SDL_GetTicks,(void),(),return)
SDL_DYNAPI_PROC(Uint64,SDL_GetTicksNS,(void),(),return)
SDL_DYNAPI_PROC(const char*,SDL_GetTouchDeviceName,(SDL_TouchID a),(a),return)
SDL_DYNAPI_PROC(SDL_TouchDeviceType,SDL_GetTouchDeviceType,(SDL_TouchID a),(a),return)
SDL_DYNAPI_PROC(SDL_TouchID*,SDL_GetTouchDevices,(int *a),(a),return)
SDL_DYNAPI_PROC(const SDL_TouchID*,SDL_GetTouchDevices,(int *a),(a),return)
SDL_DYNAPI_PROC(SDL_Finger**,SDL_GetTouchFingers,(SDL_TouchID a, int *b),(a,b),return)
SDL_DYNAPI_PROC(const char*,SDL_GetUserFolder,(SDL_Folder a),(a),return)
SDL_DYNAPI_PROC(int,SDL_GetVersion,(void),(),return)

View File

@@ -49,7 +49,7 @@ SDL_bool SDL_TouchDevicesAvailable(void)
return SDL_num_touch > 0;
}
SDL_TouchID *SDL_GetTouchDevices(int *count)
const SDL_TouchID *SDL_GetTouchDevices(int *count)
{
if (count) {
*count = 0;
@@ -67,7 +67,7 @@ SDL_TouchID *SDL_GetTouchDevices(int *count)
}
}
return retval;
return SDL_FreeLater(retval);
}
static int SDL_GetTouchIndex(SDL_TouchID id)

View File

@@ -742,7 +742,7 @@ void X11_Xinput2UpdateDevices(SDL_VideoDevice *_this, SDL_bool initial_check)
int new_mouse_count = 0;
SDL_MouseID *new_mice = NULL;
int old_touch_count = 0;
SDL_TouchID *old_touch_devices64 = NULL;
const SDL_TouchID *old_touch_devices64 = NULL;
Uint32 *old_touch_devices = NULL;
int new_touch_count = 0;
Uint32 *new_touch_devices = NULL;
@@ -765,7 +765,6 @@ void X11_Xinput2UpdateDevices(SDL_VideoDevice *_this, SDL_bool initial_check)
}
}
}
SDL_free(old_touch_devices64);
for (int i = 0; i < ndevices; i++) {
XIDeviceInfo *dev = &info[i];