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.24 by root, Mon Jan 30 16:12:58 2006 UTC vs.
Revision 1.25 by root, Mon Jan 30 19:46:13 2006 UTC

53 53
54template<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; } 54template<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; }
55template<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; } 55template<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; }
56 56
57template<typename T, typename U> static inline void swap (T& a, U& b) { T t=a; a=(T)b; b=(U)t; } 57template<typename T, typename U> static inline void swap (T& a, U& b) { T t=a; a=(T)b; b=(U)t; }
58
59template<typename T> static inline T squared_diff (T a, T b) { return (a-b)*(a-b); }
58 60
59// linear interpolation 61// linear interpolation
60template<typename T, typename U, typename P> 62template<typename T, typename U, typename P>
61static inline 63static inline
62T lerp (T a, U b, P p) 64T lerp (T a, U b, P p)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines