Commit 4fd0c84f authored by Rosen Penev's avatar Rosen Penev Committed by Max Kellermann

replace lrint with lround

lrint is a configurable version of lround that behaves either as round, floor, ceil, or trunc based on setting the proper FE_ macro using fset/getround. Given that it's not set at all and that it defaults to round behavior, simply replace with round. Also removed the util/Math defines. Signed-off-by: 's avatarRosen Penev <rosenp@gmail.com>
parent e41a52d9
......@@ -273,7 +273,7 @@ AlsaMixer::GetVolume()
throw FormatRuntimeError("snd_mixer_handle_events() failed: %s",
snd_strerror(err));
return lrint(100 * get_normalized_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT));
return lround(100 * get_normalized_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT));
}
void
......@@ -282,7 +282,7 @@ AlsaMixer::SetVolume(unsigned volume)
assert(handle != nullptr);
double cur = get_normalized_playback_volume(elem, SND_MIXER_SCHN_FRONT_LEFT);
int delta = volume - lrint(100.*cur);
int delta = volume - lround(100.*cur);
int err = set_normalized_playback_volume(elem, cur + 0.01*delta, delta);
if (err < 0)
throw FormatRuntimeError("failed to set ALSA volume: %s",
......
......@@ -32,12 +32,9 @@
#ifdef __UCLIBC__
#include <boost/math/special_functions/round.hpp>
using boost::math::iround;
using boost::math::lround;
#define lrint iround
#else
#include <cmath>
using std::lrint;
using std::lround;
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment