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.108 by root, Wed May 26 19:11:43 2010 UTC vs.
Revision 1.109 by root, Tue Jun 29 16:52:53 2010 UTC

489 return !is_constant (num) ? get_range (num) // non-constant 489 return !is_constant (num) ? get_range (num) // non-constant
490 : num & (num - 1) ? (this->next () * (uint64_t)num) >> 32U // constant, non-power-of-two 490 : num & (num - 1) ? (this->next () * (uint64_t)num) >> 32U // constant, non-power-of-two
491 : this->next () & (num - 1); // constant, power-of-two 491 : this->next () & (num - 1); // constant, power-of-two
492 } 492 }
493 493
494 // return a number within the closed interval [min .. max] 494 // return a number within the closed interval [min .. max], max can be >, < or == min.
495 int operator () (int r_min, int r_max) 495 int operator () (int r_min, int r_max)
496 { 496 {
497 return is_constant (r_min <= r_max) && r_min <= r_max 497 return is_constant (r_min <= r_max) && r_min <= r_max
498 ? r_min + operator ()(r_max - r_min + 1) 498 ? r_min + operator ()(r_max - r_min + 1)
499 : get_range (r_min, r_max); 499 : get_range (r_min, r_max);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines