From e38de3df64c104779c738d45172ee5bea00af85b Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 10 Sep 2021 20:05:33 +0200 Subject: [PATCH] iothread: Stop casting intptr_t to void* This works without, and clang-tidy tells me there's "optimisation opportunities" that may be concealed. --- src/iothread.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iothread.cpp b/src/iothread.cpp index 48e21fbdc..d639f3612 100644 --- a/src/iothread.cpp +++ b/src/iothread.cpp @@ -170,7 +170,7 @@ maybe_t thread_pool_t::dequeue_work_or_commit_to_exit() { return result; } -static void *this_thread() { return (void *)(intptr_t)pthread_self(); } +static intptr_t this_thread() { return (intptr_t)pthread_self(); } void *thread_pool_t::run() { while (auto req = dequeue_work_or_commit_to_exit()) { @@ -358,7 +358,7 @@ bool make_detached_pthread(void *(*func)(void *), void *param) { int err = pthread_create(&thread, nullptr, func, param); if (err == 0) { // Success, return the thread. - FLOGF(iothread, "pthread %p spawned", (void *)(intptr_t)thread); + FLOGF(iothread, "pthread %p spawned", (intptr_t)thread); DIE_ON_FAILURE(pthread_detach(thread)); } else { perror("pthread_create");