mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-20 22:23:16 +00:00
ca971bbfd8
This patch changes the top-level directory layout as a preparatory step for improving the tools for managing 3rd-party source codes. The rationale is described in the issue referenced below. Issue #1082
32 lines
662 B
C++
32 lines
662 B
C++
/*
|
|
* \brief Pseudo random-number generator
|
|
* \date 2005-10-24
|
|
* \author Norman Feske
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2005-2013 Genode Labs GmbH
|
|
*
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
* under the terms of the GNU General Public License version 2.
|
|
*/
|
|
|
|
#ifndef _INCLUDE__SCOUT_GFX__RANDOM_H_
|
|
#define _INCLUDE__SCOUT_GFX__RANDOM_H_
|
|
|
|
namespace Scout {
|
|
|
|
/**
|
|
* Produce pseudo random values
|
|
*/
|
|
static inline int random()
|
|
{
|
|
static unsigned int seed = 93186752;
|
|
const unsigned int a = 1588635695, q = 2, r = 1117695901;
|
|
seed = a*(seed % q) - r*(seed / q);
|
|
return seed;
|
|
}
|
|
}
|
|
|
|
#endif /* _INCLUDE__SCOUT_GFX__RANDOM_H_ */
|