Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2021-08-03 23:50:24 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2021-08-03 23:50:24 +0300
commitc2ac0309a83ebddf78f3d7890c364d95bb04c0c5 (patch)
tree9e24137eb831cfa66fbca69b687db886bc99b774
parentc0e00649e34f1d082b22d91938508c6c45909d49 (diff)
Fix missing cast in previous commits on Mac OS.
-rw-r--r--include/llfio/v2.0/detail/impl/posix/utils.ipp9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/llfio/v2.0/detail/impl/posix/utils.ipp b/include/llfio/v2.0/detail/impl/posix/utils.ipp
index 7ce017a2..45eda47e 100644
--- a/include/llfio/v2.0/detail/impl/posix/utils.ipp
+++ b/include/llfio/v2.0/detail/impl/posix/utils.ipp
@@ -496,14 +496,13 @@ namespace utils
static const uint64_t ts_multiplier = 1000000000ULL / sysconf(_SC_CLK_TCK);
OUTCOME_TRY(fill_buffer(buffer1, "/proc/self/stat"));
OUTCOME_TRY(fill_buffer(buffer2, "/proc/stat"));
- if(sscanf(buffer1.data(), "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %lu %lu", &ret.process_ns_in_user_mode,
- &ret.process_ns_in_kernel_mode) < 2)
+ if(sscanf(buffer1.data(), "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %lu %lu", &ret.process_ns_in_user_mode, &ret.process_ns_in_kernel_mode) <
+ 2)
{
return errc::protocol_error;
}
uint64_t user_nice;
- if(sscanf(buffer2.data(), "cpu %lu %lu %lu %lu", &ret.system_ns_in_user_mode, &user_nice, &ret.system_ns_in_kernel_mode, &ret.system_ns_in_idle_mode) <
- 4)
+ if(sscanf(buffer2.data(), "cpu %lu %lu %lu %lu", &ret.system_ns_in_user_mode, &user_nice, &ret.system_ns_in_kernel_mode, &ret.system_ns_in_idle_mode) < 4)
{
return errc::protocol_error;
}
@@ -556,7 +555,7 @@ namespace utils
ret.system_ns_in_kernel_mode += cpuInfo[CPU_STATE_MAX * n + CPU_STATE_SYSTEM];
ret.system_ns_in_idle_mode += cpuInfo[CPU_STATE_MAX * n + CPU_STATE_IDLE];
}
- vm_deallocate(mach_task_self(), cpuInfo, sizeof(integer_t) * numCpuInfo);
+ vm_deallocate(mach_task_self(), (vm_address_t) cpuInfo, sizeof(integer_t) * numCpuInfo);
static const double ts_multiplier = [] {
mach_timebase_info_data_t timebase;
mach_timebase_info(&timebase);