mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-28 20:11:00 +01:00
b945938c63
frequent use of ``register var'' instead of ``register int var'' and the removal of the register hint in the previous commit.
34 lines
290 B
C
34 lines
290 B
C
/* rnd.c - version 1.0.2 */
|
|
/* $FreeBSD$ */
|
|
|
|
#include <stdlib.h>
|
|
|
|
#define RND(x) (random() % x)
|
|
|
|
rn1(x,y)
|
|
int x,y;
|
|
{
|
|
return(RND(x)+y);
|
|
}
|
|
|
|
rn2(x)
|
|
int x;
|
|
{
|
|
return(RND(x));
|
|
}
|
|
|
|
rnd(x)
|
|
int x;
|
|
{
|
|
return(RND(x)+1);
|
|
}
|
|
|
|
d(n,x)
|
|
int n,x;
|
|
{
|
|
int tmp = n;
|
|
|
|
while(n--) tmp += RND(x);
|
|
return(tmp);
|
|
}
|