Do as much of the arithmetic in integers as possible.
Convert both parts to final units(msec) and add.
The casts are actually unneeded, but show when the conversions are done.
And drop an unreachable break.
Making these functions static also reduces the possibilities of
collisions with app names and may shorten load time.
And I can finally make meter_type1 and meter_type2 const, like I
tried to do in the beginning.
Compile-tested with commit 8ea3f0e (tag: 3.4.10)
from https://github.com/osmocom/libusrp
Fixes:
usrp_impl.cc:33:10: fatal error: usrp_standard.h: No such file or directory
usrp_impl.cc:49:63: error: expected '(' before 'malloc'
usrp_impl.cc:49:100: error: expected ')' before ';' token
usrp_impl.cc:72:39: error: invalid 'static_cast' from type 'rig_state*' to type 'usrp_priv_data*'
usrp_impl.cc:86:39: error: invalid 'static_cast' from type 'rig_state*' to type 'usrp_priv_data*'
usrp_impl.cc:104:39: error: invalid 'static_cast' from type 'rig_state*' to type 'usrp_priv_data*'
usrp_impl.cc:129:45: error: invalid 'static_cast' from type 'rig_state*' to type 'usrp_priv_data*'
usrp_impl.cc:151:45: error: invalid 'static_cast' from type 'rig_state*' to type 'usrp_priv_data*'
usrp_impl.cc:169:45: error: invalid 'static_cast' from type 'rig_state*' to type 'usrp_priv_data*'
usrp_impl.cc:114:37: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
usrp_impl.cc:139:38: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
/usr/bin/ld: ../src/.libs/libhamlib.so: undefined reference to `usrp_caps'
If pkg-config has found tcl.pc, then tclConfig.sh is not executed
and $TCL_INCLUDE_SPEC is empty so the test for tcl.h fails.
This patch moves the test inside the "else" case where the variable
is always defined.
The is a bug exposed by the fact that --with-xml-support redefines
the macro PKG_CHECK_MODULES.
Fix verified moving aside /usr/lib/x86_64-linux-gnu/pkgconfig/tcl.pc
Fixes:
configure: error: Unable to find Tcl headers