diff options
Diffstat (limited to 'storage/innobase/include/ut0rnd.ic')
-rw-r--r-- | storage/innobase/include/ut0rnd.ic | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/storage/innobase/include/ut0rnd.ic b/storage/innobase/include/ut0rnd.ic index 024c59e553b..8abf775869c 100644 --- a/storage/innobase/include/ut0rnd.ic +++ b/storage/innobase/include/ut0rnd.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1994, 2009, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1994, 2013, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -54,7 +54,7 @@ ut_rnd_set_seed( /********************************************************//** The following function generates a series of 'random' ulint integers. -@return the next 'random' number */ +@return the next 'random' number */ UNIV_INLINE ulint ut_rnd_gen_next_ulint( @@ -81,7 +81,7 @@ The following function generates 'random' ulint integers which enumerate the value space of ulint integers in a pseudo random fashion. Note that the same integer is repeated always after 2 to power 32 calls to the generator (if ulint is 32-bit). -@return the 'random' number */ +@return the 'random' number */ UNIV_INLINE ulint ut_rnd_gen_ulint(void) @@ -98,7 +98,7 @@ ut_rnd_gen_ulint(void) /********************************************************//** Generates a random integer from a given interval. -@return the 'random' number */ +@return the 'random' number */ UNIV_INLINE ulint ut_rnd_interval( @@ -120,31 +120,11 @@ ut_rnd_interval( return(low + (rnd % (high - low))); } -/*********************************************************//** -Generates a random iboolean value. -@return the random value */ -UNIV_INLINE -ibool -ut_rnd_gen_ibool(void) -/*=================*/ -{ - ulint x; - - x = ut_rnd_gen_ulint(); - - if (((x >> 20) + (x >> 15)) & 1) { - - return(TRUE); - } - - return(FALSE); -} - /*******************************************************//** The following function generates a hash value for a ulint integer to a hash table of size table_size, which should be a prime or some random number for the hash table to work reliably. -@return hash value */ +@return hash value */ UNIV_INLINE ulint ut_hash_ulint( @@ -160,7 +140,7 @@ ut_hash_ulint( /*************************************************************//** Folds a 64-bit integer. -@return folded value */ +@return folded value */ UNIV_INLINE ulint ut_fold_ull( @@ -173,7 +153,7 @@ ut_fold_ull( /*************************************************************//** Folds a character string ending in the null character. -@return folded value */ +@return folded value */ UNIV_INLINE ulint ut_fold_string( @@ -196,7 +176,7 @@ ut_fold_string( /*************************************************************//** Folds a pair of ulints. -@return folded value */ +@return folded value */ UNIV_INLINE ulint ut_fold_ulint_pair( @@ -210,7 +190,7 @@ ut_fold_ulint_pair( /*************************************************************//** Folds a binary string. -@return folded value */ +@return folded value */ UNIV_INLINE ulint ut_fold_binary( |