Home | History | Annotate | Line # | Download | only in stdlib
lcong48.c revision 1.5
      1  1.5   lukem /*	$NetBSD: lcong48.c,v 1.5 1999/09/16 11:45:34 lukem Exp $	*/
      2  1.4   perry 
      3  1.1  brezak /*
      4  1.1  brezak  * Copyright (c) 1993 Martin Birgmeier
      5  1.1  brezak  * All rights reserved.
      6  1.1  brezak  *
      7  1.1  brezak  * You may redistribute unmodified or modified versions of this source
      8  1.1  brezak  * code provided that the above copyright notice and this and the
      9  1.1  brezak  * following conditions are retained.
     10  1.1  brezak  *
     11  1.1  brezak  * This software is provided ``as is'', and comes with no warranties
     12  1.1  brezak  * of any kind. I shall in no event be liable for anything that happens
     13  1.1  brezak  * to anyone/anything when using this software.
     14  1.1  brezak  */
     15  1.1  brezak 
     16  1.3     jtc #include "namespace.h"
     17  1.5   lukem 
     18  1.5   lukem #include <assert.h>
     19  1.5   lukem 
     20  1.1  brezak #include "rand48.h"
     21  1.1  brezak 
     22  1.3     jtc #ifdef __weak_alias
     23  1.3     jtc __weak_alias(lcong48,_lcong48);
     24  1.3     jtc #endif
     25  1.1  brezak 
     26  1.1  brezak void
     27  1.1  brezak lcong48(unsigned short p[7])
     28  1.1  brezak {
     29  1.5   lukem 	_DIAGASSERT(p != NULL);
     30  1.5   lukem #ifdef _DIAGNOSTIC
     31  1.5   lukem 	if (p == NULL)
     32  1.5   lukem 		return;
     33  1.5   lukem #endif
     34  1.5   lukem 
     35  1.2     jtc 	__rand48_seed[0] = p[0];
     36  1.2     jtc 	__rand48_seed[1] = p[1];
     37  1.2     jtc 	__rand48_seed[2] = p[2];
     38  1.2     jtc 	__rand48_mult[0] = p[3];
     39  1.2     jtc 	__rand48_mult[1] = p[4];
     40  1.2     jtc 	__rand48_mult[2] = p[5];
     41  1.2     jtc 	__rand48_add = p[6];
     42  1.1  brezak }
     43