Bug 993 - MinstrelWifiManager::UpdateStats useless if clause
MinstrelWifiManager::UpdateStats useless if clause
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: wifi
ns-3-dev
All All
: P5 trivial
Assigned To: Nicola Baldo
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-16 00:28 EDT by Quincy Tse
Modified: 2010-10-26 08:14 EDT (History)
1 user (show)

See Also:


Attachments
Proposed pa (446 bytes, patch)
2010-09-16 00:30 EDT, Quincy Tse
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Quincy Tse 2010-09-16 00:28:38 EDT
../src/devices/wifi/minstrel-wifi-manager.cc:528:42: error:
      comparison of unsigned expression < 0 is always false
      [-Wtautological-compare]
          if (idx >= m_nsupported || idx < 0)
                                     ~~~ ^ ~

Here, idx is declared as uint32_t, and can never be <0. Hence the idx < 0 clause can be safely removed.
Comment 1 Quincy Tse 2010-09-16 00:30:32 EDT
Created attachment 975 [details]
Proposed pa
Comment 2 Nicola Baldo 2010-09-16 04:34:29 EDT
Quincy, thank you for this bug report and patch. Feel free to push it to ns-3-dev if you have commit privileges, otherwise just let me know and I'll do it.
Comment 3 Quincy Tse 2010-09-16 21:41:21 EDT
Can you please push it?
Comment 4 Nicola Baldo 2010-10-26 08:14:24 EDT
changeset:   6645:b89ac19713c6