1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-11 14:10:34 +00:00

Use srandomdev

This commit is contained in:
Andrey A. Chernov 1997-09-24 05:18:42 +00:00
parent a1b8b58180
commit 3320fc4786
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=29771
3 changed files with 8 additions and 10 deletions

View File

@ -1,9 +1,11 @@
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.mklev.c - version 1.0.3 */
#include <stdlib.h>
#include <unistd.h>
#include "hack.h"
extern char *getlogin(), *getenv();
extern struct monst *makemon();
extern struct obj *mkobj_at();
extern struct trap *maketrap();

View File

@ -14,22 +14,16 @@
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include "hack.h" /* mainly for index() which depends on BSD */
#include <sys/types.h> /* for time_t and stat */
#include <sys/stat.h>
#ifdef BSD
#include <sys/time.h>
#else
#include <time.h>
#endif BSD
extern char *getenv();
extern time_t time();
setrandom()
{
(void) srandom((int) time ((time_t *) 0));
(void) srandomdev();
}
struct tm *

View File

@ -1,6 +1,8 @@
/* rnd.c - version 1.0.2 */
#define RND(x) ((random()>>3) % x)
#include <stdlib.h>
#define RND(x) (random() % x)
rn1(x,y)
register x,y;