Fix warning with MacOS (#1276)

* Fix warning with MacOS

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* Re-trigger GitHub actions

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* Fix style

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>

* Revert "Fix style"

This reverts commit 1d5fe9ce87.

* Fix style only on changes

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
Bensuperpc 2021-11-08 13:39:36 +01:00 committed by GitHub
parent 4b99670c57
commit 431abd149f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -154,8 +154,9 @@ double ThreadCPUUsage() {
mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT; mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT;
thread_basic_info_data_t info; thread_basic_info_data_t info;
mach_port_t thread = pthread_mach_thread_np(pthread_self()); mach_port_t thread = pthread_mach_thread_np(pthread_self());
if (thread_info(thread, THREAD_BASIC_INFO, (thread_info_t)&info, &count) == if (thread_info(thread, THREAD_BASIC_INFO,
KERN_SUCCESS) { reinterpret_cast<thread_info_t>(&info),
&count) == KERN_SUCCESS) {
return MakeTime(info); return MakeTime(info);
} }
DiagnoseAndExit("ThreadCPUUsage() failed when evaluating thread_info"); DiagnoseAndExit("ThreadCPUUsage() failed when evaluating thread_info");