We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 853

Summary: evdev joystick code problems
Product: SDL Reporter: Ludwig Nussel <ludwig.nussel>
Component: joystickAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 1.2   
Hardware: x86_64   
OS: Linux   
Attachments: patch

Description Ludwig Nussel 2009-10-18 05:34:18 UTC
Created attachment 422 [details]
patch

src/joystick/linux/SDL_sysjoystick.c has some problems:

- test_bit() might break with strict aliasing
- test_bit() assumes array is Uint32 but its actually "unsigned long"
  on 64bit systems sizeof(long) != sizeof(Uint32).
- the keybit array is too small
- the arrays are unitialized so the number of
  detected buttons is quite random
Comment 1 Sam Lantinga 2009-10-18 09:15:13 UTC
This is in subversion, thanks!