From 3b1683a152610b2da161ba3084e2dd5942127303 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Tue, 30 Jun 2020 22:55:47 +0000 Subject: [PATCH] common: switch to nullptr for sysctl's empty new value --- src/common/memory_detect.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/memory_detect.cpp b/src/common/memory_detect.cpp index e981b9a2a..8cff6ec37 100644 --- a/src/common/memory_detect.cpp +++ b/src/common/memory_detect.cpp @@ -40,16 +40,16 @@ static MemoryInfo Detect() { // hw and vm are defined in sysctl.h // https://github.com/apple/darwin-xnu/blob/master/bsd/sys/sysctl.h#L471 // sysctlbyname(const char *, void *, size_t *, void *, size_t); - sysctlbyname("hw.memsize", &ramsize, &sizeof_ramsize, NULL, 0); - sysctlbyname("vm.swapusage", &vmusage, &sizeof_vmusage, NULL, 0); + sysctlbyname("hw.memsize", &ramsize, &sizeof_ramsize, nullptr, 0); + sysctlbyname("vm.swapusage", &vmusage, &sizeof_vmusage, nullptr, 0); mem_info.TotalPhysicalMemory = ramsize; mem_info.TotalSwapMemory = vmusage.xsu_total; #elif defined(__FreeBSD__) u_long physmem, swap_total; std::size_t sizeof_u_long = sizeof(u_long); // sysctlbyname(const char *, void *, size_t *, const void *, size_t); - sysctlbyname("hw.physmem", &physmem, &sizeof_u_long, NULL, 0); - sysctlbyname("vm.swap_total", &swap_total, &sizeof_u_long, NULL, 0); + sysctlbyname("hw.physmem", &physmem, &sizeof_u_long, nullptr, 0); + sysctlbyname("vm.swap_total", &swap_total, &sizeof_u_long, nullptr, 0); mem_info.TotalPhysicalMemory = physmem; mem_info.TotalSwapMemory = swap_total; #elif defined(__linux__)