ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/util.h
(Generate patch)

Comparing deliantra/server/include/util.h (file contents):
Revision 1.95 by root, Tue Nov 10 00:01:31 2009 UTC vs.
Revision 1.96 by root, Wed Nov 11 03:52:44 2009 UTC

240absdir (int d) 240absdir (int d)
241{ 241{
242 return ((d - 1) & 7) + 1; 242 return ((d - 1) & 7) + 1;
243} 243}
244 244
245// avoid ctz name because netbsd or freebsd spams it's namespace with it
246#if GCC_VERSION(3,4)
247static inline int least_significant_bit (uint32_t x)
248{
249 return __builtin_ctz (x);
250}
251#else
252int least_significant_bit (uint32_t x);
253#endif
254
255#define for_all_bits_sparse_32(mask, idxvar) \
256 for (uint32_t idxvar, mask_ = mask; \
257 mask_ && ((idxvar = least_significant_bit (mask_)), mask_ &= ~(1 << idxvar), 1);)
258
245extern ssize_t slice_alloc; // statistics 259extern ssize_t slice_alloc; // statistics
246 260
247void *salloc_ (int n) throw (std::bad_alloc); 261void *salloc_ (int n) throw (std::bad_alloc);
248void *salloc_ (int n, void *src) throw (std::bad_alloc); 262void *salloc_ (int n, void *src) throw (std::bad_alloc);
249 263

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines