Commit is longer than expected, because a few of the callers
were converted to use depth_t instead of int.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Also un-inline it. There seems no reason for exporting the
implementation details in the header file.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
No point in this being a macro. Make it return a depth_t - it
was unclear that this returns a depth in mm.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
We had a pattern where doubles were converted to long with
lrint() and then down-cast to a narrower int type.
Because this is unwieldy, introduce a function encapsulating
this.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This gives the distance between to location_t objects. It is
unclear why this was in divesite.cpp.
Moreover pass by value, not raw pointer.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Convert both files simultanously, because the SI_UNITS define works
either under C or under C++.
This was painful, because initialization of struct-members has to
be done in order of definition in C++. And it was completely out
of order. However, as long as not all is C++, we can't use
default initialization directly in the struct definition. :(
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>