summaryrefslogtreecommitdiff
path: root/tools.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-03-02 10:19:00 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2012-03-02 10:19:00 +0100
commit28bc34b245ffdf0c205f0c5f2624e5c7d94d3c54 (patch)
tree94ac74945d31647fb7087e9d36e30d8d74cb40ec /tools.h
parenta188928e6ea462e45da7c363a3098065c4691953 (diff)
downloadvdr-28bc34b245ffdf0c205f0c5f2624e5c7d94d3c54.tar.gz
vdr-28bc34b245ffdf0c205f0c5f2624e5c7d94d3c54.tar.bz2
Revised priority handling to allow receivers with a priority that is lower than that of live viewing
Diffstat (limited to 'tools.h')
-rw-r--r--tools.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools.h b/tools.h
index 52bf8a7f..49981414 100644
--- a/tools.h
+++ b/tools.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.h 2.15 2012/02/18 15:29:50 kls Exp $
+ * $Id: tools.h 2.16 2012/02/29 10:41:00 kls Exp $
*/
#ifndef __TOOLS_H
@@ -57,6 +57,8 @@ template<class T> inline int sgn(T a) { return a < 0 ? -1 : a > 0 ? 1 : 0; }
template<class T> inline void swap(T &a, T &b) { T t = a; a = b; b = t; }
#endif
+template<class T> inline T constrain(T v, T l, T h) { return v < l ? l : v > h ? h : v; }
+
void syslog_with_tid(int priority, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
#define BCDCHARTOINT(x) (10 * ((x & 0xF0) >> 4) + (x & 0xF))