Bug 1103 - Useless assignment in omnet-data-output.cc
Useless assignment in omnet-data-output.cc
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: general
ns-3-dev
All All
: P5 trivial
Assigned To: Mitch Watrous
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-18 03:45 UTC by Quincy Tse
Modified: 2011-05-13 16:46 UTC (History)
1 user (show)

See Also:


Attachments
Patch that silents both unused variable and useless assignment warnings. (800 bytes, patch)
2011-04-18 03:45 UTC, Quincy Tse
Details | Diff
Updated patch (1.09 KB, patch)
2011-04-18 03:56 UTC, Quincy Tse
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Quincy Tse 2011-04-18 03:45:39 UTC
Created attachment 1081 [details]
Patch that silents both unused variable and useless assignment warnings.

src/stats/model/omnet-data-output.cc, in the function isNumeric, contains "useless" assignment (to silent compiler warning regarding unused variable). This causes warnings when the compiler is set to check for useless assignments.

Attached patch uses different code that avoids the use of this variable, and is slightly more verbose, but may not cover the entire range of inputs.
Comment 1 Quincy Tse 2011-04-18 03:56:41 UTC
Created attachment 1082 [details]
Updated patch

Patched code now recognises the following number format:

[-][\d]*[.[\d]*][e[-][\d]*[.[\d]*]]

(note - will accept "-", ".", "e" , "e.", etc as well)
Comment 2 Mitch Watrous 2011-05-13 16:46:39 UTC
Bug closed.

ns-3-dev changeset: 4e1d562d5029