From f019f09a2246863f34554d13841051025161eb40 Mon Sep 17 00:00:00 2001 From: Nick Chambers Date: Sun, 19 Jun 2022 11:04:51 -0500 Subject: [PATCH] Fix the location of the option types --- include/gargoyle/codex.h | 10 ++++++++-- include/gargoyle/sleuth.h | 8 +------- src/sleuth.c | 1 + 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/gargoyle/codex.h b/include/gargoyle/codex.h index 0a12102..e5ecd01 100644 --- a/include/gargoyle/codex.h +++ b/include/gargoyle/codex.h @@ -3,7 +3,13 @@ #include -const uint8_t GARGOYLE_ERR_SUCCESS = 0; -const uint8_t GARGOYLE_ERR_UNKNOWN_OPT = 1; +static const uint8_t GARGOYLE_TYPE_UINT = 1 << 0; +static const uint8_t GARGOYLE_TYPE_BOOL = 1 << 1; +static const uint8_t GARGOYLE_TYPE_FILE = 1 << 2; +static const uint8_t GARGOYLE_TYPE_ROPE = 1 << 3; +static const uint8_t GARGOYLE_TYPE_DBLE = 1 << 4; + +static const uint8_t GARGOYLE_ERR_SUCCESS = 0; +static const uint8_t GARGOYLE_ERR_UNKNOWN_OPT = 1; #endif diff --git a/include/gargoyle/sleuth.h b/include/gargoyle/sleuth.h index 8186f56..2de4c7e 100644 --- a/include/gargoyle/sleuth.h +++ b/include/gargoyle/sleuth.h @@ -3,12 +3,6 @@ #include -static const uint8_t GARGOYLE_TYPE_UINT = 1 << 0; -static const uint8_t GARGOYLE_TYPE_BOOL = 1 << 1; -static const uint8_t GARGOYLE_TYPE_FILE = 1 << 2; -static const uint8_t GARGOYLE_TYPE_ROPE = 1 << 3; -static const uint8_t GARGOYLE_TYPE_DBLE = 1 << 4; - struct gargoyle_opt { const char *brand; uint16_t brand_sz; @@ -19,7 +13,7 @@ struct gargoyle_opt { }; #define GARGOYLE_MK_OPT(brand) brand, (sizeof(brand) - 1) -#define GARGOYLE_EZ_OPT(brand, val) brand, (sizeof(brand) - 1), 0[brand] /* >:) */, &val, sizeof(val) +#define GARGOYLE_EZ_OPT(brand, val) brand, (sizeof(brand) - 1), 0[brand], &val, sizeof(val) struct gargoyle_opt *gargoyle_find_brand(uint16_t optc, struct gargoyle_opt *optv, const char *brand); struct gargoyle_opt *gargoyle_find_emblem(uint16_t optc, struct gargoyle_opt *optv, const char emblem); diff --git a/src/sleuth.c b/src/sleuth.c index 10337a2..8666409 100644 --- a/src/sleuth.c +++ b/src/sleuth.c @@ -1,3 +1,4 @@ +#include #include #include #include