Changeset 32556fc in rtems for cpukit/librpc


Ignore:
Timestamp:
May 8, 2007, 12:40:33 PM (13 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
678b3b06
Parents:
161016b
Message:

2007-05-08 Ralf Corsépius <ralf.corsepius@…>

  • 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/librpc/src/rpc/rtime.c

    r161016b r32556fc  
    5353#include <netdb.h>
    5454#include <sys/select.h>
     55#include <inttypes.h>
    5556
    5657#if defined(LIBC_SCCS) && !defined(lint)
     
    5960#endif
    6061
    61 extern int _rpc_dtablesize __P(( void ));
     62extern int _rpc_dtablesize( void );
    6263
    63 #define NYEARS  (unsigned long)(1970 - 1900)
    64 #define TOFFSET (unsigned long)(60*60*24*(365*NYEARS + (NYEARS/4)))
     64#define NYEARS  (UINT32_C(1970) - UINT32_C(1900))
     65#define TOFFSET (UINT32_C(60)*UINT32_C(60)*UINT32_C(24)*(UINT32_C(365)*NYEARS + (NYEARS/UINT32_C(4))))
    6566
    66 static void do_close __P(( int ));
     67static void do_close( int );
    6768
    6869int
     
    7576        fd_set readfds;
    7677        int res;
    77         unsigned long thetime;
     78        uint32_t thetime;
    7879        struct sockaddr_in from;
    7980        socklen_t fromlen;
Note: See TracChangeset for help on using the changeset viewer.