~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/ut/ut0rnd.c

  • Committer: Monty Taylor
  • Date: 2009-03-20 04:49:49 UTC
  • mto: (950.1.1 mordred)
  • mto: This revision was merged to the branch mainline in revision 958.
  • Revision ID: mordred@inaugust.com-20090320044949-nfx7ygyy89ojl6v5
RemovedĀ unusedĀ code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
13
You should have received a copy of the GNU General Public License along with
14
 
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
 
St, Fifth Floor, Boston, MA 02110-1301 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
15
Place, Suite 330, Boston, MA 02111-1307 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
19
 
/***************************************************************//**
20
 
@file ut/ut0rnd.c
 
19
/*******************************************************************
21
20
Random numbers and hashing
22
21
 
23
22
Created 5/11/1994 Heikki Tuuri
29
28
#include "ut0rnd.ic"
30
29
#endif
31
30
 
32
 
/** These random numbers are used in ut_find_prime */
33
 
/*@{*/
 
31
/* These random numbers are used in ut_find_prime */
34
32
#define UT_RANDOM_1     1.0412321
35
33
#define UT_RANDOM_2     1.1131347
36
34
#define UT_RANDOM_3     1.0132677
37
 
/*@}*/
38
 
 
39
 
/** Seed value of ut_rnd_gen_ulint(). */
 
35
 
 
36
 
40
37
UNIV_INTERN ulint       ut_rnd_ulint_counter = 65654363;
41
38
 
42
 
/***********************************************************//**
 
39
/***************************************************************
43
40
Looks for a prime number slightly greater than the given argument.
44
 
The prime is chosen so that it is not near any power of 2.
45
 
@return prime */
 
41
The prime is chosen so that it is not near any power of 2. */
46
42
UNIV_INTERN
47
43
ulint
48
44
ut_find_prime(
49
45
/*==========*/
50
 
        ulint   n)      /*!< in: positive number > 100 */
 
46
                        /* out: prime */
 
47
        ulint   n)      /* in: positive number > 100 */
51
48
{
52
49
        ulint   pow2;
53
50
        ulint   i;