]> git.ipfire.org Git - thirdparty/lldpd.git/commit - NEWS
lib: introduce proper fixed point parsing and representation module
authorVincent Bernat <bernat@luffy.cx>
Wed, 24 Jul 2013 20:20:50 +0000 (22:20 +0200)
committerVincent Bernat <bernat@luffy.cx>
Wed, 24 Jul 2013 20:21:58 +0000 (22:21 +0200)
commitf730f6c5f6488be68fef5dbee01677b9cf8194ac
tree80753fe827883cdb8db4ebe86563c1a1d52a21c0
parentd2c04230fb3a71e2a464c8c608b5d3f4d00b618b
lib: introduce proper fixed point parsing and representation module

This additional modules isolates the complexity of parsing and
representing fixed point numbers. This is uses for coordinates in
LLDP-MED.

The previous version was using an incorrect precision. When parsing
user input, the precision is now derivated from the number of digits
provided. When displaying a value, the precision is used to add
additional 0 if needed.

Moreover, the previous version was a bit buggy with some values and
with negative numbers. This change contains unittest to tackle most
issues.

It relies on presence of __builtin_clzll() function, available in GCC
and others. Maybe this will become a portability issue.

This closes #41.
NEWS
src/lib/Makefile.am
src/lib/atom-private.c
src/lib/fixedpoint.c [new file with mode: 0644]
src/lib/fixedpoint.h [new file with mode: 0644]
tests/Makefile.am
tests/check_fixedpoint.c [new file with mode: 0644]