* implement a new `struct _reent' that is significantly smaller. use this
if _REENT_SMALL is defined in config.h. define this for xstormy16.
This commit is contained in:
@ -72,7 +72,7 @@ on two different systems.
|
||||
void
|
||||
_DEFUN (srand, (seed), unsigned int seed)
|
||||
{
|
||||
_REENT->_new._reent._rand_next = seed;
|
||||
_REENT_RAND_NEXT(_REENT) = seed;
|
||||
}
|
||||
|
||||
int
|
||||
@ -81,9 +81,10 @@ _DEFUN_VOID (rand)
|
||||
/* This multiplier was obtained from Knuth, D.E., "The Art of
|
||||
Computer Programming," Vol 2, Seminumerical Algorithms, Third
|
||||
Edition, Addison-Wesley, 1998, p. 106 (line 26) & p. 108 */
|
||||
_REENT->_new._reent._rand_next =
|
||||
_REENT->_new._reent._rand_next * __extension__ 6364136223846793005LL + 1;
|
||||
return (int)((_REENT->_new._reent._rand_next >> 32) & RAND_MAX);
|
||||
_REENT_CHECK_RAND48(_REENT);
|
||||
_REENT_RAND_NEXT(_REENT) =
|
||||
_REENT_RAND_NEXT(_REENT) * __extension__ 6364136223846793005LL + 1;
|
||||
return (int)((_REENT_RAND_NEXT(_REENT) >> 32) & RAND_MAX);
|
||||
}
|
||||
|
||||
#endif /* _REENT_ONLY */
|
||||
|
Reference in New Issue
Block a user