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

Comparing libecb/ecb.h (file contents):
Revision 1.8 by root, Thu May 26 17:43:41 2011 UTC vs.
Revision 1.9 by root, Thu May 26 17:51:54 2011 UTC

148#else 148#else
149#define ecb_array_length(name) (sizeof (name) / sizeof (name [0])) 149#define ecb_array_length(name) (sizeof (name) / sizeof (name [0]))
150#endif 150#endif
151 151
152ECB_INLINE uint32_t 152ECB_INLINE uint32_t
153ecb_rotr32 (uint32_t c, unsigned int count) 153ecb_rotr32 (uint32_t x, unsigned int count)
154{ 154{
155 return (c << (32 - count)) | (c >> count); 155 return (x << (32 - count)) | (x >> count);
156} 156}
157 157
158ECB_INLINE uint32_t 158ECB_INLINE uint32_t
159ecb_rotl32 (uint32_t c, unsigned int count) 159ecb_rotl32 (uint32_t x, unsigned int count)
160{ 160{
161 return (c >> (32 - count)) | (c << count); 161 return (x >> (32 - count)) | (x << count);
162} 162}
163
164#if ECB_GCC_VERSION(4,1)
165# define ecb_bswap32(x) __builtin_bswap32 (x)
166#else
167ECB_GCC_VERSION uint32_t
168ecb_bswap32 (uint32_t x)
169{
170 return (x >> 24)
171 | ((x >> 8) & 0x0000ff00)
172 | ((x << 8) & 0x00ff0000)
173 | (x << 24);
174}
175#endif
163 176
164#endif 177#endif
165 178

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines