ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libecb/ecb.h
(Generate patch)

Comparing libecb/ecb.h (file contents):
Revision 1.47 by root, Fri Jun 17 16:03:01 2011 UTC vs.
Revision 1.48 by root, Fri Jun 17 16:17:26 2011 UTC

145 ecb_function_ int 145 ecb_function_ int
146 ecb_ctz32 (uint32_t x) 146 ecb_ctz32 (uint32_t x)
147 { 147 {
148 int r = 0; 148 int r = 0;
149 149
150 x &= (uint32_t)-(int32_t)x; /* this isolates the lowest bit */ 150 x &= ~x + 1; /* this isolates the lowest bit */
151 151
152 if (x & 0xaaaaaaaa) r += 1; 152 if (x & 0xaaaaaaaa) r += 1;
153 if (x & 0xcccccccc) r += 2; 153 if (x & 0xcccccccc) r += 2;
154 if (x & 0xf0f0f0f0) r += 4; 154 if (x & 0xf0f0f0f0) r += 4;
155 if (x & 0xff00ff00) r += 8; 155 if (x & 0xff00ff00) r += 8;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines