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.9 by root, Sun Jun 26 19:59:29 2005 UTC vs.
Revision 1.12 by root, Wed Dec 21 10:34:24 2005 UTC

13 static bool little_endian () { return e == 0x44332211; }; 13 static bool little_endian () { return e == 0x44332211; };
14 static bool vax () { return e == 0x44332211; }; 14 static bool vax () { return e == 0x44332211; };
15} byteorder; 15} byteorder;
16 16
17template<typename T, typename U> 17template<typename T, typename U>
18static inline T min (T a, U b) { return a < b ? a : (T)b; } 18static inline T min (T a, U b) { return a < (T)b ? a : (T)b; }
19template<typename T, typename U> 19template<typename T, typename U>
20static inline T max (T a, U b) { return a > b ? a : (T)b; } 20static inline T max (T a, U b) { return a > (T)b ? a : (T)b; }
21template<typename T, typename U, typename V>
22static inline T clamp (T v, U a, V b) { return v < (T)a ? a : v >(T)b ? b : v; }
21template<typename T> 23template<typename T, typename U>
22static inline void swap (T& a, T& b) { T t=a; a=b; b=t; } 24static inline void swap (T& a, U& b) { T t=a; a=(T)b; b=(U)t; }
23 25
26// in range including end
24#define IN_RANGE(val,beg,end) \ 27#define IN_RANGE_INC(val,beg,end) \
25 ((unsigned int)(val) - (unsigned int)(beg) <= (unsigned int)(end) - (unsigned int)(beg)) 28 ((unsigned int)(val) - (unsigned int)(beg) <= (unsigned int)(end) - (unsigned int)(beg))
29
30// in range excluding end
31#define IN_RANGE_EXC(val,beg,end) \
32 ((unsigned int)(val) - (unsigned int)(beg) < (unsigned int)(end) - (unsigned int)(beg))
26 33
27struct zero_initialized { 34struct zero_initialized {
28 void *operator new (size_t s); 35 void *operator new (size_t s);
29 void operator delete (void *p, size_t s); 36 void operator delete (void *p, size_t s);
30}; 37};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines