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/pppd/md4.c | 19 +++++++++++-------- cpukit/pppd/md4.h | 7 ++++--- cpukit/pppd/options.c | 16 ++++++++-------- 3 files changed, 23 insertions(+), 19 deletions(-) (limited to 'cpukit/pppd') 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