jrand48.c revision 1.5
11.5Slukem/*	$NetBSD: jrand48.c,v 1.5 1999/09/16 11:45:34 lukem Exp $	*/
21.4Sperry
31.1Sbrezak/*
41.1Sbrezak * Copyright (c) 1993 Martin Birgmeier
51.1Sbrezak * All rights reserved.
61.1Sbrezak *
71.1Sbrezak * You may redistribute unmodified or modified versions of this source
81.1Sbrezak * code provided that the above copyright notice and this and the
91.1Sbrezak * following conditions are retained.
101.1Sbrezak *
111.1Sbrezak * This software is provided ``as is'', and comes with no warranties
121.1Sbrezak * of any kind. I shall in no event be liable for anything that happens
131.1Sbrezak * to anyone/anything when using this software.
141.1Sbrezak */
151.1Sbrezak
161.3Sjtc#include "namespace.h"
171.5Slukem
181.5Slukem#include <assert.h>
191.5Slukem
201.1Sbrezak#include "rand48.h"
211.3Sjtc
221.3Sjtc#ifdef __weak_alias
231.3Sjtc__weak_alias(jrand48,_jrand48);
241.3Sjtc#endif
251.1Sbrezak
261.1Sbrezaklong
271.1Sbrezakjrand48(unsigned short xseed[3])
281.1Sbrezak{
291.5Slukem
301.5Slukem	_DIAGASSERT(xseed != NULL);
311.5Slukem#ifdef _DIAGNOSTIC
321.5Slukem	if (xseed == NULL)
331.5Slukem		return (0L);
341.5Slukem#endif
351.5Slukem
361.2Sjtc	__dorand48(xseed);
371.1Sbrezak	return ((long) xseed[2] << 16) + (long) xseed[1];
381.1Sbrezak}
39