mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Style: adds Cpp11BracedListStyle: Block
This commit is contained in:
@@ -5,13 +5,13 @@
|
||||
#ifdef __OpenBSD__
|
||||
const char* ffSysctlGetString(int mib1, int mib2, FFstrbuf* result) {
|
||||
size_t neededLength;
|
||||
if (sysctl((int[]) {mib1, mib2}, 2, NULL, &neededLength, NULL, 0) != 0 || neededLength == 1) { // neededLength is 1 for empty strings, because of the null terminator
|
||||
if (sysctl((int[]) { mib1, mib2 }, 2, NULL, &neededLength, NULL, 0) != 0 || neededLength == 1) { // neededLength is 1 for empty strings, because of the null terminator
|
||||
return "sysctlbyname() failed";
|
||||
}
|
||||
|
||||
ffStrbufEnsureFree(result, (uint32_t) neededLength - 1);
|
||||
|
||||
if (sysctl((int[]) {mib1, mib2}, 2, result->chars + result->length, &neededLength, NULL, 0) == 0) {
|
||||
if (sysctl((int[]) { mib1, mib2 }, 2, result->chars + result->length, &neededLength, NULL, 0) == 0) {
|
||||
result->length += (uint32_t) neededLength - 1;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ const char* ffSysctlGetString(int mib1, int mib2, FFstrbuf* result) {
|
||||
int ffSysctlGetInt(int mib1, int mib2, int defaultValue) {
|
||||
int result;
|
||||
size_t neededLength = sizeof(result);
|
||||
if (sysctl((int[]) {mib1, mib2}, 2, &result, &neededLength, NULL, 0) != 0) {
|
||||
if (sysctl((int[]) { mib1, mib2 }, 2, &result, &neededLength, NULL, 0) != 0) {
|
||||
return defaultValue;
|
||||
}
|
||||
return result;
|
||||
@@ -32,7 +32,7 @@ int ffSysctlGetInt(int mib1, int mib2, int defaultValue) {
|
||||
int64_t ffSysctlGetInt64(int mib1, int mib2, int64_t defaultValue) {
|
||||
int64_t result;
|
||||
size_t neededLength = sizeof(result);
|
||||
if (sysctl((int[]) {mib1, mib2}, 2, &result, &neededLength, NULL, 0) != 0) {
|
||||
if (sysctl((int[]) { mib1, mib2 }, 2, &result, &neededLength, NULL, 0) != 0) {
|
||||
return defaultValue;
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user