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

Comparing rxvt-unicode/src/rxvtutil.C (file contents):
Revision 1.9 by ayin, Wed Oct 31 09:55:24 2007 UTC vs.
Revision 1.10 by root, Fri Sep 4 15:40:13 2009 UTC

44 44
45 e = w.u; 45 e = w.u;
46} 46}
47 47
48#if !HAVE_GCC_BUILTINS 48#if !HAVE_GCC_BUILTINS
49int ctz (unsigned int x) CONST 49int rxvt_ctz (unsigned int x) CONST
50{ 50{
51 int r = 0; 51 int r = 0;
52 52
53 x &= -x; // this isolates the lowest bit 53 x &= -x; // this isolates the lowest bit
54 54
59 if (x & 0xffff0000) r += 16; 59 if (x & 0xffff0000) r += 16;
60 60
61 return r; 61 return r;
62} 62}
63 63
64int popcount (unsigned int x) CONST 64int rxvt_popcount (unsigned int x) CONST
65{ 65{
66 x -= (x >> 1) & 0x55555555; 66 x -= (x >> 1) & 0x55555555;
67 x = ((x >> 2) & 0x33333333) + (x & 0x33333333); 67 x = ((x >> 2) & 0x33333333) + (x & 0x33333333);
68 x = ((x >> 4) + x) & 0x0f0f0f0f; 68 x = ((x >> 4) + x) & 0x0f0f0f0f;
69 x *= 0x01010101; 69 x *= 0x01010101;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines