From 1d8dc4293f772369e2da018ba5f1bf6e67967f3a Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 23 Jan 1996 10:00:23 +0000 Subject: Mon Jan 22 10:40:40 1996 Roland McGrath * sysdeps/posix/getcwd.c [__GNU_LIBRARY__]: Include unistd.h. * io/fts.h (FTSENT): Define fts_compar member with prototype. * hurd/hurd.h: Use prototype in getcttyid decl. * stdlib/l64a.c: Fix typo in last change. * stdlib/drand48-iter.c: Test limits.h macros instead of sizeof for determining size of types. * stdlib/srand48_r.c: Likewise. * misc/utmp.h: Declare login, logout, logwtmp. * misc/logout.c: Declare argument as pointer to const. * misc/login.c: Likewise. * misc/logwtmp.c: Likewise. Include time.h, string.h. * misc/efgcvt_r.c: Include stdlib.h. * io/mknod.c: Include sys/types.h. * gmon/sys/gmon.h: Declare monstartup, _mcleanup. * csu/gmon-start.c (_start, etext): Declare with prototypes. * stdio-common/vfscanf.c (%[): Fix range handling. --- stdlib/drand48-iter.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'stdlib/drand48-iter.c') diff --git a/stdlib/drand48-iter.c b/stdlib/drand48-iter.c index b98f4026ea..967c404706 100644 --- a/stdlib/drand48-iter.c +++ b/stdlib/drand48-iter.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , August 1995. @@ -19,6 +19,7 @@ Boston, MA 02111-1307, USA. */ #include #include +#include /* Global state for non-reentrent functions. */ @@ -40,18 +41,15 @@ __drand48_iterate (xsubi, buffer) /* Initialize buffer, if not yet done. */ if (!buffer->init) { - if (sizeof (unsigned short int) == 2) - { - buffer->a[2] = 0x5; - buffer->a[1] = 0xdeec; - buffer->a[0] = 0xe66d; - } - else - { - buffer->a[2] = 0x5deecUL; - buffer->a[1] = 0xe66d0000UL; - buffer->a[0] = 0; - } +#if (USHRT_MAX == 0xffffU) + buffer->a[2] = 0x5; + buffer->a[1] = 0xdeec; + buffer->a[0] = 0xe66d; +#else + buffer->a[2] = 0x5deecUL; + buffer->a[1] = 0xe66d0000UL; + buffer->a[0] = 0; +#endif buffer->c = 0xb; buffer->init = 1; } -- cgit v1.2.3