Global: pack all enums and make flag enums unsigned

This commit is contained in:
李通洲
2024-11-14 10:04:57 +08:00
parent e821a99873
commit 97e1b987dd
54 changed files with 100 additions and 73 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
#if defined(FF_HAVE_IMAGEMAGICK7) || defined(FF_HAVE_IMAGEMAGICK6)
typedef enum FFLogoImageResult
typedef enum __attribute__((__packed__)) FFLogoImageResult
{
FF_LOGO_IMAGE_RESULT_SUCCESS, //Logo printed
FF_LOGO_IMAGE_RESULT_INIT_ERROR, //Failed to load library, try again with next IM version
+1 -1
View File
@@ -9,7 +9,7 @@
#include <ctype.h>
#include <string.h>
typedef enum FFLogoSize
typedef enum __attribute__((__packed__)) FFLogoSize
{
FF_LOGO_SIZE_UNKNOWN,
FF_LOGO_SIZE_NORMAL,
+2 -1
View File
@@ -2,11 +2,12 @@
#include "fastfetch.h"
typedef enum FFLogoLineType
typedef enum __attribute__((__packed__)) FFLogoLineType
{
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 struct FFlogo