diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-12-15 18:37:41 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-12-15 18:37:41 +0000 |
commit | 38e68cc763cf9d40f577a18a3b7e93afbbb026ad (patch) | |
tree | 57f5b4bc5fba47ce5f3ca83f11b6a3ccb5808887 /src | |
parent | 7c673ef1f9dcf88b1bb7b936e198d1c958777f8e (diff) |
- event.c:aventAdIsh(): fixed compile warning with -Wunsuffixed-float-constants,
replaced rand() with genrand_int32()
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2679 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r-- | src/event.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/event.c b/src/event.c index c678d63..c2110e4 100644 --- a/src/event.c +++ b/src/event.c @@ -58,6 +58,8 @@ #include "memory.h" #include "log.h" #include "numeric.h" +#include "rng_mt.h" + static const char *last_event_ran = NULL; static struct ev_entry event_table[MAX_EVENTS]; @@ -132,10 +134,10 @@ eventDelete(EVH *func, void *arg) void eventAddIsh(const char *name, EVH *func, void *arg, time_t delta_ish) { - if (delta_ish >= 3.0) + if (delta_ish >= 3) { const time_t two_third = (2 * delta_ish) / 3; - delta_ish = two_third + ((rand() % 1000) * two_third) / 1000; + delta_ish = two_third + ((genrand_int32() % 1000) * two_third) / 1000; /* * XXX I hate the above magic, I don't even know if its right. * Grr. -- adrian |