From 300c914c64953e3f27120fc454e75926943badf5 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 1 Sep 2006 18:15:01 +0000 Subject: *** empty log message *** --- cpukit/libnetworking/lib/rtems_bsdnet_ntp.c | 2 +- cpukit/libnetworking/lib/tftpDriver.c | 12 ++++++------ cpukit/libnetworking/libc/res_debug.c | 14 +++++++------- cpukit/libnetworking/rtems/rtems_bsdnet.h | 2 +- cpukit/libnetworking/rtems/rtems_glue.c | 2 +- cpukit/pppd/md4.c | 19 +++++++++++-------- cpukit/pppd/md4.h | 7 ++++--- cpukit/pppd/options.c | 16 ++++++++-------- 8 files changed, 39 insertions(+), 35 deletions(-) (limited to 'cpukit') diff --git a/cpukit/libnetworking/lib/rtems_bsdnet_ntp.c b/cpukit/libnetworking/lib/rtems_bsdnet_ntp.c index 3be505a972..a005018815 100644 --- a/cpukit/libnetworking/lib/rtems_bsdnet_ntp.c +++ b/cpukit/libnetworking/lib/rtems_bsdnet_ntp.c @@ -34,7 +34,7 @@ * UNIX base: 1970, January 1 * NTP base: 1900, January 1 */ -#define UNIX_BASE_TO_NTP_BASE (((70UL*365UL)+17UL) * (24*60*60)) +#define UNIX_BASE_TO_NTP_BASE (uint32_t)(((70UL*365UL)+17UL) * (24UL*60UL*60UL)) struct ntpPacket { struct ntpPacketSmall ntp; diff --git a/cpukit/libnetworking/lib/tftpDriver.c b/cpukit/libnetworking/lib/tftpDriver.c index 180f032219..0c0d21eaa9 100644 --- a/cpukit/libnetworking/lib/tftpDriver.c +++ b/cpukit/libnetworking/lib/tftpDriver.c @@ -56,8 +56,8 @@ int rtems_tftp_driver_debug = 1; /* * Default limits */ -#define PACKET_FIRST_TIMEOUT_MILLISECONDS 400 -#define PACKET_TIMEOUT_MILLISECONDS 6000 +#define PACKET_FIRST_TIMEOUT_MILLISECONDS 400L +#define PACKET_TIMEOUT_MILLISECONDS 6000L #define OPEN_RETRY_LIMIT 10 #define IO_RETRY_LIMIT 10 @@ -318,12 +318,12 @@ getPacket (struct tftpStream *tp, int retryCount) struct timeval tv; if (retryCount == 0) { - tv.tv_sec = PACKET_FIRST_TIMEOUT_MILLISECONDS / 1000; - tv.tv_usec = (PACKET_FIRST_TIMEOUT_MILLISECONDS % 1000) * 1000; + tv.tv_sec = PACKET_FIRST_TIMEOUT_MILLISECONDS / 1000L; + tv.tv_usec = (PACKET_FIRST_TIMEOUT_MILLISECONDS % 1000L) * 1000L; } else { - tv.tv_sec = PACKET_TIMEOUT_MILLISECONDS / 1000; - tv.tv_usec = (PACKET_TIMEOUT_MILLISECONDS % 1000) * 1000; + tv.tv_sec = PACKET_TIMEOUT_MILLISECONDS / 1000L; + tv.tv_usec = (PACKET_TIMEOUT_MILLISECONDS % 1000L) * 1000L; } setsockopt (tp->socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv); for (;;) { diff --git a/cpukit/libnetworking/libc/res_debug.c b/cpukit/libnetworking/libc/res_debug.c index 4ea4aec144..7dc54694ef 100644 --- a/cpukit/libnetworking/libc/res_debug.c +++ b/cpukit/libnetworking/libc/res_debug.c @@ -545,8 +545,8 @@ p_time(u_int32_t value) { * by 60*60*1000 for that. */ -static unsigned int poweroften[10] = {1, 10, 100, 1000, 10000, 100000, - 1000000,10000000,100000000,1000000000}; +static uint32_t poweroften[10] = {1, 10, 100, 1000, 10000, 100000, + 1000000,10000000,100000000,1000000000}; /* takes an XeY precision/size value, returns a string representation. */ static const char * @@ -555,7 +555,7 @@ precsize_ntoa(prec) { static char retbuf[sizeof "90000000.00"]; unsigned long val; - int mantissa, exponent; + uint32_t mantissa, exponent; mantissa = (int)((prec >> 4) & 0x0f) % 10; exponent = (int)((prec >> 0) & 0x0f) % 10; @@ -664,13 +664,13 @@ latlon2ul(latlonstrptr,which) switch (*cp) { case 'N': case 'n': case 'E': case 'e': - retval = ((unsigned)1<<31) + retval = ((u_int32_t)1<<31) + (((((deg * 60) + min) * 60) + secs) * 1000) + secsfrac; break; case 'S': case 's': case 'W': case 'w': - retval = ((unsigned)1<<31) + retval = ((u_int32_t)1<<31) - (((((deg * 60) + min) * 60) + secs) * 1000) - secsfrac; break; @@ -853,10 +853,10 @@ loc_ntoa(binary, ascii) vpval = *cp++; GETLONG(templ, cp); - latval = (templ - ((unsigned)1<<31)); + latval = (templ - ((u_int32_t)1<<31)); GETLONG(templ, cp); - longval = (templ - ((unsigned)1<<31)); + longval = (templ - ((u_int32_t)1<<31)); GETLONG(templ, cp); if (templ < referencealt) { /* below WGS 84 spheroid */ diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet.h b/cpukit/libnetworking/rtems/rtems_bsdnet.h index 3112779078..059e6be993 100644 --- a/cpukit/libnetworking/rtems/rtems_bsdnet.h +++ b/cpukit/libnetworking/rtems/rtems_bsdnet.h @@ -42,7 +42,7 @@ extern struct in_addr rtems_bsdnet_bootp_server_address; extern char *rtems_bsdnet_bootp_server_name; extern char *rtems_bsdnet_bootp_boot_file_name; extern char *rtems_bsdnet_bootp_cmdline; -extern long rtems_bsdnet_timeoffset; +extern int32_t rtems_bsdnet_timeoffset; /* * Manipulate routing tables diff --git a/cpukit/libnetworking/rtems/rtems_glue.c b/cpukit/libnetworking/rtems/rtems_glue.c index 4fb92f442b..edd72cf499 100644 --- a/cpukit/libnetworking/rtems/rtems_glue.c +++ b/cpukit/libnetworking/rtems/rtems_glue.c @@ -97,7 +97,7 @@ static struct in_addr _rtems_bsdnet_ntpserver[sizeof rtems_bsdnet_config.ntp_ser sizeof rtems_bsdnet_config.ntp_server[0]]; struct in_addr *rtems_bsdnet_ntpserver = _rtems_bsdnet_ntpserver; int rtems_bsdnet_ntpserver_count = 0; -long rtems_bsdnet_timeoffset = 0; +int32_t rtems_bsdnet_timeoffset = 0; /* * Perform FreeBSD memory allocation. diff --git a/cpukit/pppd/md4.c b/cpukit/pppd/md4.c index 17f1021f8c..dd5ffa1e6b 100644 --- a/cpukit/pppd/md4.c +++ b/cpukit/pppd/md4.c @@ -40,14 +40,16 @@ #include "md4.h" #include "pppd.h" +#include + /* Compile-time declarations of MD4 "magic constants". */ -#define I0 0x67452301 /* Initial values for MD buffer */ -#define I1 0xefcdab89 -#define I2 0x98badcfe -#define I3 0x10325476 -#define C2 013240474631 /* round 2 constant = sqrt(2) in octal */ -#define C3 015666365641 /* round 3 constant = sqrt(3) in octal */ +#define I0 0x67452301L /* Initial values for MD buffer */ +#define I1 0xefcdab89L +#define I2 0x98badcfeL +#define I3 0x10325476L +#define C2 013240474631L /* round 2 constant = sqrt(2) in octal */ +#define C3 015666365641L /* round 3 constant = sqrt(3) in octal */ /* C2 and C3 are from Knuth, The Art of Programming, Volume 2 ** (Seminumerical Algorithms), Second Edition (1981), Addison-Wesley. ** Table 2, page 660. @@ -93,7 +95,7 @@ MD4_CTX *MDp; int i,j; for (i=0;i<4;i++) for (j=0;j<32;j=j+8) - printf("%02x",(MDp->buffer[i]>>j) & 0xFF); + printf("%02" PRIx32,(MDp->buffer[i]>>j) & 0xFF); } /* MD4Init(MDp) @@ -129,7 +131,8 @@ unsigned char *Xb; int i; for (i = 0; i < 16; ++i) { - X[i] = Xb[0] + (Xb[1] << 8) + (Xb[2] << 16) + (Xb[3] << 24); + X[i] = Xb[0] + ((uint32_t)Xb[1] << 8) + + ((uint32_t)Xb[2] << 16) + ((uint32_t)Xb[3] << 24); Xb += 4; } diff --git a/cpukit/pppd/md4.h b/cpukit/pppd/md4.h index 80e8f9a2ac..9f2187d866 100644 --- a/cpukit/pppd/md4.h +++ b/cpukit/pppd/md4.h @@ -16,13 +16,14 @@ # endif #endif +#include /* MDstruct is the data structure for a message digest computation. */ typedef struct { - unsigned int buffer[4]; /* Holds 4-word result of MD computation */ - unsigned char count[8]; /* Number of bits processed so far */ - unsigned int done; /* Nonzero means MD computation finished */ + uint32_t buffer[4]; /* Holds 4-word result of MD computation */ + uint8_t count[8]; /* Number of bits processed so far */ + uint32_t done; /* Nonzero means MD computation finished */ } MD4_CTX; /* MD4Init(MD4_CTX *) diff --git a/cpukit/pppd/options.c b/cpukit/pppd/options.c index fb686d94a6..8b2b201aeb 100644 --- a/cpukit/pppd/options.c +++ b/cpukit/pppd/options.c @@ -1242,7 +1242,7 @@ setspeed(arg) char *arg; { int spd; - int ret = (int )1; + uint32_t ret = (int)1; speed_t spdValue = (speed_t)0; char *ptr; @@ -1253,25 +1253,25 @@ setspeed(arg) } else { switch ( spd ) { - case 2400: + case 2400L: spdValue = B2400; break; - case 4800: + case 4800L: spdValue = B4800; break; - case 9600: + case 9600L: spdValue = B9600; break; - case 19200: + case 19200L: spdValue = B19200; break; - case 38400: + case 38400L: spdValue = B38400; break; - case 57600: + case 57600L: spdValue = B57600; break; - case 115200: + case 115200L: spdValue = B115200; break; default: -- cgit v1.2.3