ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtutil.h
(Generate patch)

Comparing rxvt-unicode/src/rxvtutil.h (file contents):
Revision 1.50 by sf-exg, Mon Jan 23 14:29:24 2012 UTC vs.
Revision 1.51 by sf-exg, Fri Apr 13 11:46:37 2012 UTC

14# define NOTHROW throw() 14# define NOTHROW throw()
15# define THROW(x) throw x 15# define THROW(x) throw x
16#endif 16#endif
17 17
18// various utility functions 18// various utility functions
19template<typename T, typename U> static inline void min_it (T &a, U b) { a = a < (T)b ? a : (T)b; } 19template<typename T, typename U> static inline void min_it (T &a, U b) { a = a < (T)b ? a : (T)b; }
20template<typename T, typename U> static inline void max_it (T &a, U b) { a = a > (T)b ? a : (T)b; } 20template<typename T, typename U> static inline void max_it (T &a, U b) { a = a > (T)b ? a : (T)b; }
21 21
22template<typename T, typename U, typename V> static inline T clamp (T v, U a, V b) { return v < (T)a ? a : v >(T)b ? b : v; } 22template<typename T, typename U, typename V> static inline T clamp (T v, U a, V b) { return v < (T)a ? a : v >(T)b ? b : v; }
23template<typename T, typename U, typename V> static inline void clamp_it (T &v, U a, V b) { v = v < (T)a ? a : v >(T)b ? b : v; } 23template<typename T, typename U, typename V> static inline void clamp_it (T &v, U a, V b) { v = v < (T)a ? a : v >(T)b ? b : v; }
24 24
25template<typename T> static inline T squared_diff (T a, T b) { return (a-b)*(a-b); } 25template<typename T> static inline T squared_diff (T a, T b) { return (a - b) * (a - b); }
26 26
27// linear interpolation 27// linear interpolation
28template<typename T, typename U, typename P> 28template<typename T, typename U, typename P>
29static inline 29static inline
30T lerp (T a, U b, P p) 30T lerp (T a, U b, P p)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines