diff options
author | Michael Dickens <mlk@alum.mit.edu> | 2018-12-06 13:17:06 -0500 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2018-12-12 19:23:21 -0800 |
commit | eac84f1b7f3b652bc46a1370c8f68aa5b2477330 (patch) | |
tree | eff83a226bcec0d0725cd238d9f76826060f7916 /host/lib/usrp/gpsd_iface.cpp | |
parent | 865151108279e1b3cb25d288335d76dc3eef7e4e (diff) | |
download | uhd-eac84f1b7f3b652bc46a1370c8f68aa5b2477330.tar.gz uhd-eac84f1b7f3b652bc46a1370c8f68aa5b2477330.tar.bz2 uhd-eac84f1b7f3b652bc46a1370c8f68aa5b2477330.zip |
various: use "std::abs" instead of "std::fabs"
+ better compiler compatibility
+ let the compiler figure out the actual function IO signature that
makes sense, instead of forcing float.
Diffstat (limited to 'host/lib/usrp/gpsd_iface.cpp')
-rw-r--r-- | host/lib/usrp/gpsd_iface.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/host/lib/usrp/gpsd_iface.cpp b/host/lib/usrp/gpsd_iface.cpp index b34132fa0..1858a6a24 100644 --- a/host/lib/usrp/gpsd_iface.cpp +++ b/host/lib/usrp/gpsd_iface.cpp @@ -210,9 +210,9 @@ private: // member functions % tm.tm_min % tm.tm_sec % (_gps_data.status ? 'A' : 'V') - % _zeroize(_deg_to_dm(std::fabs(_gps_data.fix.latitude))) + % _zeroize(_deg_to_dm(std::abs(_gps_data.fix.latitude))) % ((_gps_data.fix.latitude > 0) ? 'N' : 'S') - % _zeroize(_deg_to_dm(std::fabs(_gps_data.fix.longitude))) + % _zeroize(_deg_to_dm(std::abs(_gps_data.fix.longitude))) % ((_gps_data.fix.longitude > 0) ? 'E' : 'W') % _zeroize(_gps_data.fix.speed * MPS_TO_KNOTS) % _zeroize(_gps_data.fix.track) @@ -242,9 +242,9 @@ private: // member functions % tm.tm_hour % tm.tm_min % tm.tm_sec - % _deg_to_dm(std::fabs(_gps_data.fix.latitude)) + % _deg_to_dm(std::abs(_gps_data.fix.latitude)) % ((_gps_data.fix.latitude > 0) ? 'N' : 'S') - % _deg_to_dm(std::fabs(_gps_data.fix.longitude)) + % _deg_to_dm(std::abs(_gps_data.fix.longitude)) % ((_gps_data.fix.longitude > 0) ? 'E' : 'W') % _gps_data.status % _gps_data.satellites_used); @@ -271,7 +271,7 @@ private: // member functions string.append(","); else { string.append( - str(boost::format("%3.2f,%s") % std::fabs(mag_var) + str(boost::format("%3.2f,%s") % std::abs(mag_var) % (mag_var > 0 ? "E" : "W"))); } |