diff --git a/src/modules/bluetooth/bluetooth.c b/src/modules/bluetooth/bluetooth.c index 641acebdc..6721c336d 100644 --- a/src/modules/bluetooth/bluetooth.c +++ b/src/modules/bluetooth/bluetooth.c @@ -66,6 +66,7 @@ bool ffPrintBluetooth(FFBluetoothOptions* options) { if (devices.length == 0) { ffPrintError(FF_BLUETOOTH_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "No bluetooth devices found"); + return false; } uint8_t i = 1; diff --git a/src/modules/bluetoothradio/bluetoothradio.c b/src/modules/bluetoothradio/bluetoothradio.c index 713931ab9..594b00c29 100644 --- a/src/modules/bluetoothradio/bluetoothradio.c +++ b/src/modules/bluetoothradio/bluetoothradio.c @@ -113,6 +113,7 @@ bool ffPrintBluetoothRadio(FFBluetoothRadioOptions* options) { } else { ffPrintError(FF_BLUETOOTHRADIO_DISPLAY_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "No devices detected"); } + return false; } FF_LIST_FOR_EACH (FFBluetoothRadioResult, radio, radios) { diff --git a/src/modules/gpu/gpu.c b/src/modules/gpu/gpu.c index b0ace2000..5be84426e 100644 --- a/src/modules/gpu/gpu.c +++ b/src/modules/gpu/gpu.c @@ -196,10 +196,6 @@ bool ffPrintGPU(FFGPUOptions* options) { ++i; } - if (selectedGPUs.length == 0) { - ffPrintError(FF_GPU_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, "No GPUs found"); - } - FF_LIST_FOR_EACH (FFGPUResult, gpu, gpus) { ffStrbufDestroy(&gpu->vendor); ffStrbufDestroy(&gpu->name); @@ -208,6 +204,11 @@ bool ffPrintGPU(FFGPUOptions* options) { ffStrbufDestroy(&gpu->memoryType); } + if (selectedGPUs.length == 0) { + ffPrintError(FF_GPU_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, (gpus.length > 0 ? "GPUs found but all hidden by hideType option" : "No GPUs detected")); + return false; + } + return true; } @@ -230,7 +231,7 @@ void ffParseGPUJsonObject(FFGPUOptions* options, yyjson_val* module) { if (unsafe_yyjson_equals_str(key, "detectionMethod")) { int value; - const char* error = ffJsonConfigParseEnum(val, &value, (FFKeyValuePair[]) { + const char* error = ffJsonConfigParseEnum(val, &value, (FFKeyValuePair[]){ { "auto", FF_GPU_DETECTION_METHOD_AUTO }, { "pci", FF_GPU_DETECTION_METHOD_PCI }, { "vulkan", FF_GPU_DETECTION_METHOD_VULKAN }, @@ -251,7 +252,7 @@ void ffParseGPUJsonObject(FFGPUOptions* options, yyjson_val* module) { options->hideType = FF_GPU_TYPE_NONE; } else { int value; - const char* error = ffJsonConfigParseEnum(val, &value, (FFKeyValuePair[]) { + const char* error = ffJsonConfigParseEnum(val, &value, (FFKeyValuePair[]){ { "none", FF_GPU_TYPE_NONE }, { "unknown", FF_GPU_TYPE_UNKNOWN }, { "integrated", FF_GPU_TYPE_INTEGRATED }, @@ -445,8 +446,8 @@ void ffInitGPUOptions(FFGPUOptions* options) { ; options->temp = false; options->hideType = FF_GPU_TYPE_NONE; - options->tempConfig = (FFColorRangeConfig) { 60, 80 }; - options->percent = (FFPercentageModuleConfig) { 50, 80, 0 }; + options->tempConfig = (FFColorRangeConfig){ 60, 80 }; + options->percent = (FFPercentageModuleConfig){ 50, 80, 0 }; } void ffDestroyGPUOptions(FFGPUOptions* options) { @@ -462,7 +463,7 @@ FFModuleBaseInfo ffGPUModuleInfo = { .printModule = (void*) ffPrintGPU, .generateJsonResult = (void*) ffGenerateGPUJsonResult, .generateJsonConfig = (void*) ffGenerateGPUJsonConfig, - .formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]) { + .formatArgs = FF_FORMAT_ARG_LIST(((FFModuleFormatArg[]){ { "GPU vendor", "vendor" }, { "GPU name", "name" }, { "GPU driver", "driver" },