~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2009-01-07 09:27:07 UTC
  • Revision ID: brian@tangent.org-20090107092707-bn67qpdllfcyh3j9
Removing dead field translator code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*****************************************************************************
2
 
 
3
 
Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved.
4
 
 
5
 
This program is free software; you can redistribute it and/or modify it under
6
 
the terms of the GNU General Public License as published by the Free Software
7
 
Foundation; version 2 of the License.
8
 
 
9
 
This program is distributed in the hope that it will be useful, but WITHOUT
10
 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
 
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
 
 
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
16
 
 
17
 
*****************************************************************************/
18
 
 
19
 
/***************************************************************//**
20
 
@file ut/ut0rnd.c
 
1
/*******************************************************************
21
2
Random numbers and hashing
22
3
 
 
4
(c) 1994, 1995 Innobase Oy
 
5
 
23
6
Created 5/11/1994 Heikki Tuuri
24
7
********************************************************************/
25
8
 
29
12
#include "ut0rnd.ic"
30
13
#endif
31
14
 
32
 
/** These random numbers are used in ut_find_prime */
33
 
/*@{*/
 
15
/* These random numbers are used in ut_find_prime */
34
16
#define UT_RANDOM_1     1.0412321
35
17
#define UT_RANDOM_2     1.1131347
36
18
#define UT_RANDOM_3     1.0132677
37
 
/*@}*/
38
 
 
39
 
/** Seed value of ut_rnd_gen_ulint(). */
 
19
 
 
20
 
40
21
UNIV_INTERN ulint       ut_rnd_ulint_counter = 65654363;
41
22
 
42
 
/***********************************************************//**
 
23
/***************************************************************
43
24
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 */
 
25
The prime is chosen so that it is not near any power of 2. */
46
26
UNIV_INTERN
47
27
ulint
48
28
ut_find_prime(
49
29
/*==========*/
50
 
        ulint   n)      /*!< in: positive number > 100 */
 
30
                        /* out: prime */
 
31
        ulint   n)      /* in: positive number > 100 */
51
32
{
52
33
        ulint   pow2;
53
34
        ulint   i;