mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 00:03:58 +01:00
Global: replaces NULL to nullptr
This commit is contained in:
@@ -23,5 +23,5 @@ const char* ffDetectHost(FFHostResult* host) {
|
||||
ffStrbufPrepend(&host->name, &host->vendor);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ const char* getOthersByIokit(FFHostResult* host) {
|
||||
ffCfStrGetString(version, &host->version);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char* ffDetectHost(FFHostResult* host) {
|
||||
@@ -64,5 +64,5 @@ const char* ffDetectHost(FFHostResult* host) {
|
||||
ffStrbufSet(&host->name, &host->family);
|
||||
}
|
||||
getOthersByIokit(host);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ const char* ffDetectHost(FFHostResult* host) {
|
||||
ffHostDetectMac(host);
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ const char* ffDetectHost(FFHostResult* host) {
|
||||
if (host->family.length == 0 && host->name.length == 0) {
|
||||
const char* wslDistroName = getenv("WSL_DISTRO_NAME");
|
||||
// On WSL, the real host can't be detected. Instead use WSL as host.
|
||||
if (wslDistroName != NULL || getenv("WSL_DISTRO") != NULL || getenv("WSL_INTEROP") != NULL) {
|
||||
if (wslDistroName != nullptr || getenv("WSL_DISTRO") != nullptr || getenv("WSL_INTEROP") != nullptr) {
|
||||
ffStrbufSetStatic(&host->name, "Windows Subsystem for Linux");
|
||||
if (wslDistroName) {
|
||||
ffStrbufAppendF(&host->name, " - %s", wslDistroName);
|
||||
@@ -99,7 +99,7 @@ const char* ffDetectHost(FFHostResult* host) {
|
||||
"wslinfo",
|
||||
"--wsl-version",
|
||||
"-n",
|
||||
NULL,
|
||||
nullptr,
|
||||
}); // supported in 2.2.3 and later
|
||||
}
|
||||
} else if (ffStrbufStartsWithS(&instance.state.platform.sysinfo.version, "FreeBSD ")) {
|
||||
@@ -113,5 +113,5 @@ const char* ffDetectHost(FFHostResult* host) {
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ const char* ffHostGetMacProductNameWithHwModel(const FFstrbuf* hwModel) {
|
||||
return "iMac (24/20-inch, Early 2009)";
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
||||
@@ -3,23 +3,23 @@
|
||||
#include "common/smbios.h"
|
||||
|
||||
const char* ffDetectHost(FFHostResult* host) {
|
||||
const char* error = NULL;
|
||||
const char* error = nullptr;
|
||||
if ((error = ffSysctlGetString("machdep.dmi.system-product", &host->name))) {
|
||||
return error;
|
||||
}
|
||||
ffCleanUpSmbiosValue(&host->name);
|
||||
if (ffSysctlGetString("machdep.dmi.system-vendor", &host->vendor) == NULL) {
|
||||
if (ffSysctlGetString("machdep.dmi.system-vendor", &host->vendor) == nullptr) {
|
||||
ffCleanUpSmbiosValue(&host->vendor);
|
||||
}
|
||||
if (ffSysctlGetString("machdep.dmi.system-version", &host->version) == NULL) {
|
||||
if (ffSysctlGetString("machdep.dmi.system-version", &host->version) == nullptr) {
|
||||
ffCleanUpSmbiosValue(&host->version);
|
||||
}
|
||||
if (ffSysctlGetString("machdep.dmi.system-serial", &host->serial) == NULL) {
|
||||
if (ffSysctlGetString("machdep.dmi.system-serial", &host->serial) == nullptr) {
|
||||
ffCleanUpSmbiosValue(&host->serial);
|
||||
}
|
||||
if (ffSysctlGetString("machdep.dmi.system-uuid", &host->uuid) == NULL) {
|
||||
if (ffSysctlGetString("machdep.dmi.system-uuid", &host->uuid) == nullptr) {
|
||||
ffCleanUpSmbiosValue(&host->uuid);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
#include "common/smbios.h"
|
||||
|
||||
const char* ffDetectHost(FFHostResult* host) {
|
||||
const char* error = NULL;
|
||||
const char* error = nullptr;
|
||||
if ((error = ffSysctlGetString(CTL_HW, HW_PRODUCT, &host->name))) {
|
||||
return error;
|
||||
}
|
||||
ffCleanUpSmbiosValue(&host->name);
|
||||
if (ffSysctlGetString(CTL_HW, HW_VENDOR, &host->vendor) == NULL) {
|
||||
if (ffSysctlGetString(CTL_HW, HW_VENDOR, &host->vendor) == nullptr) {
|
||||
ffCleanUpSmbiosValue(&host->vendor);
|
||||
}
|
||||
if (ffSysctlGetString(CTL_HW, HW_VERSION, &host->version) == NULL) {
|
||||
if (ffSysctlGetString(CTL_HW, HW_VERSION, &host->version) == nullptr) {
|
||||
ffCleanUpSmbiosValue(&host->version);
|
||||
}
|
||||
if (ffSysctlGetString(CTL_HW, HW_SERIALNO, &host->serial) == NULL) {
|
||||
if (ffSysctlGetString(CTL_HW, HW_SERIALNO, &host->serial) == nullptr) {
|
||||
ffCleanUpSmbiosValue(&host->serial);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -70,5 +70,5 @@ const char* ffDetectHost(FFHostResult* host) {
|
||||
ffHostDetectMac(host);
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user