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
+4 -4
View File
@@ -18,14 +18,14 @@ const char* ffGetCpuUsageInfo(FFlist* cpuTimes) {
buf[nRead] = '\0';
// Skip first line
char* start = NULL;
if ((start = strchr(buf, '\n')) == NULL) {
char* start = nullptr;
if ((start = strchr(buf, '\n')) == nullptr) {
return "skip first line failed";
}
++start;
uint64_t user = 0, nice = 0, system = 0, idle = 0, iowait = 0, irq = 0, softirq = 0;
char* token = NULL;
char* token = nullptr;
while ((token = strchr(start, '\n'))) {
if (sscanf(start, "cpu%*d%" PRIu64 "%" PRIu64 "%" PRIu64 "%" PRIu64 "%" PRIu64 "%" PRIu64 "%" PRIu64 "%*[^\n]\n", &user, &nice, &system, &idle, &iowait, &irq, &softirq) == 7) {
uint64_t inUse = user + nice + system + irq + softirq;
@@ -42,5 +42,5 @@ const char* ffGetCpuUsageInfo(FFlist* cpuTimes) {
start = token + 1;
}
return NULL;
return nullptr;
}