mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 09:33:39 +01:00
Global: overall optimization
This commit is contained in:
@@ -74,7 +74,7 @@ void ffPrintBluetooth(FFBluetoothOptions* options)
|
||||
for(uint32_t i = 0; i < filtered.length; i++)
|
||||
{
|
||||
uint8_t index = (uint8_t) (filtered.length == 1 ? 0 : i + 1);
|
||||
printDevice(options, *(FFBluetoothResult**)ffListGet(&filtered, i), index);
|
||||
printDevice(options, *FF_LIST_GET(FFBluetoothResult*, filtered, i), index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ void ffPrintDisplay(FFDisplayOptions* options)
|
||||
|
||||
for(uint32_t i = 0; i < dsResult->displays.length; i++)
|
||||
{
|
||||
FFDisplayResult* result = ffListGet(&dsResult->displays, i);
|
||||
FFDisplayResult* result = FF_LIST_GET(FFDisplayResult, dsResult->displays, i);
|
||||
uint32_t moduleIndex = dsResult->displays.length == 1 ? 0 : i + 1;
|
||||
const char* displayType = result->type == FF_DISPLAY_TYPE_UNKNOWN ? NULL : result->type == FF_DISPLAY_TYPE_BUILTIN ? "built-in" : "external";
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ void ffPrintGPU(FFGPUOptions* options)
|
||||
}
|
||||
|
||||
for(uint32_t i = 0; i < selectedGPUs.length; i++)
|
||||
printGPUResult(options, selectedGPUs.length == 1 ? 0 : (uint8_t) (i + 1), * (const FFGPUResult**) ffListGet(&selectedGPUs, i));
|
||||
printGPUResult(options, selectedGPUs.length == 1 ? 0 : (uint8_t) (i + 1), *FF_LIST_GET(const FFGPUResult*, selectedGPUs, i));
|
||||
|
||||
if(selectedGPUs.length == 0)
|
||||
ffPrintError(FF_GPU_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "No GPUs found");
|
||||
|
||||
@@ -25,7 +25,7 @@ void ffPrintPowerAdapter(FFPowerAdapterOptions* options)
|
||||
{
|
||||
for(uint8_t i = 0; i < (uint8_t) results.length; i++)
|
||||
{
|
||||
FFPowerAdapterResult* result = ffListGet(&results, i);
|
||||
FFPowerAdapterResult* result = FF_LIST_GET(FFPowerAdapterResult, results, i);
|
||||
|
||||
if(options->moduleArgs.outputFormat.length == 0)
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ void ffPrintUsers(FFUsersOptions* options)
|
||||
{
|
||||
if(i > 0)
|
||||
ffStrbufAppendS(&result, ", ");
|
||||
FFUserResult* user = (FFUserResult*)ffListGet(&users, i);
|
||||
FFUserResult* user = FF_LIST_GET(FFUserResult, users, i);
|
||||
ffStrbufAppend(&result, &user->name);
|
||||
}
|
||||
ffStrbufPutTo(&result, stdout);
|
||||
@@ -47,7 +47,7 @@ void ffPrintUsers(FFUsersOptions* options)
|
||||
{
|
||||
for(uint32_t i = 0; i < users.length; ++i)
|
||||
{
|
||||
FFUserResult* user = (FFUserResult*)ffListGet(&users, i);
|
||||
FFUserResult* user = FF_LIST_GET(FFUserResult, users, i);
|
||||
|
||||
ffPrintLogoAndKey(FF_USERS_MODULE_NAME, users.length == 1 ? 0 : (uint8_t) (i + 1), &options->moduleArgs, FF_PRINT_TYPE_DEFAULT);
|
||||
|
||||
@@ -66,7 +66,7 @@ void ffPrintUsers(FFUsersOptions* options)
|
||||
{
|
||||
for(uint32_t i = 0; i < users.length; ++i)
|
||||
{
|
||||
FFUserResult* user = (FFUserResult*)ffListGet(&users, i);
|
||||
FFUserResult* user = FF_LIST_GET(FFUserResult, users, i);
|
||||
|
||||
FF_PRINT_FORMAT_CHECKED(FF_USERS_MODULE_NAME, users.length == 1 ? 0 : (uint8_t) (i + 1), &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_USERS_NUM_FORMAT_ARGS, ((FFformatarg[]){
|
||||
FF_FORMAT_ARG(user->name, "name"),
|
||||
|
||||
@@ -24,7 +24,7 @@ void ffPrintWifi(FFWifiOptions* options)
|
||||
|
||||
for(uint32_t index = 0; index < result.length; ++index)
|
||||
{
|
||||
FFWifiResult* item = (FFWifiResult*)ffListGet(&result, index);
|
||||
FFWifiResult* item = FF_LIST_GET(FFWifiResult, result, index);
|
||||
uint8_t moduleIndex = result.length == 1 ? 0 : (uint8_t)(index + 1);
|
||||
|
||||
if(options->moduleArgs.outputFormat.length == 0)
|
||||
|
||||
Reference in New Issue
Block a user