diff --git a/src/common/io/io_unix.c b/src/common/io/io_unix.c index 018af9fa7..d6222a367 100644 --- a/src/common/io/io_unix.c +++ b/src/common/io/io_unix.c @@ -94,7 +94,7 @@ bool ffPathExists(const char* path, FFPathType type) if(stat(path, &fileStat) != 0) return false; - int mode = fileStat.st_mode & S_IFMT; + unsigned int mode = fileStat.st_mode & S_IFMT; if(type & FF_PATHTYPE_REGULAR && mode == S_IFREG) return true; diff --git a/src/common/processing_linux.c b/src/common/processing_linux.c index 81bf2eda2..4c136df5f 100644 --- a/src/common/processing_linux.c +++ b/src/common/processing_linux.c @@ -13,7 +13,7 @@ enum { FF_PIPE_BUFSIZ = 4096 }; -static inline void waitpid_wrapper(pid_t* pid) +static inline void waitpid_wrapper(const pid_t* pid) { // remove zombie processes if (*pid > 0) diff --git a/src/detection/board/board.h b/src/detection/board/board.h index c847436b5..44ba5c8ab 100644 --- a/src/detection/board/board.h +++ b/src/detection/board/board.h @@ -9,4 +9,4 @@ typedef struct FFBoardResult FFstrbuf version; } FFBoardResult; -const char* ffDetectBoard(FFBoardResult* result); +const char* ffDetectBoard(FFBoardResult* board); diff --git a/src/detection/de/de_linux.c b/src/detection/de/de_linux.c index 6ff8cfc73..1e800bc8f 100644 --- a/src/detection/de/de_linux.c +++ b/src/detection/de/de_linux.c @@ -155,7 +155,7 @@ const char* ffDetectDEVersion(const FFstrbuf* deName, FFstrbuf* result, FFDEOpti { if (ffStrbufEqualS(deName, FF_DE_PRETTY_PLASMA)) getKDE(result, options); - else if (ffStrbufEqualS(deName, FF_DE_PRETTY_GNOME) || ffStrbufEqualS(deName, FF_DE_PRETTY_GNOME)) + else if (ffStrbufEqualS(deName, FF_DE_PRETTY_GNOME)) getGnome(result, options); else if (ffStrbufEqualS(deName, FF_DE_PRETTY_CINNAMON)) getCinnamon(result, options); diff --git a/src/detection/disk/disk.h b/src/detection/disk/disk.h index 72ea82f2c..d288c8365 100644 --- a/src/detection/disk/disk.h +++ b/src/detection/disk/disk.h @@ -23,4 +23,4 @@ typedef struct FFDisk * Returns a List of FFDisk, sorted alphabetically by mountpoint. * If error is not set, disks contains at least one disk. */ -const char* ffDetectDisks(FFDiskOptions* options, FFlist* result /* list of FFDisk */); +const char* ffDetectDisks(FFDiskOptions* options, FFlist* disks /* list of FFDisk */); diff --git a/src/detection/displayserver/linux/xcb.c b/src/detection/displayserver/linux/xcb.c index 4a5240837..fde41abd3 100644 --- a/src/detection/displayserver/linux/xcb.c +++ b/src/detection/displayserver/linux/xcb.c @@ -60,7 +60,7 @@ static void* xcbGetProperty(XcbPropertyData* data, xcb_connection_t* connection, } //Why are xcb property strings not null terminated??? - void* replyValue = malloc((size_t) (length + 1)); + void* replyValue = malloc((size_t)length + 1); memcpy(replyValue, data->ffxcb_get_property_value(propertyReply), (size_t) length); ((char*) replyValue)[length] = '\0'; diff --git a/src/detection/gpu/gpu_linux.c b/src/detection/gpu/gpu_linux.c index 0404a5fef..819f3e7a4 100644 --- a/src/detection/gpu/gpu_linux.c +++ b/src/detection/gpu/gpu_linux.c @@ -192,7 +192,7 @@ FF_MAYBE_UNUSED static void pciDetectType(FFGPUResult* gpu) //and their memory sizes are usually smaller than 1GB. if (gpu->dedicated.total != FF_GPU_VMEM_SIZE_UNSET) { - gpu->type = gpu->dedicated.total > 1024 * 1024 * 1024 // 1GB + gpu->type = gpu->dedicated.total > (uint64_t)1024 * 1024 * 1024 // 1GB ? FF_GPU_TYPE_DISCRETE : FF_GPU_TYPE_INTEGRATED; } @@ -252,7 +252,7 @@ static void pciHandleDevice(FF_MAYBE_UNUSED const FFGPUOptions* options, FFlist* }, "libnvidia-ml.so"); if (gpu->dedicated.total != FF_GPU_VMEM_SIZE_UNSET) - gpu->type = gpu->dedicated.total > 1024 * 1024 * 1024 ? FF_GPU_TYPE_DISCRETE : FF_GPU_TYPE_INTEGRATED; + gpu->type = gpu->dedicated.total > (uint64_t)1024 * 1024 * 1024 ? FF_GPU_TYPE_DISCRETE : FF_GPU_TYPE_INTEGRATED; } #ifdef __linux__ diff --git a/src/detection/host/host.h b/src/detection/host/host.h index f3b1011f2..1957e9c6b 100644 --- a/src/detection/host/host.h +++ b/src/detection/host/host.h @@ -11,4 +11,4 @@ typedef struct FFHostResult FFstrbuf sysVendor; } FFHostResult; -const char* ffDetectHost(FFHostResult* result); +const char* ffDetectHost(FFHostResult* host); diff --git a/src/detection/memory/memory.h b/src/detection/memory/memory.h index 9e88c6118..8929883e8 100644 --- a/src/detection/memory/memory.h +++ b/src/detection/memory/memory.h @@ -8,4 +8,4 @@ typedef struct FFMemoryResult uint64_t bytesTotal; } FFMemoryResult; -const char* ffDetectMemory(FFMemoryResult* result); +const char* ffDetectMemory(FFMemoryResult* ram); diff --git a/src/detection/swap/swap.h b/src/detection/swap/swap.h index f52654ca4..1bbcf1766 100644 --- a/src/detection/swap/swap.h +++ b/src/detection/swap/swap.h @@ -8,4 +8,4 @@ typedef struct FFSwapResult uint64_t bytesTotal; } FFSwapResult; -const char* ffDetectSwap(FFSwapResult* result); +const char* ffDetectSwap(FFSwapResult* swap); diff --git a/src/detection/terminalfont/terminalfont.c b/src/detection/terminalfont/terminalfont.c index a50e56525..e20a31f93 100644 --- a/src/detection/terminalfont/terminalfont.c +++ b/src/detection/terminalfont/terminalfont.c @@ -59,8 +59,6 @@ FF_MAYBE_UNUSED static void detectTTY(FFTerminalFontResult* terminalFont) #if defined(_WIN32) || defined(__linux__) #include "common/library.h" -#include "common/processing.h" - #include static const char* detectWTProfile(yyjson_val* profile, FFstrbuf* name, double* size) diff --git a/src/detection/wifi/wifi_linux.c b/src/detection/wifi/wifi_linux.c index 9a5c957b9..24eda8da3 100644 --- a/src/detection/wifi/wifi_linux.c +++ b/src/detection/wifi/wifi_linux.c @@ -56,14 +56,16 @@ static const char* detectWifiWithLibnm(FFlist* result) { NMDevice *device = g_ptr_array_index(devices, i); if (!({ - GTypeInstance *__inst = (GTypeInstance*) device; GType __t = ffnm_device_wifi_get_type(); gboolean __r; - if (!__inst) - __r = FALSE; - else if (__inst->g_class && __inst->g_class->g_type == __t) - __r = TRUE; + GTypeInstance *inst = (GTypeInstance*) device; + GType type = ffnm_device_wifi_get_type(); + gboolean return_value; + if (!inst) + return_value = FALSE; + else if (inst->g_class && inst->g_class->g_type == type) + return_value = TRUE; else - __r = ffg_type_check_instance_is_a (__inst, __t); - __r; + return_value = ffg_type_check_instance_is_a (inst, type); + return_value; }) //NM_IS_DEVICE_WIFI(device) ) continue; diff --git a/src/modules/gpu/gpu.c b/src/modules/gpu/gpu.c index 0e4c5de7c..02eaf5460 100644 --- a/src/modules/gpu/gpu.c +++ b/src/modules/gpu/gpu.c @@ -2,7 +2,6 @@ #include "common/parsing.h" #include "common/printing.h" #include "common/jsonconfig.h" -#include "common/parsing.h" #include "detection/host/host.h" #include "detection/gpu/gpu.h" #include "modules/gpu/gpu.h"