mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-09 22:50:38 +01:00
Global: replaces NULL to nullptr
This commit is contained in:
@@ -40,7 +40,7 @@ const char* ffDetectWallpaper(FFstrbuf* result)
|
||||
}
|
||||
}
|
||||
if (result->length > 0)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,13 +60,13 @@ const char* ffDetectWallpaper(FFstrbuf* result)
|
||||
"JOIN spaces ON pictures.space_id=spaces.ROWID\n"
|
||||
"WHERE display_id=1 AND space_id=1 AND key=1", result)
|
||||
)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (ffOsascript("tell application \"Finder\" to get POSIX path of (get desktop picture as alias)", result))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return "All detection methods failed";
|
||||
}
|
||||
|
||||
@@ -50,5 +50,5 @@ const char* ffDetectWallpaper(FFstrbuf* result) {
|
||||
}
|
||||
|
||||
ffStrbufAppendS(result, path.String());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ static const char* detectCosmicComp(FFstrbuf* result) {
|
||||
|
||||
if (!ffStrbufEqualS(&cleaned, "[]")) {
|
||||
const char* firstQuote = strchr(backgrounds.chars, '"');
|
||||
if (firstQuote != NULL) {
|
||||
if (firstQuote != nullptr) {
|
||||
const char* secondQuote = strchr(firstQuote + 1, '"');
|
||||
if (secondQuote != NULL && secondQuote > firstQuote + 1) {
|
||||
if (secondQuote != nullptr && secondQuote > firstQuote + 1) {
|
||||
ffStrbufAppendNS(&monitorName, (uint32_t) (secondQuote - firstQuote - 1), firstQuote + 1);
|
||||
sharedWallpaper = false;
|
||||
}
|
||||
@@ -43,12 +43,12 @@ static const char* detectCosmicComp(FFstrbuf* result) {
|
||||
}
|
||||
|
||||
const char* sourceStart = strstr(output.chars, "source:");
|
||||
if (sourceStart == NULL) {
|
||||
if (sourceStart == nullptr) {
|
||||
return "COSMIC wallpaper config doesn't contain source";
|
||||
}
|
||||
|
||||
const char* pathStart = strstr(sourceStart, "Path(");
|
||||
if (pathStart == NULL) {
|
||||
if (pathStart == nullptr) {
|
||||
return "COSMIC wallpaper source is not a Path value";
|
||||
}
|
||||
|
||||
@@ -64,12 +64,12 @@ static const char* detectCosmicComp(FFstrbuf* result) {
|
||||
char quote = *pathStart;
|
||||
++pathStart;
|
||||
const char* pathEnd = strchr(pathStart, quote);
|
||||
if (pathEnd == NULL || pathEnd == pathStart) {
|
||||
if (pathEnd == nullptr || pathEnd == pathStart) {
|
||||
return "COSMIC wallpaper path is empty";
|
||||
}
|
||||
|
||||
ffStrbufAppendNS(result, (uint32_t) (pathEnd - pathStart), pathStart);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const char* ffDetectWallpaper(FFstrbuf* result) {
|
||||
@@ -78,7 +78,7 @@ const char* ffDetectWallpaper(FFstrbuf* result) {
|
||||
return detectCosmicComp(result);
|
||||
}
|
||||
|
||||
const FFstrbuf* wallpaper = NULL;
|
||||
const FFstrbuf* wallpaper = nullptr;
|
||||
const FFGTKResult* gtk = ffDetectGTK4();
|
||||
if (gtk->wallpaper.length) {
|
||||
wallpaper = >k->wallpaper;
|
||||
@@ -98,5 +98,5 @@ const char* ffDetectWallpaper(FFstrbuf* result) {
|
||||
} else {
|
||||
ffStrbufAppend(result, wallpaper);
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
#include "common/windows/registry.h"
|
||||
|
||||
const char* ffDetectWallpaper(FFstrbuf* result) {
|
||||
FF_AUTO_CLOSE_FD HANDLE hKey = NULL;
|
||||
if (!ffRegOpenKeyForRead(HKEY_CURRENT_USER, L"Control Panel\\Desktop", &hKey, NULL)) {
|
||||
FF_AUTO_CLOSE_FD HANDLE hKey = nullptr;
|
||||
if (!ffRegOpenKeyForRead(HKEY_CURRENT_USER, L"Control Panel\\Desktop", &hKey, nullptr)) {
|
||||
return "ffRegOpenKeyForRead(Control Panel\\Desktop) failed";
|
||||
}
|
||||
|
||||
if (!ffRegReadStrbuf(hKey, L"WallPaper", result, NULL)) {
|
||||
if (!ffRegReadStrbuf(hKey, L"WallPaper", result, nullptr)) {
|
||||
return "ffRegReadStrbuf(WallPaper) failed";
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user