diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2007-05-08 12:40:33 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2007-05-08 12:40:33 +0000 |
commit | 32556fc1560445b7f18d7a818a56884b6f98ed73 (patch) | |
tree | 917d659caeec3fee4f3366fd034698c51ffa6404 /cpukit/librpc/src/rpc | |
parent | 2007-05-08 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-32556fc1560445b7f18d7a818a56884b6f98ed73.tar.bz2 |
2007-05-08 Ralf Corsépius <ralf.corsepius@rtems.org>
* 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.
Diffstat (limited to 'cpukit/librpc/src/rpc')
-rw-r--r-- | cpukit/librpc/src/rpc/rtime.c | 11 |
1 files changed, 6 insertions, 5 deletions
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 <stdio.h> #include <netdb.h> #include <sys/select.h> +#include <inttypes.h> #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; |