From: Alan T. DeKok Date: Thu, 8 Aug 2019 17:26:46 +0000 (-0400) Subject: use macros to simplify / standardize logic X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c07cd6f0480ddf8bf0f0b4e16bb879968b79e778;p=thirdparty%2Ffreeradius-server.git use macros to simplify / standardize logic --- diff --git a/src/lib/util/dict.c b/src/lib/util/dict.c index 2b6980dca65..fc081713927 100644 --- a/src/lib/util/dict.c +++ b/src/lib/util/dict.c @@ -630,7 +630,8 @@ static bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent, if (flags->extra) { switch (type) { case FR_TYPE_EXTENDED: - if ((all_flags & ~shift_extra) != 0) { + ALLOW_FLAG(extra); + if (all_flags) { fr_strerror_printf("The 'long' flag cannot be used with any other flags."); return false; } @@ -639,7 +640,8 @@ static bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent, case FR_TYPE_UINT8: case FR_TYPE_UINT16: case FR_TYPE_UINT32: - if ((all_flags & ~shift_extra) != 0) { + ALLOW_FLAG(extra); + if (all_flags) { fr_strerror_printf("The 'key' flag cannot be used with any other flags."); return false; }