mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-07 23:40:09 +01:00
Global: replaces NULL to nullptr
This commit is contained in:
+7
-7
@@ -18,7 +18,7 @@ static inline void ffThreadMutexUnlock(FFThreadMutex* mutex) {
|
||||
ReleaseSRWLockExclusive(mutex);
|
||||
}
|
||||
static inline FFThreadType ffThreadCreate(unsigned(__stdcall* func)(void*), void* data) {
|
||||
return (FFThreadType) _beginthreadex(NULL, 0, func, data, 0, NULL);
|
||||
return (FFThreadType) _beginthreadex(nullptr, 0, func, data, 0, nullptr);
|
||||
}
|
||||
#define FF_THREAD_ENTRY_DECL_WRAPPER(fn, paramType) \
|
||||
static __stdcall unsigned fn##ThreadMain(void* data) { \
|
||||
@@ -34,7 +34,7 @@ static inline void ffThreadDetach(FFThreadType thread) {
|
||||
NtClose(thread);
|
||||
}
|
||||
static inline bool ffThreadJoin(FFThreadType thread, uint32_t timeout) {
|
||||
if (NtWaitForSingleObject(thread, FALSE, timeout == 0 ? NULL : &(LARGE_INTEGER) { .QuadPart = (int64_t) timeout * -10000 }) != STATUS_WAIT_0) {
|
||||
if (NtWaitForSingleObject(thread, FALSE, timeout == 0 ? nullptr : &(LARGE_INTEGER) { .QuadPart = (int64_t) timeout * -10000 }) != STATUS_WAIT_0) {
|
||||
TerminateThread(thread, (DWORD) -1);
|
||||
NtClose(thread);
|
||||
return false;
|
||||
@@ -74,18 +74,18 @@ static inline void ffThreadMutexUnlock(FFThreadMutex* mutex) {
|
||||
#endif
|
||||
static inline FFThreadType ffThreadCreate(void* (*func)(void*), void* data) {
|
||||
FFThreadType newThread = 0;
|
||||
pthread_create(&newThread, NULL, func, data);
|
||||
pthread_create(&newThread, nullptr, func, data);
|
||||
return newThread;
|
||||
}
|
||||
#define FF_THREAD_ENTRY_DECL_WRAPPER(fn, paramType) \
|
||||
static void* fn##ThreadMain(void* data) { \
|
||||
fn((paramType) data); \
|
||||
return NULL; \
|
||||
return nullptr; \
|
||||
}
|
||||
#define FF_THREAD_ENTRY_DECL_WRAPPER_NOPARAM(fn) \
|
||||
static void* fn##ThreadMain() { \
|
||||
fn(); \
|
||||
return NULL; \
|
||||
return nullptr; \
|
||||
}
|
||||
static inline void ffThreadDetach(FFThreadType thread) {
|
||||
pthread_detach(thread);
|
||||
@@ -97,7 +97,7 @@ static inline bool ffThreadJoin(FFThreadType thread, FF_A_UNUSED uint32_t timeou
|
||||
if (clock_gettime(CLOCK_REALTIME, &ts) == 0) {
|
||||
ts.tv_sec += timeout / 1000;
|
||||
ts.tv_nsec += (timeout % 1000) * 1000000;
|
||||
if (pthread_timedjoin_np(thread, NULL, &ts) != 0) {
|
||||
if (pthread_timedjoin_np(thread, nullptr, &ts) != 0) {
|
||||
pthread_kill(thread, SIGTERM);
|
||||
return false;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ static inline bool ffThreadJoin(FFThreadType thread, FF_A_UNUSED uint32_t timeou
|
||||
}
|
||||
}
|
||||
#endif
|
||||
pthread_join(thread, NULL);
|
||||
pthread_join(thread, nullptr);
|
||||
return true;
|
||||
}
|
||||
static inline uintptr_t ffThreadGetCurrentId() {
|
||||
|
||||
Reference in New Issue
Block a user