summaryrefslogtreecommitdiff
path: root/wiretap
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-08-10 21:34:15 +0000
committerGuy Harris <guy@alum.mit.edu>2013-08-10 21:34:15 +0000
commit84239c0c064b521aa172ed828139f9206e109c5e (patch)
treed74afc4105ee50995c411548b082acee574dd383 /wiretap
parent05739c8f1578edd7c17ac7698cb5e0bfd936efe3 (diff)
downloadwireshark-84239c0c064b521aa172ed828139f9206e109c5e.tar.gz
Initialize float variables with float constants, not double constants,
and assign float constants, not double constants, to float variables. Floating-point constants are double by default; you have to add "f" to the end to make them float. This squelches 64-bit-to-32-bit warnings. svn path=/trunk/; revision=51289
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/vwr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/wiretap/vwr.c b/wiretap/vwr.c
index 791c9ae204..ae36f84e99 100644
--- a/wiretap/vwr.c
+++ b/wiretap/vwr.c
@@ -2083,7 +2083,7 @@ guint64 get_signature_ts(guint8 *m_ptr,int sig_off)
static float getRate( guint8 plcpType, guint8 mcsIndex, guint16 rflags, guint8 nss )
{
/* Rate conversion data */
- float canonical_rate_legacy[] = {1.0, 2.0, 5.5, 11.0, 6.0, 9.0, 12.0, 18.0, 24.0, 36.0, 48.0, 54.0};
+ float canonical_rate_legacy[] = {1.0f, 2.0f, 5.5f, 11.0f, 6.0f, 9.0f, 12.0f, 18.0f, 24.0f, 36.0f, 48.0f, 54.0f};
int canonical_ndbps_20_ht[] = {26, 52, 78, 104, 156, 208, 234, 260};
int canonical_ndbps_40_ht[] = {54, 108, 162, 216, 324, 432, 486, 540};
@@ -2093,16 +2093,16 @@ static float getRate( guint8 plcpType, guint8 mcsIndex, guint16 rflags, guint8 n
int canonical_ndbps_80_vht[] = {117, 234, 351, 468, 702, 936, 1053, 1170, 1404, 1560};
int ndbps;
- float symbol_tx_time, bitrate = 0.0;
+ float symbol_tx_time, bitrate = 0.0f;
if (plcpType == 0)
bitrate = canonical_rate_legacy[mcsIndex];
else if (plcpType == 1 || plcpType == 2)
{
if ( rflags & IEEE80211_RADIOTAP_F_SHORTGI)
- symbol_tx_time = (float)3.6;
+ symbol_tx_time = 3.6f;
else
- symbol_tx_time = (float)4.0;
+ symbol_tx_time = 4.0f;
if ( rflags & IEEE80211_RADIOTAP_F_40MHZ )
ndbps = canonical_ndbps_40_ht[ mcsIndex - 8*(int)(mcsIndex/8) ];
@@ -2114,9 +2114,9 @@ static float getRate( guint8 plcpType, guint8 mcsIndex, guint16 rflags, guint8 n
else
{
if ( rflags & IEEE80211_RADIOTAP_F_SHORTGI)
- symbol_tx_time = (float)3.6;
+ symbol_tx_time = 3.6f;
else
- symbol_tx_time = (float)4.0;
+ symbol_tx_time = 4.0f;
/* Check for the out of range mcsIndex. Should never happen, but if mcs index is greater than 9 assume 9 is the value */
if (mcsIndex > 9) mcsIndex = 9;