1274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes/* $NetBSD: lcong48.c,v 1.8 2005/06/12 05:21:28 lukem Exp $ */ 2274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes 3274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes/* 4274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes * Copyright (c) 1993 Martin Birgmeier 5274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes * All rights reserved. 6274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes * 7274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes * You may redistribute unmodified or modified versions of this source 8274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes * code provided that the above copyright notice and this and the 9274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes * following conditions are retained. 10274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes * 11274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes * This software is provided ``as is'', and comes with no warranties 12274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes * of any kind. I shall in no event be liable for anything that happens 13274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes * to anyone/anything when using this software. 14274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes */ 15274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes 16274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes#include <sys/cdefs.h> 17274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes#if defined(LIBC_SCCS) && !defined(lint) 18274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes__RCSID("$NetBSD: lcong48.c,v 1.8 2005/06/12 05:21:28 lukem Exp $"); 19274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes#endif /* LIBC_SCCS and not lint */ 20274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes 21274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes#include "namespace.h" 22274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes 23274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes#include <assert.h> 24274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes 25274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes#include "rand48.h" 26274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes 27274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes#ifdef __weak_alias 28274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes__weak_alias(lcong48,_lcong48) 29274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes#endif 30274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes 31274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughesvoid 32274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hugheslcong48(unsigned short p[7]) 33274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes{ 34274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes _DIAGASSERT(p != NULL); 35274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes 36274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes __rand48_seed[0] = p[0]; 37274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes __rand48_seed[1] = p[1]; 38274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes __rand48_seed[2] = p[2]; 39274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes __rand48_mult[0] = p[3]; 40274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes __rand48_mult[1] = p[4]; 41274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes __rand48_mult[2] = p[5]; 42274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes __rand48_add = p[6]; 43274afe8f0eab4139c94d5f8b1ee3d267f449ef42Elliott Hughes} 44