From 32556fc1560445b7f18d7a818a56884b6f98ed73 Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Tue, 8 May 2007 12:40:33 +0000 Subject: =?UTF-8?q?2007-05-08=09Ralf=20Cors=C3=A9pius=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * librpc/src/rpc/rtime.c: Use uint32_t instead of unsigned long for return value of ntohl (POSIX requirement). Use UINT32_C macros to avoid overflows on 16bit targets. Eliminate __P. --- cpukit/librpc/src/rpc/rtime.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cpukit/librpc/src/rpc') diff --git a/cpukit/librpc/src/rpc/rtime.c b/cpukit/librpc/src/rpc/rtime.c index a724350c48..33a4abe11b 100644 --- a/cpukit/librpc/src/rpc/rtime.c +++ b/cpukit/librpc/src/rpc/rtime.c @@ -52,18 +52,19 @@ #include #include #include +#include #if defined(LIBC_SCCS) && !defined(lint) /* from: static char sccsid[] = "@(#)rtime.c 2.2 88/08/10 4.0 RPCSRC; from 1.8 88/02/08 SMI"; */ static const char rcsid[] = "$FreeBSD: src/lib/libc/rpc/rtime.c,v 1.5 2000/01/27 23:06:41 jasone Exp $"; #endif -extern int _rpc_dtablesize __P(( void )); +extern int _rpc_dtablesize( void ); -#define NYEARS (unsigned long)(1970 - 1900) -#define TOFFSET (unsigned long)(60*60*24*(365*NYEARS + (NYEARS/4))) +#define NYEARS (UINT32_C(1970) - UINT32_C(1900)) +#define TOFFSET (UINT32_C(60)*UINT32_C(60)*UINT32_C(24)*(UINT32_C(365)*NYEARS + (NYEARS/UINT32_C(4)))) -static void do_close __P(( int )); +static void do_close( int ); int rtime(addrp, timep, timeout) @@ -74,7 +75,7 @@ rtime(addrp, timep, timeout) int s; fd_set readfds; int res; - unsigned long thetime; + uint32_t thetime; struct sockaddr_in from; socklen_t fromlen; int type; -- cgit v1.2.3