summaryrefslogtreecommitdiff
path: root/src/common/random.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-07-01 21:51:00 +0200
committerGitHub <noreply@github.com>2018-07-01 21:51:00 +0200
commit0a151c27ebef40f965cd87f436c72c044a3284ac (patch)
treed2892f1fe37846f56da93c89aa0b29e9442205ca /src/common/random.c
parent392238d4a9fe4ca3cc68098d9709c27c92409c8b (diff)
parent42f7eb821648b0076163faf968a83ab5dd2ce672 (diff)
downloadhercules-0a151c27ebef40f965cd87f436c72c044a3284ac.tar.gz
hercules-0a151c27ebef40f965cd87f436c72c044a3284ac.tar.bz2
hercules-0a151c27ebef40f965cd87f436c72c044a3284ac.tar.xz
hercules-0a151c27ebef40f965cd87f436c72c044a3284ac.zip
Merge pull request #2112 from MishimaHaruna/staticfunctions
Staticfunctions
Diffstat (limited to 'src/common/random.c')
-rw-r--r--src/common/random.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/common/random.c b/src/common/random.c
index 6fbaba91c..9bbe4f86c 100644
--- a/src/common/random.c
+++ b/src/common/random.c
@@ -40,11 +40,11 @@
* Implementation of the random number generator interface.
*/
-struct rnd_interface rnd_s;
+static struct rnd_interface rnd_s;
struct rnd_interface *rnd;
/// @copydoc rnd_interface::init()
-void rnd_init(void)
+static void rnd_init(void)
{
unsigned long seed = (unsigned long)timer->gettick();
seed += (unsigned long)time(NULL);
@@ -66,30 +66,30 @@ void rnd_init(void)
}
/// @copydoc rnd_interface::final()
-void rnd_final(void)
+static void rnd_final(void)
{
}
/// @copydoc rnd_interface::seed()
-void rnd_seed(uint32 seed)
+static void rnd_seed(uint32 seed)
{
init_genrand(seed);
}
/// @copydoc rnd_interface::random()
-int32 rnd_random(void)
+static int32 rnd_random(void)
{
return (int32)genrand_int31();
}
/// @copydoc rnd_interface::roll()
-uint32 rnd_roll(uint32 dice_faces)
+static uint32 rnd_roll(uint32 dice_faces)
{
return (uint32)(rnd->uniform()*dice_faces);
}
/// @copydoc rnd_interface::value()
-int32 rnd_value(int32 min, int32 max)
+static int32 rnd_value(int32 min, int32 max)
{
if (min >= max)
return min;
@@ -97,13 +97,13 @@ int32 rnd_value(int32 min, int32 max)
}
/// @copydoc rnd_interface::uniform()
-double rnd_uniform(void)
+static double rnd_uniform(void)
{
return ((uint32)genrand_int32())*(1.0/4294967296.0);// divided by 2^32
}
/// @copydoc rnd_interface::uniform53()
-double rnd_uniform53(void)
+static double rnd_uniform53(void)
{
return genrand_res53();
}