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.29 by root, Mon Jan 15 01:39:42 2007 UTC vs.
Revision 1.31 by root, Mon Jan 15 02:39:41 2007 UTC

32 ((unsigned int)(val) - (unsigned int)(beg) <= (unsigned int)(end) - (unsigned int)(beg)) 32 ((unsigned int)(val) - (unsigned int)(beg) <= (unsigned int)(end) - (unsigned int)(beg))
33 33
34// in range excluding end 34// in range excluding end
35#define IN_RANGE_EXC(val,beg,end) \ 35#define IN_RANGE_EXC(val,beg,end) \
36 ((unsigned int)(val) - (unsigned int)(beg) < (unsigned int)(end) - (unsigned int)(beg)) 36 ((unsigned int)(val) - (unsigned int)(beg) < (unsigned int)(end) - (unsigned int)(beg))
37
38void fork_abort (const char *msg);
37 39
38// this is much faster than crossfires original algorithm 40// this is much faster than crossfires original algorithm
39// on modern cpus 41// on modern cpus
40inline int 42inline int
41isqrt (int n) 43isqrt (int n)
58#if 0 60#if 0
59 return dx_ > dy_ 61 return dx_ > dy_
60 ? (dx_ * 61685 + dy_ * 26870) >> 16 62 ? (dx_ * 61685 + dy_ * 26870) >> 16
61 : (dy_ * 61685 + dx_ * 26870) >> 16; 63 : (dy_ * 61685 + dx_ * 26870) >> 16;
62#else 64#else
63 return dx + dy - min (dx, dy) * 5 / 8; 65 return dx_ + dy_ - min (dx_, dy_) * 5 / 8;
64#endif 66#endif
65} 67}
66 68
67/* 69/*
68 * absdir(int): Returns a number between 1 and 8, which represent 70 * absdir(int): Returns a number between 1 and 8, which represent

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines