summaryrefslogtreecommitdiff
path: root/support/dktools/dk3range.h
blob: 8b4666e1a4e87e2cd6ef6dd97bd6a76799462e75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15


#ifndef	DK3_RANGE_H_INCLUDED
#define	DK3_RANGE_H_INCLUDED 1

/**	Fit a value into a range.
	@param	i	Value to fit.
	@param	min	Range minimum.
	@param	max	Range maximum.
	@return	Value or min or max.
*/
#define	DK3_TO_RANGE(i,min,max) ((i < min) ? min : ((i > max) ? max : i))

#endif