/*
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2022 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
- <http://www.gnu.org/licenses/>. */
+ <https://www.gnu.org/licenses/>. */
/*
Copyright (C) 1983 Regents of the University of California.
if (buf->rand_type == TYPE_0)
{
- int32_t val = state[0];
- val = ((state[0] * 1103515245) + 12345) & 0x7fffffff;
+ int32_t val = ((state[0] * 1103515245U) + 12345U) & 0x7fffffff;
state[0] = val;
*result = val;
}
int32_t *fptr = buf->fptr;
int32_t *rptr = buf->rptr;
int32_t *end_ptr = buf->end_ptr;
- int32_t val;
+ uint32_t val;
- val = *fptr += *rptr;
+ val = *fptr += (uint32_t) *rptr;
/* Chucking least random bit. */
- *result = (val >> 1) & 0x7fffffff;
+ *result = val >> 1;
++fptr;
if (fptr >= end_ptr)
{