Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-05-13 15:40:45 +0400
committerCorinna Vinschen <corinna@vinschen.de>2008-05-13 15:40:45 +0400
commita065930a3ad29db593857c3807ebe9deacb5321a (patch)
tree5ac098f7db8f1932169fa746feb5bde4281743bb /winsup/cygwin/random.cc
parent080fcb854e7acb4b54522c69a71d384374aef924 (diff)
* random.cc (initstate): Align to POSIX definition.
(setstate): Ditto.
Diffstat (limited to 'winsup/cygwin/random.cc')
-rw-r--r--winsup/cygwin/random.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/winsup/cygwin/random.cc b/winsup/cygwin/random.cc
index 583276d0f..037990880 100644
--- a/winsup/cygwin/random.cc
+++ b/winsup/cygwin/random.cc
@@ -354,9 +354,9 @@ srandomdev()
* complain about mis-alignment, but you should disregard these messages.
*/
char *
-initstate(unsigned long seed, /* seed for R.N.G. */
+initstate(unsigned seed, /* seed for R.N.G. */
char *arg_state, /* pointer to state array */
- long n) /* # bytes of state info */
+ size_t n) /* # bytes of state info */
{
char *ostate = (char *)(&state[-1]);
uint32_t *int_arg_state = (uint32_t *)arg_state;
@@ -367,7 +367,8 @@ initstate(unsigned long seed, /* seed for R.N.G. */
state[-1] = MAX_TYPES * (rptr - state) + rand_type;
if (n < BREAK_0) {
(void)fprintf(stderr,
- "random: not enough state (%ld bytes); ignored.\n", n);
+ "random: not enough state (%lu bytes); ignored.\n",
+ (unsigned long) n);
return(0);
}
if (n < BREAK_1) {
@@ -421,7 +422,7 @@ initstate(unsigned long seed, /* seed for R.N.G. */
* complain about mis-alignment, but you should disregard these messages.
*/
char *
-setstate(char *arg_state /* pointer to state array */)
+setstate(const char *arg_state /* pointer to state array */)
{
uint32_t *new_state = (uint32_t *)arg_state;
uint32_t type = new_state[0] % MAX_TYPES;