mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-31 01:56:28 +01:00
Global: replaces NULL to nullptr
This commit is contained in:
@@ -4,7 +4,7 @@ void ffDetectOSImpl(FFOSResult* os);
|
||||
|
||||
const FFOSResult* ffDetectOS(void) {
|
||||
static FFOSResult result;
|
||||
if (result.name.chars == NULL) {
|
||||
if (result.name.chars == nullptr) {
|
||||
ffStrbufInit(&result.name);
|
||||
ffStrbufInit(&result.prettyName);
|
||||
ffStrbufInit(&result.id);
|
||||
|
||||
@@ -82,8 +82,8 @@ FF_A_UNUSED static bool getUbuntuFlavour(FFOSResult* result) {
|
||||
ffStrbufClear(&result->version);
|
||||
if (ffProcessAppendStdOut(&result->version, (char* const[]) {
|
||||
"/usr/bin/lliurex-version",
|
||||
NULL,
|
||||
}) == NULL) { // 8.2.2
|
||||
nullptr,
|
||||
}) == nullptr) { // 8.2.2
|
||||
ffStrbufTrimRightSpace(&result->version);
|
||||
}
|
||||
ffStrbufSetF(&result->prettyName, "LliureX %s", result->version.chars);
|
||||
@@ -217,8 +217,8 @@ FF_A_UNUSED static bool detectDebianDerived(FFOSResult* result) {
|
||||
"--showformat=${version}",
|
||||
"--show",
|
||||
"pve-manager",
|
||||
NULL,
|
||||
}) == NULL) { // 8.2.2
|
||||
nullptr,
|
||||
}) == nullptr) { // 8.2.2
|
||||
ffStrbufTrimRightSpace(&result->versionID);
|
||||
ffStrbufSetStatic(&result->prettyName, "Proxmox VE ");
|
||||
ffStrbufAppend(&result->prettyName, &result->versionID);
|
||||
@@ -236,8 +236,8 @@ FF_A_UNUSED static bool detectDebianDerived(FFOSResult* result) {
|
||||
"--showformat=${version}",
|
||||
"--show",
|
||||
"proxmox-backup-server",
|
||||
NULL,
|
||||
}) == NULL) {
|
||||
nullptr,
|
||||
}) == nullptr) {
|
||||
ffStrbufTrimRightSpace(&result->versionID);
|
||||
ffStrbufSetStatic(&result->prettyName, "Proxmox Backup Server ");
|
||||
ffStrbufAppend(&result->prettyName, &result->versionID);
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
PWSTR WINAPI BrandingFormatString(PCWSTR format);
|
||||
|
||||
static bool getCodeName(FFOSResult* os) {
|
||||
FF_AUTO_CLOSE_FD HANDLE hKey = NULL;
|
||||
if (!ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hKey, NULL)) {
|
||||
FF_AUTO_CLOSE_FD HANDLE hKey = nullptr;
|
||||
if (!ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hKey, nullptr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ffRegReadStrbuf(hKey, L"DisplayVersion", &os->codename, NULL)) {
|
||||
if (!ffRegReadStrbuf(hKey, L"CSDVersion", &os->codename, NULL)) { // For Windows 7 and Windows 8
|
||||
if (!ffRegReadStrbuf(hKey, L"ReleaseId", &os->codename, NULL)) { // For old Windows 10
|
||||
if (!ffRegReadStrbuf(hKey, L"DisplayVersion", &os->codename, nullptr)) {
|
||||
if (!ffRegReadStrbuf(hKey, L"CSDVersion", &os->codename, nullptr)) { // For Windows 7 and Windows 8
|
||||
if (!ffRegReadStrbuf(hKey, L"ReleaseId", &os->codename, nullptr)) { // For old Windows 10
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -39,9 +39,9 @@ void ffDetectOSImpl(FFOSResult* os) {
|
||||
|
||||
if (os->variant.length == 0) // Windows PE?
|
||||
{
|
||||
FF_AUTO_CLOSE_FD HANDLE hKey = NULL;
|
||||
if (ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hKey, NULL)) {
|
||||
ffRegReadStrbuf(hKey, L"ProductName", &os->variant, NULL);
|
||||
FF_AUTO_CLOSE_FD HANDLE hKey = nullptr;
|
||||
if (ffRegOpenKeyForRead(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", &hKey, nullptr)) {
|
||||
ffRegReadStrbuf(hKey, L"ProductName", &os->variant, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user