diff options
author | Elliott Hughes <enh@google.com> | 2012-10-01 13:11:03 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2012-10-01 13:53:41 -0700 |
commit | 774c7f54ff375d71106283d42779b0cc5f238f87 (patch) | |
tree | 3dc911f915d8d120089ca5afd60bb84b6d51e71e /libc/stdlib/srand48.c | |
parent | 5b6346f6d5dca4022fe0044dd2807c19ac596788 (diff) | |
download | android_bionic-774c7f54ff375d71106283d42779b0cc5f238f87.tar.gz android_bionic-774c7f54ff375d71106283d42779b0cc5f238f87.tar.bz2 android_bionic-774c7f54ff375d71106283d42779b0cc5f238f87.zip |
Upgrade to the current NetBSD rand implementation.
Also add basic unit tests.
Change-Id: I7fc7ef61d47c1e8fdf8b8eff67a635220c3afd56
Diffstat (limited to 'libc/stdlib/srand48.c')
-rw-r--r-- | libc/stdlib/srand48.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/libc/stdlib/srand48.c b/libc/stdlib/srand48.c deleted file mode 100644 index f76b6cca8..000000000 --- a/libc/stdlib/srand48.c +++ /dev/null @@ -1,31 +0,0 @@ -/* $OpenBSD: srand48.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */ -/* - * Copyright (c) 1993 Martin Birgmeier - * All rights reserved. - * - * You may redistribute unmodified or modified versions of this source - * code provided that the above copyright notice and this and the - * following conditions are retained. - * - * This software is provided ``as is'', and comes with no warranties - * of any kind. I shall in no event be liable for anything that happens - * to anyone/anything when using this software. - */ - -#include "rand48.h" - -extern unsigned short __rand48_seed[3]; -extern unsigned short __rand48_mult[3]; -extern unsigned short __rand48_add; - -void -srand48(long seed) -{ - __rand48_seed[0] = RAND48_SEED_0; - __rand48_seed[1] = (unsigned short) seed; - __rand48_seed[2] = (unsigned short) (seed >> 16); - __rand48_mult[0] = RAND48_MULT_0; - __rand48_mult[1] = RAND48_MULT_1; - __rand48_mult[2] = RAND48_MULT_2; - __rand48_add = RAND48_ADD; -} |