Skip to content

SDL_joystick: event specific variable used despite events being disabled #5413

@Jan200101

Description

@Jan200101

event_type is defined only when EVENTS are enabled.

#if !SDL_EVENTS_DISABLED
Uint32 event_type;
#endif

But there is one section (right outside of an ifdef block) that makes use of the variable despite this

#if !SDL_EVENTS_DISABLED
if (state == finger_info->state) {
event_type = SDL_CONTROLLERTOUCHPADMOTION;
} else if (state) {
event_type = SDL_CONTROLLERTOUCHPADDOWN;
} else {
event_type = SDL_CONTROLLERTOUCHPADUP;
}
#endif
/* We ignore events if we don't have keyboard focus, except for touch release */
if (SDL_PrivateJoystickShouldIgnoreEvent()) {
if (event_type != SDL_CONTROLLERTOUCHPADUP) {
return 0;
}
}

I am unsure if this is an error or not, but it is preventing a project I work on from building with events disabled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions