Clang-Tidy fixes (#6725)

This commit is contained in:
Pierre Wendling
2022-12-01 16:07:03 -05:00
committed by GitHub
parent c2ce44bead
commit 3c501b963d
184 changed files with 1312 additions and 1154 deletions

View File

@@ -152,7 +152,7 @@ SDL_Generic_GetTLSData(void)
return storage;
}
int SDL_Generic_SetTLSData(SDL_TLSData *storage)
int SDL_Generic_SetTLSData(SDL_TLSData *data)
{
SDL_threadID thread = SDL_ThreadID();
SDL_TLSEntry *prev, *entry;
@@ -162,10 +162,10 @@ int SDL_Generic_SetTLSData(SDL_TLSData *storage)
prev = NULL;
for (entry = SDL_generic_TLS; entry; entry = entry->next) {
if (entry->thread == thread) {
if (storage) {
entry->storage = storage;
if (data != NULL) {
entry->storage = data;
} else {
if (prev) {
if (prev != NULL) {
prev->next = entry->next;
} else {
SDL_generic_TLS = entry->next;
@@ -180,7 +180,7 @@ int SDL_Generic_SetTLSData(SDL_TLSData *storage)
entry = (SDL_TLSEntry *)SDL_malloc(sizeof(*entry));
if (entry) {
entry->thread = thread;
entry->storage = storage;
entry->storage = data;
entry->next = SDL_generic_TLS;
SDL_generic_TLS = entry;
}

View File

@@ -112,7 +112,7 @@ int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms)
gettimeofday(&delta, NULL);
abstime.tv_sec = delta.tv_sec + (ms / 1000);
abstime.tv_nsec = (delta.tv_usec + (ms % 1000) * 1000) * 1000;
abstime.tv_nsec = (long)(delta.tv_usec + (ms % 1000) * 1000) * 1000;
#endif
if (abstime.tv_nsec > 1000000000) {
abstime.tv_sec += 1;