From 9db3809c7b46bce1b154c20900feb37d239644c5 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 31 Jan 2020 20:04:44 -0800 Subject: [clang-tidy] use bool literals where appropriate Found with modernize-use-bool-literals Signed-off-by: Rosen Penev --- src/player/CrossFade.cxx | 2 +- src/player/Thread.cxx | 2 +- src/playlist/plugins/SoundCloudPlaylistPlugin.cxx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/player/CrossFade.cxx b/src/player/CrossFade.cxx index 7efed3e55..ce86d3f0a 100644 --- a/src/player/CrossFade.cxx +++ b/src/player/CrossFade.cxx @@ -44,7 +44,7 @@ mixramp_interpolate(const char *ramp_list, float required_db) noexcept * between the dB and seconds of a pair. * The dB values must be monotonically increasing for this to work. */ - while (1) { + while (true) { /* Parse the dB value. */ char *endptr; const float db = ParseFloat(ramp_list, &endptr); diff --git a/src/player/Thread.cxx b/src/player/Thread.cxx index 9af45352b..6a3a90963 100644 --- a/src/player/Thread.cxx +++ b/src/player/Thread.cxx @@ -1155,7 +1155,7 @@ try { std::unique_lock lock(mutex); - while (1) { + while (true) { switch (command) { case PlayerCommand::SEEK: case PlayerCommand::QUEUE: diff --git a/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx b/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx index 454ba2ba4..0f23b2df8 100644 --- a/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx +++ b/src/playlist/plugins/SoundCloudPlaylistPlugin.cxx @@ -177,11 +177,11 @@ SoundCloudJsonData::EndMap() noexcept { if (got_url > 1) { got_url--; - return 1; + return true; } if (got_url == 0) - return 1; + return true; /* got_url == 1, track finished, make it into a song */ got_url = 0; -- cgit v1.2.3