From Sven-Ola Tuecke <sven-ola@gmx.de>: add support for fixedpoint math
Fixed point math replaces floating point calculations by integer counterparts.
The 20 higher bits of a typical 32 bit hold the digits before the decimal
point > 1.0, the lower 12 bits hold the digits after the decimal point. An
old trick, e.g. used in gaming to speed up calculations, because long (+-*/)
long is always faster than float (+-*/). Of course, all calculations and
automatic number conversions have to be found and adpated.
To help in debugging, added and #ifdef USE_FPM to toggle betwenn FPM and
normal maths. One can remove that at a later stage if we are sure it works
correct. For this, I added CPPFLAGS+=USE_FPM to the central Makefile.inc.
Also critical: When using 20+12 bits, one have to check for overflows and
underflows. This is done by a number of assert() statements active only if
you compile with "make DEBUG=1". The olsrd compiled in this way will of
course save no CPU cycles.
27 files changed: