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.38 by root, Wed Nov 5 14:43:54 2008 UTC vs.
Revision 1.40 by sf-exg, Mon Jul 26 09:57:53 2010 UTC

20# define rxvt_attribute(x) 20# define rxvt_attribute(x)
21# define expect(expr,value) (expr) 21# define expect(expr,value) (expr)
22#endif 22#endif
23 23
24// put into ifs if you are very sure that the expression 24// put into ifs if you are very sure that the expression
25// is mostly true or mosty false. note that these return 25// is mostly true or mostly false. note that these return
26// booleans, not the expression. 26// booleans, not the expression.
27#define expect_false(expr) expect ((expr) != 0, 0) 27#define expect_false(expr) expect ((expr) != 0, 0)
28#define expect_true(expr) expect ((expr) != 0, 1) 28#define expect_true(expr) expect ((expr) != 0, 1)
29 29
30#define NORETURN rxvt_attribute ((noreturn)) 30#define NORETURN rxvt_attribute ((noreturn))
91 return (T *)rxvt_temp_buf (len * sizeof (T)); 91 return (T *)rxvt_temp_buf (len * sizeof (T));
92} 92}
93 93
94// some bit functions, xft fuck me plenty 94// some bit functions, xft fuck me plenty
95#if HAVE_GCC_BUILTINS 95#if HAVE_GCC_BUILTINS
96/* netbsd stupidly defines popcount itself and puts it into string.h */
96static inline int ctz (unsigned int x) { return __builtin_ctz (x); } 97static inline int rxvt_ctz (unsigned int x) { return __builtin_ctz (x); }
97static inline int popcount (unsigned int x) { return __builtin_popcount (x); } 98static inline int rxvt_popcount (unsigned int x) { return __builtin_popcount (x); }
98#else 99#else
99// count trailing zero bits and count # of one bits 100// count trailing zero bits and count # of one bits
100int ctz (unsigned int x) CONST; 101int rxvt_ctz (unsigned int x) CONST;
101int popcount (unsigned int x) CONST; 102int rxvt_popcount (unsigned int x) CONST;
102#endif 103#endif
103 104
104// in range including end 105// in range including end
105#define IN_RANGE_INC(val,beg,end) \ 106#define IN_RANGE_INC(val,beg,end) \
106 ((unsigned int)(val) - (unsigned int)(beg) <= (unsigned int)(end) - (unsigned int)(beg)) 107 ((unsigned int)(val) - (unsigned int)(beg) <= (unsigned int)(end) - (unsigned int)(beg))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines