ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/utils.C
(Generate patch)

Comparing deliantra/server/common/utils.C (file contents):
Revision 1.106 by root, Wed Nov 14 22:52:13 2018 UTC vs.
Revision 1.107 by root, Sat Nov 17 23:33:17 2018 UTC

40 40
41#include <glib.h> 41#include <glib.h>
42 42
43refcnt_base::refcnt_t refcnt_dummy; 43refcnt_base::refcnt_t refcnt_dummy;
44ssize_t slice_alloc; 44ssize_t slice_alloc;
45
46#if !GCC_VERSION(3,4)
47int least_significant_bit (uint32_t x)
48{
49 x &= -x; // this isolates the lowest bit
50
51 int r = 0;
52
53 if (x & 0xaaaaaaaa) r += 1;
54 if (x & 0xcccccccc) r += 2;
55 if (x & 0xf0f0f0f0) r += 4;
56 if (x & 0xff00ff00) r += 8;
57 if (x & 0xffff0000) r += 16;
58
59 return r;
60}
61#endif
62 45
63/******************************************************************************/ 46/******************************************************************************/
64 47
65/* Checks a player-provided string which will become the msg property of 48/* Checks a player-provided string which will become the msg property of
66 * an object for dangerous input. 49 * an object for dangerous input.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines