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
+1 -1
View File
@@ -31,5 +31,5 @@ const char* ffDetectInitSystem(FFInitSystemResult* result) {
ffGetFileVersion(path, &result->version);
}
return NULL;
return nullptr;
}
+12 -12
View File
@@ -20,13 +20,13 @@ FF_A_UNUSED static bool extractSystemdVersion(const char* str, uint32_t len, voi
}
const char* ffDetectInitSystem(FFInitSystemResult* result) {
const char* error = ffProcessGetBasicInfoLinux((int) result->pid, &result->name, NULL, NULL);
const char* error = ffProcessGetBasicInfoLinux((int) result->pid, &result->name, nullptr, nullptr);
if (error) {
#ifdef __ANDROID__
if (access("/system/bin/init", F_OK) == 0) {
ffStrbufSetStatic(&result->exe, "/system/bin/init");
ffStrbufSetStatic(&result->name, "init");
return NULL;
return nullptr;
}
#endif
return error;
@@ -34,7 +34,7 @@ const char* ffDetectInitSystem(FFInitSystemResult* result) {
const char* _;
// In linux /proc/1/exe is not readable
ffProcessGetInfoLinux((int) result->pid, &result->name, &result->exe, &_, NULL);
ffProcessGetInfoLinux((int) result->pid, &result->name, &result->exe, &_, nullptr);
if (result->exe.chars[0] == '/') {
// In some old system, /sbin/init is a symlink
char buf[PATH_MAX];
@@ -52,8 +52,8 @@ const char* ffDetectInitSystem(FFInitSystemResult* result) {
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
ffStrbufEndsWithS(&result->exe, "/systemd") ? result->exe.chars : "systemctl", // use exe path in case users have another systemd installed
"--version",
NULL,
}) == NULL &&
nullptr,
}) == nullptr &&
result->version.length) {
uint32_t iStart = ffStrbufFirstIndexC(&result->version, '(');
if (iStart < result->version.length) {
@@ -67,8 +67,8 @@ const char* ffDetectInitSystem(FFInitSystemResult* result) {
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
ffStrbufEndsWithS(&result->exe, "/dinit") ? result->exe.chars : "dinit",
"--version",
NULL,
}) == NULL &&
nullptr,
}) == nullptr &&
result->version.length) {
// Dinit version 0.18.0.
ffStrbufSubstrBeforeFirstC(&result->version, '\n');
@@ -79,8 +79,8 @@ const char* ffDetectInitSystem(FFInitSystemResult* result) {
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
ffStrbufEndsWithS(&result->exe, "/shepherd") ? result->exe.chars : "shepherd",
"--version",
NULL,
}) == NULL &&
nullptr,
}) == nullptr &&
result->version.length) {
// shepherd (GNU Shepherd) 1.0.6
// The first line in the output might not contain the version
@@ -97,8 +97,8 @@ const char* ffDetectInitSystem(FFInitSystemResult* result) {
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
"/bin/launchctl",
"version",
NULL,
}) == NULL &&
nullptr,
}) == nullptr &&
result->version.length) {
uint32_t iStart = ffStrbufFirstIndexS(&result->version, "Version ");
if (iStart < result->version.length) {
@@ -112,5 +112,5 @@ const char* ffDetectInitSystem(FFInitSystemResult* result) {
#endif
}
return NULL;
return nullptr;
}