Replace SDL types by C99 standard types

Scrcpy is a C11 project. Use the C99 standard types instead of the
SDL-specific types:

    SDL_bool -> bool
    SintXX   -> intXX_t
    UintXX   -> uintXX_t
This commit is contained in:
Romain Vimont
2019-03-02 23:52:22 +01:00
parent 8655ba7197
commit dfed1b250e
40 changed files with 456 additions and 438 deletions

View File

@@ -6,14 +6,14 @@
void
fps_counter_init(struct fps_counter *counter) {
counter->started = SDL_FALSE;
counter->started = false;
// no need to initialize the other fields, they are meaningful only when
// started is true
}
void
fps_counter_start(struct fps_counter *counter) {
counter->started = SDL_TRUE;
counter->started = true;
counter->slice_start = SDL_GetTicks();
counter->nr_rendered = 0;
#ifdef SKIP_FRAMES
@@ -23,7 +23,7 @@ fps_counter_start(struct fps_counter *counter) {
void
fps_counter_stop(struct fps_counter *counter) {
counter->started = SDL_FALSE;
counter->started = false;
}
static void
@@ -42,11 +42,11 @@ display_fps(struct fps_counter *counter) {
static void
check_expired(struct fps_counter *counter) {
Uint32 now = SDL_GetTicks();
uint32_t now = SDL_GetTicks();
if (now - counter->slice_start >= 1000) {
display_fps(counter);
// add a multiple of one second
Uint32 elapsed_slices = (now - counter->slice_start) / 1000;
uint32_t elapsed_slices = (now - counter->slice_start) / 1000;
counter->slice_start += 1000 * elapsed_slices;
counter->nr_rendered = 0;
#ifdef SKIP_FRAMES