From 873454191f258bd7a936fb50fcd3088ae5fee353 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Fri, 10 Jul 2026 16:35:46 +0800 Subject: [PATCH] Global: uses typed enums --- src/common/apple/smc_temps.h | 2 +- src/common/argType.h | 2 +- src/common/ffdata.h | 2 +- src/common/io.h | 3 +-- src/common/netif.h | 2 +- src/common/option.h | 3 +-- src/common/percent.h | 3 +-- src/common/printing.h | 3 +-- src/common/settings.h | 4 ++-- src/common/smbios.h | 3 +-- src/detection/codec/codec.h | 3 +-- src/detection/cpucache/cpucache.h | 2 +- src/detection/displayserver/displayserver.h | 6 +++--- src/detection/displayserver/linux/wayland/wayland.h | 2 +- src/detection/gpu/gpu_driver_specific.h | 3 +-- src/detection/gtk_qt/qt.c | 2 +- src/logo/image/image.h | 2 +- src/logo/logo.h | 5 ++--- src/modules/codec/option.h | 3 +-- src/modules/colors/option.h | 4 ++-- src/modules/disk/option.h | 5 ++--- src/modules/display/option.h | 5 ++--- src/modules/dns/option.h | 3 +-- src/modules/gpu/option.h | 4 ++-- src/modules/localip/option.h | 5 ++--- src/modules/opengl/option.h | 2 +- src/modules/packages/option.h | 3 +-- src/modules/physicaldisk/option.h | 4 +--- src/modules/sound/option.h | 2 +- src/options/display.h | 8 ++++---- src/options/general.h | 2 +- src/options/logo.h | 4 ++-- 32 files changed, 45 insertions(+), 61 deletions(-) diff --git a/src/common/apple/smc_temps.h b/src/common/apple/smc_temps.h index 6783bb95b..cf0c04305 100644 --- a/src/common/apple/smc_temps.h +++ b/src/common/apple/smc_temps.h @@ -8,7 +8,7 @@ typedef struct FFTempValue { double value; } FFTempValue; -enum FFTempType { +enum FFTempType: uint8_t { FF_TEMP_CPU_X64, FF_TEMP_CPU_M1X, FF_TEMP_CPU_M2X, diff --git a/src/common/argType.h b/src/common/argType.h index 81217c7f9..5851be7a2 100644 --- a/src/common/argType.h +++ b/src/common/argType.h @@ -10,7 +10,7 @@ typedef struct FFArgBuffer { uint32_t length; } FFArgBuffer; -typedef enum FF_A_PACKED FFArgType { +typedef enum FFArgType: uint8_t { FF_ARG_TYPE_NULL = 0, FF_ARG_TYPE_UINT, FF_ARG_TYPE_UINT64, diff --git a/src/common/ffdata.h b/src/common/ffdata.h index 189c0fab2..76857a1ce 100644 --- a/src/common/ffdata.h +++ b/src/common/ffdata.h @@ -2,7 +2,7 @@ #include "common/FFstrbuf.h" -typedef enum FF_A_PACKED FFDataResultDocType { +typedef enum FFDataResultDocType: uint8_t { FF_RESULT_DOC_TYPE_DEFAULT = 0, FF_RESULT_DOC_TYPE_JSON, FF_RESULT_DOC_TYPE_CONFIG, diff --git a/src/common/io.h b/src/common/io.h index e31712061..df69feb8c 100644 --- a/src/common/io.h +++ b/src/common/io.h @@ -169,11 +169,10 @@ FF_A_NONNULL(2, 3) static inline bool ffReadFileBufferRelative(FFNativeFD dfd, c return ffAppendFileBufferRelative(dfd, fileName, buffer); } -typedef enum FF_A_PACKED FFPathType { +typedef enum FFPathType: uint8_t { FF_PATHTYPE_FILE = 1 << 0, FF_PATHTYPE_DIRECTORY = 1 << 1, FF_PATHTYPE_ANY = FF_PATHTYPE_FILE | FF_PATHTYPE_DIRECTORY, - FF_PATHTYPE_FORCE_UNSIGNED = UINT8_MAX, } FFPathType; FF_A_NONNULL(1) static inline bool ffPathExists(const char* path, FFPathType pathType) { diff --git a/src/common/netif.h b/src/common/netif.h index d3984df42..75735f51b 100644 --- a/src/common/netif.h +++ b/src/common/netif.h @@ -7,7 +7,7 @@ #include #endif -typedef enum FF_A_PACKED FFNetifDefaultRouteResultStatus { +typedef enum FFNetifDefaultRouteResultStatus: uint8_t { FF_NETIF_UNINITIALIZED, FF_NETIF_INVALID, FF_NETIF_OK diff --git a/src/common/option.h b/src/common/option.h index ce0a0ab01..9fdf0bceb 100644 --- a/src/common/option.h +++ b/src/common/option.h @@ -36,7 +36,7 @@ typedef struct FFModuleBaseInfo { FFModuleFormatArgList formatArgs; } FFModuleBaseInfo; -typedef enum FF_A_PACKED FFModuleKeyType { +typedef enum FFModuleKeyType: uint8_t { FF_MODULE_KEY_TYPE_NONE = 0, FF_MODULE_KEY_TYPE_STRING = 1 << 0, FF_MODULE_KEY_TYPE_ICON = 1 << 1, @@ -47,7 +47,6 @@ typedef enum FF_A_PACKED FFModuleKeyType { FF_MODULE_KEY_TYPE_BOTH_2 = FF_MODULE_KEY_TYPE_BOTH_0 | (2 << FF_MODULE_KEY_TYPE_SPACE_SHIFT), FF_MODULE_KEY_TYPE_BOTH_3 = FF_MODULE_KEY_TYPE_BOTH_0 | (3 << FF_MODULE_KEY_TYPE_SPACE_SHIFT), FF_MODULE_KEY_TYPE_BOTH_4 = FF_MODULE_KEY_TYPE_BOTH_0 | (4 << FF_MODULE_KEY_TYPE_SPACE_SHIFT), - FF_MODULE_KEY_TYPE_FORCE_UNSIGNED = UINT8_MAX, } FFModuleKeyType; typedef struct FFModuleArgs { diff --git a/src/common/percent.h b/src/common/percent.h index c2eeba6b9..5e71dc7d7 100644 --- a/src/common/percent.h +++ b/src/common/percent.h @@ -4,14 +4,13 @@ #include "common/parsing.h" #include "common/option.h" -typedef enum FF_A_PACKED FFPercentageTypeFlags { +typedef enum FFPercentageTypeFlags: uint8_t { FF_PERCENTAGE_TYPE_NONE = 0, FF_PERCENTAGE_TYPE_NUM_BIT = 1 << 0, FF_PERCENTAGE_TYPE_BAR_BIT = 1 << 1, FF_PERCENTAGE_TYPE_HIDE_OTHERS_BIT = 1 << 2, FF_PERCENTAGE_TYPE_NUM_COLOR_BIT = 1 << 3, FF_PERCENTAGE_TYPE_BAR_MONOCHROME_BIT = 1 << 4, - FF_PERCENTAGE_TYPE_FORCE_UNSIGNED_ = UINT8_MAX, } FFPercentageTypeFlags; static_assert(sizeof(FFPercentageTypeFlags) == 1, ""); diff --git a/src/common/printing.h b/src/common/printing.h index f20a24416..6963bf026 100644 --- a/src/common/printing.h +++ b/src/common/printing.h @@ -3,13 +3,12 @@ #include "fastfetch.h" #include "common/format.h" -typedef enum FF_A_PACKED FFPrintType { +typedef enum FFPrintType: uint8_t { FF_PRINT_TYPE_DEFAULT = 0, FF_PRINT_TYPE_NO_CUSTOM_KEY = 1 << 0, // key has been formatted outside FF_PRINT_TYPE_NO_CUSTOM_KEY_COLOR = 1 << 1, FF_PRINT_TYPE_NO_CUSTOM_KEY_WIDTH = 1 << 2, FF_PRINT_TYPE_NO_CUSTOM_OUTPUT_FORMAT = 1 << 3, // reserved - FF_PRINT_TYPE_FORCE_UNSIGNED = UINT8_MAX, } FFPrintType; void ffPrintLogoAndKey(const char* moduleName, uint8_t moduleIndex, const FFModuleArgs* moduleArgs, FFPrintType printType); diff --git a/src/common/settings.h b/src/common/settings.h index f2143cf46..5161ff1f2 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -2,10 +2,10 @@ #include "fastfetch.h" -typedef enum FF_A_PACKED FFvarianttype { +typedef enum FFvarianttype: uint8_t { FF_VARIANT_TYPE_STRING, FF_VARIANT_TYPE_BOOL, - FF_VARIANT_TYPE_INT + FF_VARIANT_TYPE_INT, } FFvarianttype; typedef union FFvariant { diff --git a/src/common/smbios.h b/src/common/smbios.h index 24edbdabb..532dbb028 100644 --- a/src/common/smbios.h +++ b/src/common/smbios.h @@ -12,8 +12,7 @@ static inline void ffCleanUpSmbiosValue(FFstrbuf* value) { // https://github.com/KunYi/DumpSMBIOS // https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.9.0.pdf -typedef enum FF_A_PACKED FFSmbiosType // : uint8_t -{ +typedef enum FFSmbiosType : uint8_t { FF_SMBIOS_TYPE_BIOS = 0, FF_SMBIOS_TYPE_SYSTEM_INFO = 1, FF_SMBIOS_TYPE_BASEBOARD_INFO = 2, diff --git a/src/detection/codec/codec.h b/src/detection/codec/codec.h index d0f48d978..5f771a325 100644 --- a/src/detection/codec/codec.h +++ b/src/detection/codec/codec.h @@ -3,7 +3,7 @@ #include "fastfetch.h" #include "modules/codec/option.h" -typedef enum FF_A_PACKED FFCodecType { +typedef enum FFCodecType: uint32_t { FF_CODEC_TYPE_NONE = 0, FF_CODEC_TYPE_UNKNOWN = UINT32_C(1) << 0, FF_CODEC_TYPE_H261 = UINT32_C(1) << 1, @@ -25,7 +25,6 @@ typedef enum FF_A_PACKED FFCodecType { FF_CODEC_TYPE_PRORES = UINT32_C(1) << 17, FF_CODEC_TYPE_PRORES_RAW = UINT32_C(1) << 18, FF_CODEC_TYPE_MAX = FF_CODEC_TYPE_PRORES_RAW, - FF_CODEC_TYPE_FORCE_UNSIGNED = UINT32_MAX, } FFCodecType; typedef struct FFCodecResult { diff --git a/src/detection/cpucache/cpucache.h b/src/detection/cpucache/cpucache.h index 287154bbc..20f465787 100644 --- a/src/detection/cpucache/cpucache.h +++ b/src/detection/cpucache/cpucache.h @@ -3,7 +3,7 @@ #include "fastfetch.h" #include "modules/cpucache/option.h" -typedef enum FF_A_PACKED FFCPUCacheType { +typedef enum FFCPUCacheType: uint8_t { FF_CPU_CACHE_TYPE_UNIFIED = 0, FF_CPU_CACHE_TYPE_INSTRUCTION = 1, FF_CPU_CACHE_TYPE_DATA = 2, diff --git a/src/detection/displayserver/displayserver.h b/src/detection/displayserver/displayserver.h index 53c0de3ea..715a2de43 100644 --- a/src/detection/displayserver/displayserver.h +++ b/src/detection/displayserver/displayserver.h @@ -50,20 +50,20 @@ #define FF_WM_PROTOCOL_WAYLAND "Wayland" #define FF_WM_PROTOCOL_SURFACEFLINGER "SurfaceFlinger" -typedef enum FF_A_PACKED FFDisplayType { +typedef enum FFDisplayType: uint8_t { FF_DISPLAY_TYPE_UNKNOWN, FF_DISPLAY_TYPE_BUILTIN, FF_DISPLAY_TYPE_EXTERNAL, } FFDisplayType; -typedef enum FF_A_PACKED FFDisplayHdrStatus { +typedef enum FFDisplayHdrStatus: uint8_t { FF_DISPLAY_HDR_STATUS_UNKNOWN, FF_DISPLAY_HDR_STATUS_UNSUPPORTED, FF_DISPLAY_HDR_STATUS_SUPPORTED, FF_DISPLAY_HDR_STATUS_ENABLED, } FFDisplayHdrStatus; -typedef enum FF_A_PACKED FFDisplayVrrStatus { +typedef enum FFDisplayVrrStatus: uint8_t { FF_DISPLAY_DRR_STATUS_UNKNOWN, FF_DISPLAY_DRR_STATUS_DISABLED, FF_DISPLAY_DRR_STATUS_ENABLED, diff --git a/src/detection/displayserver/linux/wayland/wayland.h b/src/detection/displayserver/linux/wayland/wayland.h index e9d4fede8..18a023cc8 100644 --- a/src/detection/displayserver/linux/wayland/wayland.h +++ b/src/detection/displayserver/linux/wayland/wayland.h @@ -13,7 +13,7 @@ static inline uint32_t min(uint32_t a, uint32_t b) { return a < b ? a : b; } -typedef enum FF_A_PACKED WaylandProtocolType { +typedef enum WaylandProtocolType: uint8_t { FF_WAYLAND_PROTOCOL_TYPE_NONE, FF_WAYLAND_PROTOCOL_TYPE_GLOBAL, FF_WAYLAND_PROTOCOL_TYPE_KDE_DEPRECATED, diff --git a/src/detection/gpu/gpu_driver_specific.h b/src/detection/gpu/gpu_driver_specific.h index 807a0eb6e..c4f7e8b3d 100644 --- a/src/detection/gpu/gpu_driver_specific.h +++ b/src/detection/gpu/gpu_driver_specific.h @@ -2,11 +2,10 @@ #include "gpu.h" -typedef enum FF_A_PACKED FFGpuDriverConditionType { +typedef enum FFGpuDriverConditionType: uint8_t { FF_GPU_DRIVER_CONDITION_TYPE_BUS_ID = 1 << 0, FF_GPU_DRIVER_CONDITION_TYPE_DEVICE_ID = 1 << 1, FF_GPU_DRIVER_CONDITION_TYPE_LUID = 1 << 2, - FF_GPU_DRIVER_CONDITION_TYPE_FORCE_UNSIGNED = UINT8_MAX, } FFGpuDriverConditionType; typedef struct FFGpuDriverPciDeviceId { diff --git a/src/detection/gtk_qt/qt.c b/src/detection/gtk_qt/qt.c index 26c8b58e2..8a7d974c3 100644 --- a/src/detection/gtk_qt/qt.c +++ b/src/detection/gtk_qt/qt.c @@ -16,7 +16,7 @@ static inline bool allValuesSet(const FFQtResult* result) { result->wallpaper.length > 0; } -typedef enum FF_A_PACKED PlasmaCategory { +typedef enum PlasmaCategory: uint8_t { PLASMA_CATEGORY_GENERAL, PLASMA_CATEGORY_KDE, PLASMA_CATEGORY_ICONS, diff --git a/src/logo/image/image.h b/src/logo/image/image.h index da3b2d290..5fbd39a00 100644 --- a/src/logo/image/image.h +++ b/src/logo/image/image.h @@ -4,7 +4,7 @@ #if defined(FF_HAVE_IMAGEMAGICK7) || defined(FF_HAVE_IMAGEMAGICK6) -typedef enum FF_A_PACKED FFLogoImageResult { +typedef enum FFLogoImageResult: uint8_t { FF_LOGO_IMAGE_RESULT_SUCCESS, // Logo printed FF_LOGO_IMAGE_RESULT_INIT_ERROR, // Failed to load library, try again with next IM version FF_LOGO_IMAGE_RESULT_RUN_ERROR // Failed to load / convert image, cancel whole sixel code diff --git a/src/logo/logo.h b/src/logo/logo.h index 105b96499..324b590ca 100644 --- a/src/logo/logo.h +++ b/src/logo/logo.h @@ -2,14 +2,13 @@ #include "fastfetch.h" -typedef enum FF_A_PACKED FFLogoLineType { +typedef enum FFLogoLineType: uint8_t { FF_LOGO_LINE_TYPE_NORMAL = 0, FF_LOGO_LINE_TYPE_SMALL_BIT = 1 << 0, // The names of small logo must end with `_small` or `-small` FF_LOGO_LINE_TYPE_ALTER_BIT = 1 << 1, - FF_LOGO_LINE_TYPE_FORCE_UNSIGNED = UINT8_MAX, } FFLogoLineType; -typedef enum FF_A_PACKED FFLogoSize { +typedef enum FFLogoSize: uint8_t { FF_LOGO_SIZE_UNKNOWN, FF_LOGO_SIZE_NORMAL, FF_LOGO_SIZE_SMALL, diff --git a/src/modules/codec/option.h b/src/modules/codec/option.h index bcc920127..5f11f964d 100644 --- a/src/modules/codec/option.h +++ b/src/modules/codec/option.h @@ -2,12 +2,11 @@ #include "common/option.h" -typedef enum FF_A_PACKED FFCodecShowType { +typedef enum FFCodecShowType: uint8_t { FF_CODEC_SHOW_TYPE_NONE = 0, FF_CODEC_SHOW_TYPE_ENCODER = 1 << 0, FF_CODEC_SHOW_TYPE_DECODER = 1 << 1, FF_CODEC_SHOW_TYPE_BOTH = FF_CODEC_SHOW_TYPE_ENCODER | FF_CODEC_SHOW_TYPE_DECODER, - FF_CODEC_SHOW_TYPE_FORCE_UNSIGNED = UINT8_MAX, } FFCodecShowType; typedef struct FFCodecOptions { diff --git a/src/modules/colors/option.h b/src/modules/colors/option.h index c9971c71d..4d056bb2e 100644 --- a/src/modules/colors/option.h +++ b/src/modules/colors/option.h @@ -2,7 +2,7 @@ #include "common/option.h" -typedef enum FF_A_PACKED FFColorsSymbol { +typedef enum FFColorsSymbol: uint8_t { FF_COLORS_SYMBOL_BLOCK, FF_COLORS_SYMBOL_BACKGROUND, FF_COLORS_SYMBOL_CIRCLE, @@ -17,7 +17,7 @@ typedef struct FFBlockConfig { uint8_t range[2]; } FFBlockConfig; -typedef enum FF_A_PACKED FFColorsBrightness { +typedef enum FFColorsBrightness: uint8_t { FF_COLORS_BRIGHTNESS_DEFAULT, FF_COLORS_BRIGHTNESS_NORMAL, FF_COLORS_BRIGHTNESS_LIGHT, diff --git a/src/modules/disk/option.h b/src/modules/disk/option.h index b639db21e..c40ed4abf 100644 --- a/src/modules/disk/option.h +++ b/src/modules/disk/option.h @@ -3,7 +3,7 @@ #include "common/option.h" #include "common/percent.h" -typedef enum FF_A_PACKED FFDiskVolumeType { +typedef enum FFDiskVolumeType: uint8_t { FF_DISK_VOLUME_TYPE_NONE = 0, FF_DISK_VOLUME_TYPE_REGULAR_BIT = 1 << 0, FF_DISK_VOLUME_TYPE_HIDDEN_BIT = 1 << 1, @@ -11,10 +11,9 @@ typedef enum FF_A_PACKED FFDiskVolumeType { FF_DISK_VOLUME_TYPE_SUBVOLUME_BIT = 1 << 3, FF_DISK_VOLUME_TYPE_UNKNOWN_BIT = 1 << 4, FF_DISK_VOLUME_TYPE_READONLY_BIT = 1 << 5, - FF_DISK_VOLUME_TYPE_FORCE_UNSIGNED = UINT8_MAX, } FFDiskVolumeType; -typedef enum FF_A_PACKED FFDiskCalcType { +typedef enum FFDiskCalcType: uint8_t { FF_DISK_CALC_TYPE_FREE, FF_DISK_CALC_TYPE_AVAILABLE, } FFDiskCalcType; diff --git a/src/modules/display/option.h b/src/modules/display/option.h index 1ae73a406..9107f595d 100644 --- a/src/modules/display/option.h +++ b/src/modules/display/option.h @@ -2,15 +2,14 @@ #include "common/option.h" -typedef enum FF_A_PACKED FFDisplayCompactType { +typedef enum FFDisplayCompactType: uint8_t { FF_DISPLAY_COMPACT_TYPE_NONE = 0, FF_DISPLAY_COMPACT_TYPE_ORIGINAL_BIT = 1 << 0, FF_DISPLAY_COMPACT_TYPE_SCALED_BIT = 1 << 1, FF_DISPLAY_COMPACT_TYPE_REFRESH_RATE_BIT = 1 << 2, - FF_DISPLAY_COMPACT_TYPE_UNSIGNED = UINT8_MAX, } FFDisplayCompactType; -typedef enum FF_A_PACKED FFDisplayOrder { +typedef enum FFDisplayOrder: uint8_t { FF_DISPLAY_ORDER_NONE, FF_DISPLAY_ORDER_ASC, FF_DISPLAY_ORDER_DESC, diff --git a/src/modules/dns/option.h b/src/modules/dns/option.h index e20bbece7..0a041d482 100644 --- a/src/modules/dns/option.h +++ b/src/modules/dns/option.h @@ -2,11 +2,10 @@ #include "common/option.h" -typedef enum FF_A_PACKED FFDNSShowType { +typedef enum FFDNSShowType: uint8_t { FF_DNS_TYPE_IPV4_BIT = 1, FF_DNS_TYPE_IPV6_BIT = 2, FF_DNS_TYPE_BOTH = FF_DNS_TYPE_IPV4_BIT | FF_DNS_TYPE_IPV6_BIT, - FF_DNS_TYPE_FORCE_UNSIGNED = UINT8_MAX, } FFDNSShowType; typedef struct FFDNSOptions { diff --git a/src/modules/gpu/option.h b/src/modules/gpu/option.h index 4302b3402..3b569145d 100644 --- a/src/modules/gpu/option.h +++ b/src/modules/gpu/option.h @@ -3,14 +3,14 @@ #include "common/option.h" #include "common/percent.h" -typedef enum FF_A_PACKED FFGPUType { +typedef enum FFGPUType: uint8_t { FF_GPU_TYPE_NONE, // Indicates no specific GPU type. Useful as a hide filter only. FF_GPU_TYPE_UNKNOWN, // Indicates an unknown or unrecognized GPU type. FF_GPU_TYPE_INTEGRATED, FF_GPU_TYPE_DISCRETE, } FFGPUType; -typedef enum FF_A_PACKED FFGPUDetectionMethod { +typedef enum FFGPUDetectionMethod: uint8_t { FF_GPU_DETECTION_METHOD_AUTO, FF_GPU_DETECTION_METHOD_PCI, FF_GPU_DETECTION_METHOD_VULKAN, diff --git a/src/modules/localip/option.h b/src/modules/localip/option.h index 0eae2478b..ca0a1cc8f 100644 --- a/src/modules/localip/option.h +++ b/src/modules/localip/option.h @@ -2,7 +2,7 @@ #include "common/option.h" -typedef enum FF_A_PACKED FFLocalIpType { +typedef enum FFLocalIpType: uint16_t { FF_LOCALIP_TYPE_NONE, FF_LOCALIP_TYPE_LOOP_BIT = 1 << 0, FF_LOCALIP_TYPE_IPV4_BIT = 1 << 1, @@ -16,11 +16,10 @@ typedef enum FF_A_PACKED FFLocalIpType { FF_LOCALIP_TYPE_COMPACT_BIT = 1 << 10, FF_LOCALIP_TYPE_DEFAULT_ROUTE_ONLY_BIT = 1 << 11, FF_LOCALIP_TYPE_ALL_IPS_BIT = 1 << 12, - FF_LOCALIP_TYPE_FORCE_UNSIGNED = UINT16_MAX, } FFLocalIpType; static_assert(sizeof(FFLocalIpType) == sizeof(uint16_t), ""); -typedef enum FF_A_PACKED FFLocalIpIpv6Type { +typedef enum FFLocalIpIpv6Type: uint8_t { FF_LOCALIP_IPV6_TYPE_NONE = 0b00000000, FF_LOCALIP_IPV6_TYPE_GUA_BIT = 0b00000001, FF_LOCALIP_IPV6_TYPE_ULA_BIT = 0b00000010, diff --git a/src/modules/opengl/option.h b/src/modules/opengl/option.h index 869c6eca8..7b296ccde 100644 --- a/src/modules/opengl/option.h +++ b/src/modules/opengl/option.h @@ -2,7 +2,7 @@ #include "common/option.h" -typedef enum FF_A_PACKED FFOpenGLLibrary { +typedef enum FFOpenGLLibrary: uint8_t { FF_OPENGL_LIBRARY_AUTO, FF_OPENGL_LIBRARY_EGL, FF_OPENGL_LIBRARY_GLX, diff --git a/src/modules/packages/option.h b/src/modules/packages/option.h index c215593c2..a9bb444a8 100644 --- a/src/modules/packages/option.h +++ b/src/modules/packages/option.h @@ -2,7 +2,7 @@ #include "common/option.h" -typedef enum FF_A_PACKED FFPackagesFlags { +typedef enum FFPackagesFlags: uint64_t { FF_PACKAGES_FLAG_NONE = 0, FF_PACKAGES_FLAG_APK_BIT = UINT64_C(1) << 0U, FF_PACKAGES_FLAG_BREW_BIT = UINT64_C(1) << 1U, @@ -41,7 +41,6 @@ typedef enum FF_A_PACKED FFPackagesFlags { FF_PACKAGES_FLAG_CARDS_BIT = UINT64_C(1) << 34U, FF_PACKAGES_FLAG_PORG_BIT = UINT64_C(1) << 35U, FF_PACKAGES_FLAG_INSTALLRELEASE_BIT = UINT64_C(1) << 36U, - FF_PACKAGES_FLAG_FORCE_UNSIGNED = UINT64_MAX, } FFPackagesFlags; static_assert(sizeof(FFPackagesFlags) == sizeof(uint64_t), ""); diff --git a/src/modules/physicaldisk/option.h b/src/modules/physicaldisk/option.h index 00ba0138a..0b3c81855 100644 --- a/src/modules/physicaldisk/option.h +++ b/src/modules/physicaldisk/option.h @@ -2,7 +2,7 @@ #include "common/option.h" -typedef enum FF_A_PACKED FFPhysicalDiskType { +typedef enum FFPhysicalDiskType: uint8_t { FF_PHYSICALDISK_TYPE_NONE = 0, // If none is set, it's unknown @@ -17,8 +17,6 @@ typedef enum FF_A_PACKED FFPhysicalDiskType { FF_PHYSICALDISK_TYPE_READONLY = 1 << 6, FF_PHYSICALDISK_TYPE_UNUSED = 1 << 7, - - FF_PHYSICALDISK_TYPE_FORCE_UNSIGNED = UINT8_MAX, } FFPhysicalDiskType; static_assert(sizeof(FFPhysicalDiskType) == sizeof(uint8_t), ""); diff --git a/src/modules/sound/option.h b/src/modules/sound/option.h index 989256913..56e91a213 100644 --- a/src/modules/sound/option.h +++ b/src/modules/sound/option.h @@ -3,7 +3,7 @@ #include "common/option.h" #include "common/percent.h" -typedef enum FF_A_PACKED FFSoundType { +typedef enum FFSoundType: uint8_t { FF_SOUND_TYPE_NONE = 0, FF_SOUND_TYPE_MAIN = 1 << 0, FF_SOUND_TYPE_ACTIVE = 1 << 1, diff --git a/src/options/display.h b/src/options/display.h index 6017291f5..8e234b08a 100644 --- a/src/options/display.h +++ b/src/options/display.h @@ -5,26 +5,26 @@ #include "common/FFstrbuf.h" #include "common/FFlist.h" -typedef enum FF_A_PACKED FFSizeBinaryPrefixType { +typedef enum FFSizeBinaryPrefixType: uint8_t { FF_SIZE_BINARY_PREFIX_TYPE_IEC, // 1024 Bytes = 1 KiB, 1024 KiB = 1 MiB, ... (standard) FF_SIZE_BINARY_PREFIX_TYPE_SI, // 1000 Bytes = 1 kB, 1000 kB = 1 MB, ... FF_SIZE_BINARY_PREFIX_TYPE_JEDEC, // 1024 Bytes = 1 KB, 1024 KB = 1 MB, ... } FFSizeBinaryPrefixType; -typedef enum FF_A_PACKED FFTemperatureUnit { +typedef enum FFTemperatureUnit: uint8_t { FF_TEMPERATURE_UNIT_DEFAULT, FF_TEMPERATURE_UNIT_CELSIUS, FF_TEMPERATURE_UNIT_FAHRENHEIT, FF_TEMPERATURE_UNIT_KELVIN, } FFTemperatureUnit; -typedef enum FF_A_PACKED FFSpaceBeforeUnitType { +typedef enum FFSpaceBeforeUnitType: uint8_t { FF_SPACE_BEFORE_UNIT_DEFAULT, FF_SPACE_BEFORE_UNIT_ALWAYS, FF_SPACE_BEFORE_UNIT_NEVER, } FFSpaceBeforeUnitType; -typedef enum FF_A_PACKED FFFractionTrailingZerosType { +typedef enum FFFractionTrailingZerosType: uint8_t { FF_FRACTION_TRAILING_ZEROS_TYPE_DEFAULT, FF_FRACTION_TRAILING_ZEROS_TYPE_ALWAYS, FF_FRACTION_TRAILING_ZEROS_TYPE_NEVER, diff --git a/src/options/general.h b/src/options/general.h index b58d6c9e3..cf5207bae 100644 --- a/src/options/general.h +++ b/src/options/general.h @@ -2,7 +2,7 @@ #include "common/ffdata.h" -typedef enum FF_A_PACKED FFDsForceDrmType { +typedef enum FFDsForceDrmType: uint8_t { FF_DS_FORCE_DRM_TYPE_FALSE = 0, // Disable FF_DS_FORCE_DRM_TYPE_TRUE = 1, // Try `libdrm`, then `sysfs` if libdrm failed FF_DS_FORCE_DRM_TYPE_SYSFS_ONLY, // Use `/sys/class/drm` only diff --git a/src/options/logo.h b/src/options/logo.h index 7a71531d9..51d5cfbfc 100644 --- a/src/options/logo.h +++ b/src/options/logo.h @@ -5,7 +5,7 @@ #define FASTFETCH_LOGO_MAX_NAMES 9 #define FASTFETCH_LOGO_MAX_COLORS 9 // two digits would make parsing much more complicated (index 1 - 9) -typedef enum FF_A_PACKED FFLogoType { +typedef enum FFLogoType: uint8_t { FF_LOGO_TYPE_AUTO, // if something is given, first try builtin, then file. Otherwise detect logo FF_LOGO_TYPE_BUILTIN, // builtin ascii art FF_LOGO_TYPE_SMALL, // builtin ascii art, small version @@ -24,7 +24,7 @@ typedef enum FF_A_PACKED FFLogoType { FF_LOGO_TYPE_NONE, // `--logo none`, but still applies colors to the system information output (unless `--pipe` is set) } FFLogoType; -typedef enum FF_A_PACKED FFLogoPosition { +typedef enum FFLogoPosition: uint8_t { FF_LOGO_POSITION_LEFT, FF_LOGO_POSITION_TOP, FF_LOGO_POSITION_RIGHT,