From 1e3f6d6da29572426d5fd2fd922af9cc5219b285 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 2 Mar 2012 10:51:46 +0100 Subject: Replaced min(max()) calls with the new function constrain() --- device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'device.c') 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); -- cgit v1.2.3