From 9d49ab79a47438ed6125394371f29e167dcb005f Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 29 Apr 2017 20:35:23 -0700 Subject: Boolean bitfields don't need a mask, just a bit. You don't have to and the bitfield container with a mask and compare it against the bit, you can just test the bit, which is a pretty standard C idiom. Change-Id: I87b3d84f802114199fb93357358412c623199ca2 Reviewed-on: https://code.wireshark.org/review/21422 Reviewed-by: Guy Harris --- wiretap/vwr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'wiretap/vwr.c') diff --git a/wiretap/vwr.c b/wiretap/vwr.c index fee2b82833..716f6af0c0 100644 --- a/wiretap/vwr.c +++ b/wiretap/vwr.c @@ -501,7 +501,6 @@ #define vVW510021_W_QOS_VALID 0x4000 #define vVW510021_W_HT_VALID 0x2000 #define vVW510021_W_L4ID_VALID 0x1000 -#define vVW510021_W_PREAMBLE_MASK 0x40 /* short/long preamble/guard(ofdm) mask */ #define vVW510021_W_MCS_MASK 0x3f /* mcs index (a/b) type mask */ #define vVW510021_W_MOD_SCHEME_MASK 0x3f /* modulation type mask */ #define vVW510021_W_PLCPC_MASK 0x03 /* PLPCP type mask */ @@ -1708,7 +1707,7 @@ static gboolean vwr_read_s2_W_rec(vwr_t *vwr, struct wtap_pkthdr *phdr, bytes_written += 2; if (info & vVW510021_W_IS_WEP) radioflags |= FLAGS_WEP; - if ((l1p_1 & vVW510021_W_PREAMBLE_MASK) != vVW510021_W_IS_LONGPREAMBLE && (plcp_type == vVW510021_W_PLCP_LEGACY)) + if (!(l1p_1 & vVW510021_W_IS_LONGPREAMBLE) && (plcp_type == vVW510021_W_PLCP_LEGACY)) radioflags |= FLAGS_SHORTPRE; phtoles(&data_ptr[bytes_written], radioflags); bytes_written += 2; @@ -1973,7 +1972,7 @@ static gboolean vwr_read_s3_W_rec(vwr_t *vwr, struct wtap_pkthdr *phdr, } if (info & vVW510021_W_IS_WEP) radioflags |= FLAGS_WEP; - if ((l1p_1 & vVW510021_W_PREAMBLE_MASK) != vVW510021_W_IS_LONGPREAMBLE && (plcp_type == vVW510021_W_PLCP_LEGACY)) + if (!(l1p_1 & vVW510021_W_IS_LONGPREAMBLE) && (plcp_type == vVW510021_W_PLCP_LEGACY)) radioflags |= FLAGS_SHORTPRE; phyRate = (guint16)(getRate(plcp_type, mcs_index, radioflags, nss) * 10); -- cgit v1.2.3