From e0babef797d56b4283b264cf779d2afcdb5956d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Sun, 2 Sep 2018 16:58:06 +0100 Subject: epan: add more IS_FT_* macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The existing macros retain their value. Change-Id: I55ab0113792edc2bb28e4ef4424669e092d811fa Reviewed-on: https://code.wireshark.org/review/29400 Petri-Dish: João Valverde Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin Reviewed-by: João Valverde --- epan/ftypes/ftypes.h | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'epan/ftypes') diff --git a/epan/ftypes/ftypes.h b/epan/ftypes/ftypes.h index 801bb76735..631e7c98d3 100644 --- a/epan/ftypes/ftypes.h +++ b/epan/ftypes/ftypes.h @@ -71,11 +71,34 @@ enum ftenum { FT_NUM_TYPES /* last item number plus one */ }; -#define IS_FT_INT(ft) ((ft)==FT_INT8||(ft)==FT_INT16||(ft)==FT_INT24||(ft)==FT_INT32||(ft)==FT_INT40||(ft)==FT_INT48||(ft)==FT_INT56||(ft)==FT_INT64) -#define IS_FT_UINT32(ft) ((ft)==FT_CHAR||(ft)==FT_UINT8||(ft)==FT_UINT16||(ft)==FT_UINT24||(ft)==FT_UINT32||(ft)==FT_FRAMENUM) -#define IS_FT_UINT(ft) ((ft)==FT_CHAR||(ft)==FT_UINT8||(ft)==FT_UINT16||(ft)==FT_UINT24||(ft)==FT_UINT32||(ft)==FT_UINT40||(ft)==FT_UINT48||(ft)==FT_UINT56||(ft)==FT_UINT64||(ft)==FT_FRAMENUM) -#define IS_FT_TIME(ft) ((ft)==FT_ABSOLUTE_TIME||(ft)==FT_RELATIVE_TIME) -#define IS_FT_STRING(ft) ((ft)==FT_STRING||(ft)==FT_STRINGZ||(ft)==FT_STRINGZPAD) +#define IS_FT_INT32(ft) \ + ((ft) == FT_INT8 || \ + (ft) == FT_INT16 || \ + (ft) == FT_INT24 || \ + (ft) == FT_INT32) +#define IS_FT_INT64(ft) \ + ((ft) == FT_INT40 || \ + (ft) == FT_INT48 || \ + (ft) == FT_INT56 || \ + (ft) == FT_INT64) +#define IS_FT_INT(ft) (IS_FT_INT32(ft) || IS_FT_INT64(ft)) +#define IS_FT_UINT32(ft) \ + ((ft) == FT_CHAR || \ + (ft) == FT_UINT8 || \ + (ft) == FT_UINT16 || \ + (ft) == FT_UINT24 || \ + (ft) == FT_UINT32 || \ + (ft) == FT_FRAMENUM) +#define IS_FT_UINT64(ft) \ + ((ft) == FT_UINT40 || \ + (ft) == FT_UINT48 || \ + (ft) == FT_UINT56 || \ + (ft) == FT_UINT64) +#define IS_FT_UINT(ft) (IS_FT_UINT32(ft) || IS_FT_UINT64(ft)) +#define IS_FT_TIME(ft) \ + ((ft) == FT_ABSOLUTE_TIME || (ft) == FT_RELATIVE_TIME) +#define IS_FT_STRING(ft) \ + ((ft) == FT_STRING || (ft) == FT_STRINGZ || (ft) == FT_STRINGZPAD) /* field types lengths */ #define FT_ETHER_LEN 6 -- cgit v1.2.3