summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-03-02 10:51:46 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2012-03-02 10:51:46 +0100
commit1e3f6d6da29572426d5fd2fd922af9cc5219b285 (patch)
tree85a89f35bb78e82ed67eb481b18c2f79acf6b94b /device.c
parentc8808a854b58a6370baba41a8a0de97f1d4f73fd (diff)
downloadvdr-1e3f6d6da29572426d5fd2fd922af9cc5219b285.tar.gz
vdr-1e3f6d6da29572426d5fd2fd922af9cc5219b285.tar.bz2
Replaced min(max()) calls with the new function constrain()
Diffstat (limited to 'device.c')
-rw-r--r--device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/device.c b/device.c
index 9a0e4f6b..7a8c8c37 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 2.53 2012/03/02 10:33:35 kls Exp $
+ * $Id: device.c 2.54 2012/03/02 10:46:06 kls Exp $
*/
#include "device.h"
@@ -877,7 +877,7 @@ void cDevice::SetAudioChannel(int AudioChannel)
void cDevice::SetVolume(int Volume, bool Absolute)
{
int OldVolume = volume;
- volume = min(max(Absolute ? Volume : volume + Volume, 0), MAXVOLUME);
+ volume = constrain(Absolute ? Volume : volume + Volume, 0, MAXVOLUME);
SetVolumeDevice(volume);
Absolute |= mute;
cStatus::MsgSetVolume(Absolute ? volume : volume - OldVolume, Absolute);