aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-radiotap.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2011-04-28 19:00:28 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2011-04-28 19:00:28 +0000
commitcb539a4adac562d2661561c005b328eb4477a18c (patch)
treed9a37c128c4efd1e054e618d333890aac7d73d62 /epan/dissectors/packet-radiotap.c
parent00199cf2d9824ded1d048a5da245e96f7ec2fe9b (diff)
Array indices are integers, not Booleans. (The code is the same, given
that TRUE is #defined as 1 and FALSE is #defined as 0, but let's not depend on that.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36942 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-radiotap.c')
-rw-r--r--epan/dissectors/packet-radiotap.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/epan/dissectors/packet-radiotap.c b/epan/dissectors/packet-radiotap.c
index cca9cc38f3..e21a7e7d21 100644
--- a/epan/dissectors/packet-radiotap.c
+++ b/epan/dissectors/packet-radiotap.c
@@ -1937,8 +1937,8 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
proto_tree *mcs_tree = NULL, *mcs_known_tree;
guint8 mcs_known, mcs_flags;
guint8 mcs;
- gboolean ht;
- gboolean short_gi;
+ guint bandwidth;
+ guint gi_length;
gboolean can_calculate_rate;
/*
@@ -1971,22 +1971,23 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
if (mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_BW) {
- ht = ((mcs_flags & IEEE80211_RADIOTAP_MCS_BW_MASK) == IEEE80211_RADIOTAP_MCS_BW_40) ?
- TRUE : FALSE;
+ bandwidth = ((mcs_flags & IEEE80211_RADIOTAP_MCS_BW_MASK) == IEEE80211_RADIOTAP_MCS_BW_40) ?
+ 1 : 0;
if (mcs_tree)
proto_tree_add_uint(mcs_tree, hf_radiotap_mcs_bw,
tvb, offset + 1, 1, mcs_flags);
} else {
- ht = FALSE;
+ bandwidth = 0;
can_calculate_rate = FALSE; /* no bandwidth */
}
if (mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_GI) {
- short_gi = (mcs_flags & IEEE80211_RADIOTAP_MCS_SGI) ? TRUE : FALSE;
+ gi_length = (mcs_flags & IEEE80211_RADIOTAP_MCS_SGI) ?
+ 1 : 0;
if (mcs_tree)
proto_tree_add_uint(mcs_tree, hf_radiotap_mcs_gi,
tvb, offset + 1, 1, mcs_flags);
} else {
- short_gi = FALSE;
+ gi_length = 0;
can_calculate_rate = FALSE; /* no GI width */
}
if (mcs_known & IEEE80211_RADIOTAP_MCS_HAVE_FMT) {
@@ -2015,16 +2016,16 @@ dissect_radiotap(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
* 802.11n doesn't support.)
*/
if (can_calculate_rate && mcs <= MAX_MCS_INDEX
- && ieee80211_float_htrates[mcs][ht][short_gi] != 0.0) {
+ && ieee80211_float_htrates[mcs][bandwidth][gi_length] != 0.0) {
col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%.1f",
- ieee80211_float_htrates[mcs][ht][short_gi]);
+ ieee80211_float_htrates[mcs][bandwidth][gi_length]);
if (tree) {
proto_tree_add_float_format(radiotap_tree,
hf_radiotap_datarate,
tvb, offset, 1,
- ieee80211_float_htrates[mcs][ht][short_gi],
+ ieee80211_float_htrates[mcs][bandwidth][gi_length],
"Data Rate: %.1f Mb/s",
- ieee80211_float_htrates[mcs][ht][short_gi]);
+ ieee80211_float_htrates[mcs][bandwidth][gi_length]);
}
}
break;