mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-05 04:34:19 +01:00
Global: pack all enums and make flag enums unsigned
This commit is contained in:
@@ -122,6 +122,8 @@ void ffGenerateDNSJsonConfig(FFDNSOptions* options, yyjson_mut_doc* doc, yyjson_
|
||||
|
||||
if (defaultOptions.showType != options->showType)
|
||||
{
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wswitch" // FF_DNS_TYPE_FORCE_UNSIGNED
|
||||
switch (options->showType)
|
||||
{
|
||||
case FF_DNS_TYPE_IPV4_BIT:
|
||||
@@ -134,6 +136,7 @@ void ffGenerateDNSJsonConfig(FFDNSOptions* options, yyjson_mut_doc* doc, yyjson_
|
||||
yyjson_mut_obj_add_str(doc, module, "showType", "both");
|
||||
break;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
|
||||
#include "common/option.h"
|
||||
|
||||
typedef enum FFDNSShowType {
|
||||
typedef enum __attribute__((__packed__)) FFDNSShowType {
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user