Browse Source

remove redundant argument from BIT_FORMATTER_PROTO()

it doesn't need to know the enum prefix.

amends 17db5de0c & 950ebe833.
wip/socket-debug
Oswald Buddenhagen 1 year ago
parent
commit
31c504d432
  1. 6
      src/common.h

6
src/common.h

@ -212,12 +212,12 @@ void fmt_bits( uint bits, uint num_bits, const char *bit_str, const int *bit_off
#define BIT_FORMATTER_RET(name, pfx) \ #define BIT_FORMATTER_RET(name, pfx) \
struct name##_str { char str[sizeof(pfx##__STRINGS)]; }; struct name##_str { char str[sizeof(pfx##__STRINGS)]; };
#define BIT_FORMATTER_PROTO(name, pfx, storage) \ #define BIT_FORMATTER_PROTO(name, storage) \
storage struct name##_str ATTR_OPTIMIZE /* force RVO */ \ storage struct name##_str ATTR_OPTIMIZE /* force RVO */ \
fmt_##name( uint bits ) fmt_##name( uint bits )
#define BIT_FORMATTER_IMPL(name, pfx, storage) \ #define BIT_FORMATTER_IMPL(name, pfx, storage) \
BIT_FORMATTER_PROTO(name, pfx, storage) \ BIT_FORMATTER_PROTO(name, storage) \
{ \ { \
static const char strings[] = pfx##__STRINGS; \ static const char strings[] = pfx##__STRINGS; \
static const int offsets[] = { pfx##__OFFSETS }; \ static const int offsets[] = { pfx##__OFFSETS }; \
@ -233,7 +233,7 @@ void fmt_bits( uint bits, uint num_bits, const char *bit_str, const int *bit_off
#define DECL_BIT_FORMATTER_FUNCTION(name, pfx) \ #define DECL_BIT_FORMATTER_FUNCTION(name, pfx) \
BIT_FORMATTER_RET(name, pfx) \ BIT_FORMATTER_RET(name, pfx) \
BIT_FORMATTER_PROTO(name, pfx, ); BIT_FORMATTER_PROTO(name, );
#define DEF_BIT_FORMATTER_FUNCTION(name, pfx) \ #define DEF_BIT_FORMATTER_FUNCTION(name, pfx) \
BIT_FORMATTER_IMPL(name, pfx, ) BIT_FORMATTER_IMPL(name, pfx, )

Loading…
Cancel
Save