ftypes: Add FT_UINT_STRING to IS_FT_STRING() macro

This commit is contained in:
João Valverde 2022-06-20 20:35:47 +01:00
parent e42a4de47c
commit cbd3c44776
2 changed files with 10 additions and 5 deletions

View File

@ -629,8 +629,7 @@ fvalue_set_time(fvalue_t *fv, const nstime_t *value)
void void
fvalue_set_string(fvalue_t *fv, const gchar *value) fvalue_set_string(fvalue_t *fv, const gchar *value)
{ {
ws_assert(IS_FT_STRING(fv->ftype->ftype) || ws_assert(IS_FT_STRING(fv->ftype->ftype));
fv->ftype->ftype == FT_UINT_STRING);
ws_assert(fv->ftype->set_value.set_value_string); ws_assert(fv->ftype->set_value.set_value_string);
fv->ftype->set_value.set_value_string(fv, value); fv->ftype->set_value.set_value_string(fv, value);
} }
@ -740,8 +739,7 @@ fvalue_get_time(fvalue_t *fv)
const char * const char *
fvalue_get_string(fvalue_t *fv) fvalue_get_string(fvalue_t *fv)
{ {
ws_assert(IS_FT_STRING(fv->ftype->ftype) || ws_assert(IS_FT_STRING(fv->ftype->ftype));
fv->ftype->ftype == FT_UINT_STRING);
ws_assert(fv->ftype->get_value.get_value_string); ws_assert(fv->ftype->get_value.get_value_string);
return fv->ftype->get_value.get_value_string(fv); return fv->ftype->get_value.get_value_string(fv);
} }

View File

@ -77,12 +77,15 @@ enum ftenum {
(ft) == FT_INT16 || \ (ft) == FT_INT16 || \
(ft) == FT_INT24 || \ (ft) == FT_INT24 || \
(ft) == FT_INT32) (ft) == FT_INT32)
#define IS_FT_INT64(ft) \ #define IS_FT_INT64(ft) \
((ft) == FT_INT40 || \ ((ft) == FT_INT40 || \
(ft) == FT_INT48 || \ (ft) == FT_INT48 || \
(ft) == FT_INT56 || \ (ft) == FT_INT56 || \
(ft) == FT_INT64) (ft) == FT_INT64)
#define IS_FT_INT(ft) (IS_FT_INT32(ft) || IS_FT_INT64(ft)) #define IS_FT_INT(ft) (IS_FT_INT32(ft) || IS_FT_INT64(ft))
#define IS_FT_UINT32(ft) \ #define IS_FT_UINT32(ft) \
((ft) == FT_CHAR || \ ((ft) == FT_CHAR || \
(ft) == FT_UINT8 || \ (ft) == FT_UINT8 || \
@ -90,17 +93,21 @@ enum ftenum {
(ft) == FT_UINT24 || \ (ft) == FT_UINT24 || \
(ft) == FT_UINT32 || \ (ft) == FT_UINT32 || \
(ft) == FT_FRAMENUM) (ft) == FT_FRAMENUM)
#define IS_FT_UINT64(ft) \ #define IS_FT_UINT64(ft) \
((ft) == FT_UINT40 || \ ((ft) == FT_UINT40 || \
(ft) == FT_UINT48 || \ (ft) == FT_UINT48 || \
(ft) == FT_UINT56 || \ (ft) == FT_UINT56 || \
(ft) == FT_UINT64) (ft) == FT_UINT64)
#define IS_FT_UINT(ft) (IS_FT_UINT32(ft) || IS_FT_UINT64(ft)) #define IS_FT_UINT(ft) (IS_FT_UINT32(ft) || IS_FT_UINT64(ft))
#define IS_FT_TIME(ft) \ #define IS_FT_TIME(ft) \
((ft) == FT_ABSOLUTE_TIME || (ft) == FT_RELATIVE_TIME) ((ft) == FT_ABSOLUTE_TIME || (ft) == FT_RELATIVE_TIME)
#define IS_FT_STRING(ft) \ #define IS_FT_STRING(ft) \
((ft) == FT_STRING || (ft) == FT_STRINGZ || (ft) == FT_STRINGZPAD || \ ((ft) == FT_STRING || (ft) == FT_STRINGZ || (ft) == FT_STRINGZPAD || \
(ft) == FT_STRINGZTRUNC) (ft) == FT_STRINGZTRUNC || (ft) == FT_UINT_STRING)
/* field types lengths */ /* field types lengths */
#define FT_ETHER_LEN 6 #define FT_ETHER_LEN 6