random.c (348238dbd42306d9fb5d89ab393b840572cfeb0f) | random.c (4a8dea8cf97aab33f4e6a11afcc64dd9562f3bfd) |
---|---|
1/*- 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 25 unchanged lines hidden (view full) --- 34 35#include <sys/libkern.h> 36 37#define NSHUFF 50 /* to drop some "seed -> 1st value" linearity */ 38 39static u_long randseed = 937186357; /* after srandom(1), NSHUFF counted */ 40 41void | 1/*- 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 25 unchanged lines hidden (view full) --- 34 35#include <sys/libkern.h> 36 37#define NSHUFF 50 /* to drop some "seed -> 1st value" linearity */ 38 39static u_long randseed = 937186357; /* after srandom(1), NSHUFF counted */ 40 41void |
42srandom(seed) 43 u_long seed; | 42srandom(u_long seed) |
44{ 45 int i; 46 47 randseed = seed; 48 for (i = 0; i < NSHUFF; i++) 49 (void)random(); 50} 51 --- 27 unchanged lines hidden --- | 43{ 44 int i; 45 46 randseed = seed; 47 for (i = 0; i < NSHUFF; i++) 48 (void)random(); 49} 50 --- 27 unchanged lines hidden --- |