mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
Global: replaces NULL to nullptr
This commit is contained in:
+20
-20
@@ -50,7 +50,7 @@ static void getKDE(FFstrbuf* result, FF_A_UNUSED FFDEOptions* options) {
|
||||
}
|
||||
|
||||
if (result->length == 0) {
|
||||
if (ffProcessAppendStdOut(result, (char* const[]) { "plasmashell", "--version", NULL }) == NULL) { // plasmashell 5.27.5
|
||||
if (ffProcessAppendStdOut(result, (char* const[]) { "plasmashell", "--version", nullptr }) == nullptr) { // plasmashell 5.27.5
|
||||
ffStrbufSubstrAfterLastC(result, ' ');
|
||||
}
|
||||
}
|
||||
@@ -59,12 +59,12 @@ static void getKDE(FFstrbuf* result, FF_A_UNUSED FFDEOptions* options) {
|
||||
static const char* getGnomeByDbus(FF_A_UNUSED FFstrbuf* result) {
|
||||
#ifdef FF_HAVE_DBUS
|
||||
FF_DBUS_AUTO_DESTROY_DATA FFDBusData dbus = {};
|
||||
if (ffDBusLoadData(DBUS_BUS_SESSION, &dbus) != NULL) {
|
||||
if (ffDBusLoadData(DBUS_BUS_SESSION, &dbus) != nullptr) {
|
||||
return "ffDBusLoadData() failed";
|
||||
}
|
||||
|
||||
ffDBusGetPropertyString(&dbus, "org.gnome.Shell", "/org/gnome/Shell", "org.gnome.Shell", "ShellVersion", result);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
#else // FF_HAVE_DBUS
|
||||
return "ffDBusLoadData() failed: dbus support not compiled in";
|
||||
#endif // FF_HAVE_DBUS
|
||||
@@ -74,7 +74,7 @@ static void getGnome(FFstrbuf* result, FF_A_UNUSED FFDEOptions* options) {
|
||||
getGnomeByDbus(result);
|
||||
|
||||
if (result->length == 0) {
|
||||
if (ffProcessAppendStdOut(result, (char* const[]) { "gnome-shell", "--version", NULL }) == NULL) { // GNOME Shell 44.1
|
||||
if (ffProcessAppendStdOut(result, (char* const[]) { "gnome-shell", "--version", nullptr }) == nullptr) { // GNOME Shell 44.1
|
||||
ffStrbufSubstrAfterLastC(result, ' ');
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ static void getCinnamon(FFstrbuf* result, FF_A_UNUSED FFDEOptions* options) {
|
||||
}
|
||||
|
||||
if (result->length == 0) {
|
||||
if (ffProcessAppendStdOut(result, (char* const[]) { "cinnamon", "--version", NULL }) == NULL) { // Cinnamon 6.2.2
|
||||
if (ffProcessAppendStdOut(result, (char* const[]) { "cinnamon", "--version", nullptr }) == nullptr) { // Cinnamon 6.2.2
|
||||
ffStrbufSubstrAfterLastC(result, ' ');
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ static void getMate(FFstrbuf* result, FF_A_UNUSED FFDEOptions* options) {
|
||||
ffParseSemver(result, &major, &minor, µ);
|
||||
|
||||
if (result->length == 0) {
|
||||
ffProcessAppendStdOut(result, (char* const[]) { "mate-session", "--version", NULL });
|
||||
ffProcessAppendStdOut(result, (char* const[]) { "mate-session", "--version", nullptr });
|
||||
|
||||
ffStrbufSubstrAfterFirstC(result, ' ');
|
||||
ffStrbufTrim(result, ' ');
|
||||
@@ -117,7 +117,7 @@ static const char* getXfce4ByLib(FFstrbuf* result) {
|
||||
FF_LIBRARY_LOAD_MESSAGE(xfce4util, "libxfce4util" FF_LIBRARY_EXTENSION, 7);
|
||||
FF_LIBRARY_LOAD_SYMBOL_MESSAGE(xfce4util, xfce_version_string);
|
||||
ffStrbufSetS(result, ffxfce_version_string());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
#else
|
||||
FF_UNUSED(result);
|
||||
return "dlopen is disabled";
|
||||
@@ -129,7 +129,7 @@ static void getXFCE4(FFstrbuf* result, FF_A_UNUSED FFDEOptions* options) {
|
||||
|
||||
if (result->length == 0) {
|
||||
// This is somewhat slow
|
||||
ffProcessAppendStdOut(result, (char* const[]) { "xfce4-session", "--version", NULL });
|
||||
ffProcessAppendStdOut(result, (char* const[]) { "xfce4-session", "--version", nullptr });
|
||||
|
||||
ffStrbufSubstrBeforeFirstC(result, ')');
|
||||
ffStrbufSubstrAfterLastC(result, ' ');
|
||||
@@ -149,7 +149,7 @@ static void getLXQt(FFstrbuf* result, FF_A_UNUSED FFDEOptions* options) {
|
||||
|
||||
if (result->length == 0) {
|
||||
// This is really, really, really slow. Thank you, LXQt developers
|
||||
ffProcessAppendStdOut(result, (char* const[]) { "lxqt-session", "-v", NULL });
|
||||
ffProcessAppendStdOut(result, (char* const[]) { "lxqt-session", "-v", nullptr });
|
||||
|
||||
result->length = 0; // don't set '\0' byte
|
||||
ffParsePropLines(result->chars, "liblxqt", result);
|
||||
@@ -187,25 +187,25 @@ static const char* getTrinity(FFstrbuf* result, FF_A_UNUSED FFDEOptions* options
|
||||
ffStrbufSubstrBeforeLastC(&path, '/');
|
||||
ffStrbufAppendS(&path, "/../lib/libtdecore.so");
|
||||
|
||||
if (ffBinaryExtractStrings(path.chars, extractTdeVersion, result, strlen("R0.0.0")) == NULL) {
|
||||
return NULL;
|
||||
if (ffBinaryExtractStrings(path.chars, extractTdeVersion, result, strlen("R0.0.0")) == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ffStrbufClear(&path);
|
||||
if (ffProcessAppendStdOut(&path, (char* const[]) { "tde-config", "--version", NULL }) == NULL) {
|
||||
if (ffProcessAppendStdOut(&path, (char* const[]) { "tde-config", "--version", nullptr }) == nullptr) {
|
||||
ffParsePropLines(path.chars, "TDE: ", result);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return "All methods failed";
|
||||
}
|
||||
|
||||
static const char* getCosmic(FFstrbuf* result, FF_A_UNUSED FFDEOptions* options) {
|
||||
if (ffProcessAppendStdOut(result, (char* const[]) { "cosmic-comp", "--version", NULL }) == NULL) {
|
||||
if (ffProcessAppendStdOut(result, (char* const[]) { "cosmic-comp", "--version", nullptr }) == nullptr) {
|
||||
// cosmic-comp 0.1.0 (git commit fa88002ba41d2edec25dd7ffdee9719fbb928fc0)
|
||||
ffStrbufSubstrAfterFirstC(result, ' ');
|
||||
ffStrbufSubstrBeforeFirstC(result, ' ');
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return "All methods failed";
|
||||
@@ -214,11 +214,11 @@ static const char* getCosmic(FFstrbuf* result, FF_A_UNUSED FFDEOptions* options)
|
||||
static const char* getEnlightenmentByDbus(FF_A_UNUSED FFstrbuf* result) {
|
||||
#ifdef FF_HAVE_DBUS
|
||||
FF_DBUS_AUTO_DESTROY_DATA FFDBusData dbus = {};
|
||||
if (ffDBusLoadData(DBUS_BUS_SESSION, &dbus) != NULL) {
|
||||
if (ffDBusLoadData(DBUS_BUS_SESSION, &dbus) != nullptr) {
|
||||
return "ffDBusLoadData() failed";
|
||||
}
|
||||
|
||||
DBusMessage* reply = ffDBusGetMethodReply(&dbus, "org.enlightenment.wm.service", "/org/enlightenment/wm/RemoteObject", "org.enlightenment.wm.Core", "Version", NULL, NULL);
|
||||
DBusMessage* reply = ffDBusGetMethodReply(&dbus, "org.enlightenment.wm.service", "/org/enlightenment/wm/RemoteObject", "org.enlightenment.wm.Core", "Version", nullptr, nullptr);
|
||||
if (!reply) {
|
||||
return "ffDBusGetMethodReply() failed";
|
||||
}
|
||||
@@ -234,7 +234,7 @@ static const char* getEnlightenmentByDbus(FF_A_UNUSED FFstrbuf* result) {
|
||||
}
|
||||
dbus.lib->ffdbus_message_unref(reply);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
#else // FF_HAVE_DBUS
|
||||
return "ffDBusLoadData() failed: dbus support not compiled in";
|
||||
#endif // FF_HAVE_DBUS
|
||||
@@ -244,7 +244,7 @@ static void getEnlightenment(FFstrbuf* result, FF_A_UNUSED FFDEOptions* options)
|
||||
getEnlightenmentByDbus(result);
|
||||
|
||||
if (result->length == 0) {
|
||||
if (ffProcessAppendStdOut(result, (char* const[]) { "enlightenment", "--version", NULL }) == NULL) { // ...\nVersion: 0.27.1\n...
|
||||
if (ffProcessAppendStdOut(result, (char* const[]) { "enlightenment", "--version", nullptr }) == nullptr) { // ...\nVersion: 0.27.1\n...
|
||||
ffStrbufSubstrAfterFirstS(result, "Version: ");
|
||||
ffStrbufSubstrBeforeFirstC(result, '\n');
|
||||
}
|
||||
@@ -280,5 +280,5 @@ const char* ffDetectDEVersion(const FFstrbuf* deName, FFstrbuf* result, FFDEOpti
|
||||
} else {
|
||||
return "Unsupported DE";
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user