Global: replaces NULL to nullptr

This commit is contained in:
李通洲
2026-07-10 18:08:04 +08:00
parent 873454191f
commit ba18705d2e
387 changed files with 2411 additions and 2411 deletions
+2 -2
View File
@@ -13,11 +13,11 @@
const char* ffDetectLoadavg(double result[3]) {
struct loadavg load;
size_t size = sizeof(load);
if (sysctl((int[]) { CTL_VM, VM_LOADAVG }, 2, &load, &size, NULL, 0) < 0) {
if (sysctl((int[]) { CTL_VM, VM_LOADAVG }, 2, &load, &size, nullptr, 0) < 0) {
return "sysctl({CTL_VM, VM_LOADAVG}) failed";
}
for (int i = 0; i < 3; i++) {
result[i] = (double) load.ldavg[i] / (double) load.fscale;
}
return NULL;
return nullptr;
}
+2 -2
View File
@@ -13,7 +13,7 @@ const char* ffDetectLoadavg(double result[3]) {
buf[nRead] = '\0';
if (sscanf(buf, "%lf%lf%lf", &result[0], &result[1], &result[2]) == 3) {
return NULL;
return nullptr;
}
}
@@ -29,5 +29,5 @@ const char* ffDetectLoadavg(double result[3]) {
result[i] = (double) si.loads[i] / (1 << SI_LOAD_SHIFT);
}
#endif
return NULL;
return nullptr;
}
+1 -1
View File
@@ -3,5 +3,5 @@
#include <sys/loadavg.h>
const char* ffDetectLoadavg(double result[3]) {
return getloadavg(result, 3) == 3 ? NULL : "getloadavg() failed";
return getloadavg(result, 3) == 3 ? nullptr : "getloadavg() failed";
}