| Summary: | Incorrect type casting in Touch processing sometimes leads to event loss | ||
|---|---|---|---|
| Product: | SDL | Reporter: | ken48 <ken48> |
| Component: | events | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | amaranth72, icculus |
| Version: | 2.0.3 | ||
| Hardware: | iPhone/iPod touch | ||
| OS: | iOS (All) | ||
|
Description
ken48
2014-12-03 14:10:30 UTC
The 'long' type will always be 32 bits in 32-bit iOS apps and 64 bits in 64-bit iOS apps. SDL_FingerID is always 64 bits, so it always has at least enough space to hold all possible pointer (and long) values on iOS, so the SDL_SendTouch call should be fine. Am I missing something? (In reply to Alex Szpakowski from comment #1) > Am I missing something? Closing this for now, but do tell me if this needs revisiting! (In reply to Alex Szpakowski from comment #2) > (In reply to Alex Szpakowski from comment #1) > > Am I missing something? > > Closing this for now, but do tell me if this needs revisiting! Well, we definitely weren't going to change SDL_FingerID's type in any case, but I guess it would be more proper cast to SDL_FingerID instead of long in that SDL_SendTouch() call? (I don't see where the bug would have happened there, either. Maybe the pointer would have resulted in a negative 32-bit integer and the sign-extension to 64 bits confused things? No idea.) --ryan. (In reply to Ryan C. Gordon from comment #3) > Well, we definitely weren't going to change SDL_FingerID's type in any case, > but I guess it would be more proper cast to SDL_FingerID instead of long in > that SDL_SendTouch() call? Agreed – and apparently I already changed it to do that in one of my commits several months ago. :) (In reply to Alex Szpakowski from comment #4) > Agreed – and apparently I already changed it to do that in one of my commits > several months ago. :) Cool, we're good here, then. :) --ryan. |