Skip to content

SDL_timer.h: canceling a timer vs removing a timer  #10079

@madebr

Description

@madebr

The documentation of the timer callback and functions that create timers say the timer is cancelled when it returns 0.

* scheduled. If the callback returns 0, the periodic alarm is cancelled.

* timer interval. If the value returned from the callback is 0, the timer is
* canceled.

* scheduled. If the callback returns 0, the periodic alarm is cancelled.

* next timer interval. If the value returned from the callback is 0, the
* timer is canceled.

But SDL_RemoveTimer talks about removing a timer.

* Remove a timer created with SDL_AddTimer().

I suppose canceling and removing a timer means the same thing, but I think the documentation should clarify this.

Also, the documentation mixes USA's canceled and UK's cancelled.

The reason I'm opening this issue is because an error occurs when a timer is removed that was cancelled:

result = SDL_RemoveTimer(id);
SDLTest_AssertPass("Call to SDL_RemoveTimer()");
SDLTest_AssertCheck(result < 0, "Check result value, expected: <0, got: %i", result);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions