Fixed clang-3.4 unused function warnings in optimized builds like the following:
"""
../examples/energy/energy-model-example.cc:39:1: error: unused function
'PrintReceivedPacket' [-Werror,-Wunused-function]
PrintReceivedPacket (Address& from)
^
1 error generated.
"""
Implemented "if (false)" trick inside NS_LOG* macros for optimized builds.
"sizeof()" trick might be a little better but it produces the following
warning with clang-3.4:
"""
../examples/energy/energy-model-example.cc:39:1: error: function
'PrintReceivedPacket' is not needed and will not be emitted
[-Werror,-Wunneeded-internal-declaration]
PrintReceivedPacket (Address& from)
^
1 error generated.
"""
Macros from log.h, that depend on NS3_LOG_ENABLE, were moved to log-macros-enabled.h and log-macros-disabled.h to make log.h smaller.
This should prevent possible name collisions, clean up ns3 namespace a little
and allow compiler to place them in a sharable read-only data section.
Also make various global variables static not to pollute ns3 namespace and to
force use of Attribute framework where appropriate.
Arithmetic with fractions was never tested and it had lots of bugs.
This patch set:
- Defines many more tests, giving complete coverage of all operations
(signed/unsigned, integer, fractions, mixed)
- Replaces over-generous #define creation of functions with minimal
set of C++ functions.
- Minimizes differences between implementations.
- Documents all functions.
int128 and cairo implementations agree exactly on all int64x64 tests,
and pass all ns-3 tests.
long double implementation agrees with the other two on most int64x64
tests; failures have to do with less precision in long doubles.
The prior double implementation failed five ns-3 tests:
devices-mesh-dot11s-regression
devices-mesh-flame-regression
int64x64
routing-aodv-regression
routing-olsr-regression
This implementation fails routing-olsr-regression because of single
bit differences in the pcap files.