summaryrefslogtreecommitdiff
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-04-29 20:35:23 -0700
committerGuy Harris <guy@alum.mit.edu>2017-04-30 03:39:24 +0000
commit9d49ab79a47438ed6125394371f29e167dcb005f (patch)
tree60252777d0170baac496f14547cdcefc11f74fee /wiretap
parentdb2746a5f05f3e451e2f4244ddfb159174b153e5 (diff)
downloadwireshark-9d49ab79a47438ed6125394371f29e167dcb005f.tar.gz
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 <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/vwr.c5
1 files changed, 2 insertions, 3 deletions
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);