From: Danny Mayer Date: Tue, 15 Apr 2003 05:32:13 +0000 (-0400) Subject: Miscellaneous cleanup for clean Windows build. X-Git-Tag: NTP_4_1_80_RC1~47^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21cd667289f183a5e9791e1aa3d0937003821299;p=thirdparty%2Fntp.git Miscellaneous cleanup for clean Windows build. bk: 3e9b995d9fE2f9tIeVG6ocCq4viSDA --- diff --git a/libntp/dofptoa.c b/libntp/dofptoa.c index 8d9427ff1..0f96909f1 100644 --- a/libntp/dofptoa.c +++ b/libntp/dofptoa.c @@ -54,7 +54,7 @@ dofptoa( do { tmp = sv; sv = (u_short) (sv/ten); - *(--cp) = tmp - ((sv<<3) + (sv<<1)); + *(--cp) = (u_char)(tmp - ((sv<<3) + (sv<<1))); } while (sv != 0); } diff --git a/libntp/dolfptoa.c b/libntp/dolfptoa.c index a155a59dc..7c92a305a 100644 --- a/libntp/dolfptoa.c +++ b/libntp/dolfptoa.c @@ -60,7 +60,7 @@ dolfptoa( do { stmp = swork; swork = (u_short) (swork/sten); - stmp -= (swork<<3) + (swork<<1); + stmp = (u_short)(stmp - ((swork<<3) + (swork<<1))); *--cp = (u_char)stmp; } while (swork != 0); } diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index 67e2a3277..4b36bff3d 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -489,7 +489,7 @@ getconfig( int includelevel = 0; char line[MAXLINE]; char *(tokens[MAXTOKENS]); - int ntokens; + int ntokens = 0; int tok = CONFIG_UNKNOWN; struct interface *localaddr; struct refclockstat clock_stat; @@ -1072,7 +1072,7 @@ getconfig( #ifdef OPENSSL case CONFIG_REVOKE: if (ntokens >= 2) - sys_revoke = max(atoi(tokens[1]), KEY_REVOKE); + sys_revoke = (u_char) max(atoi(tokens[1]), KEY_REVOKE); break; case CONFIG_AUTOMAX: diff --git a/ntpd/ntp_crypto.c b/ntpd/ntp_crypto.c index 8724a3c0e..9564cbab0 100644 --- a/ntpd/ntp_crypto.c +++ b/ntpd/ntp_crypto.c @@ -254,7 +254,7 @@ make_keylist( tstamp_t tstamp; /* NTP timestamp */ struct autokey *ap; /* autokey pointer */ struct value *vp; /* value pointer */ - keyid_t keyid; /* next key ID */ + keyid_t keyid = 0; /* next key ID */ keyid_t cookie; /* private value */ u_long lifetime; u_int len; @@ -288,8 +288,7 @@ make_keylist( * included in the hash is zero if broadcast mode, the peer * cookie if client mode or the host cookie if symmetric modes. */ - lifetime = min(sys_automax, NTP_MAXSESSION * (1 << - (peer->kpoll))); + lifetime = min(sys_automax, (unsigned long) NTP_MAXSESSION * (1 <<(peer->kpoll))); if (peer->hmode == MODE_BROADCAST) cookie = 0; else @@ -301,7 +300,7 @@ make_keylist( cookie, lifetime); lifetime -= 1 << peer->kpoll; if (auth_havekey(keyid) || keyid <= NTP_MAXKEY || - lifetime <= (1 << (peer->kpoll))) + lifetime <= (unsigned long)(1 << (peer->kpoll))) break; } @@ -400,7 +399,7 @@ crypto_recv( ep = (struct exten *)pkt; code = ntohl(ep->opcode) & 0xffff0000; len = ntohl(ep->opcode) & 0x0000ffff; - associd = ntohl(pkt[1]); + associd = (associd_t) ntohl(pkt[1]); rval = XEVNT_OK; #ifdef DEBUG if (debug) @@ -867,7 +866,7 @@ crypto_recv( * Decrypt the cookie, hunting all the time for * errors. */ - if (vallen == EVP_PKEY_size(host_pkey)) { + if (vallen == (u_int) EVP_PKEY_size(host_pkey)) { RSA_private_decrypt(vallen, (u_char *)ep->pkt, (u_char *)&temp32, @@ -1167,7 +1166,7 @@ crypto_xmit( pkt = (u_int32 *)xpkt + start / 4; fp = (struct exten *)pkt; opcode = ntohl(ep->opcode); - associd = ntohl(ep->associd); + associd = (associd_t) ntohl(ep->associd); fp->associd = htonl(associd); len = 8; rval = XEVNT_OK; @@ -1530,7 +1529,7 @@ crypto_verify( */ } else if (pkey == NULL || peer->digest == NULL) { /* fall through */ - } else if (siglen != EVP_PKEY_size(pkey)) { + } else if (siglen != (u_int) EVP_PKEY_size(pkey)) { rval = XEVNT_SGL; } else { EVP_VerifyInit(&ctx, peer->digest); @@ -3598,7 +3597,8 @@ crypto_tai( tstamp_t fstamp; /* filestamp */ u_int len; char *ptr; - int rval, i; + int rval; + u_int i; #ifdef KERNEL_PLL #if NTP_API > 3 struct timex ntv; /* kernel interface structure */ @@ -3679,7 +3679,7 @@ crypto_tai( ptr = emalloc(len); tai_leap.ptr = (unsigned char *) ptr; for (; i >= 0; i--) { - *ptr++ = htonl(leapsec[i]); + *ptr++ = (char) htonl(leapsec[i]); } crypto_flags |= CRYPTO_FLAG_TAI; sys_tai = len / 4 + TAI_1972 - 1; diff --git a/ports/winnt/include/config.h b/ports/winnt/include/config.h index 209fcaa85..951c7352a 100644 --- a/ports/winnt/include/config.h +++ b/ports/winnt/include/config.h @@ -30,11 +30,6 @@ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 -/* Skip asynch rpc inclusion */ -#ifndef __RPCASYNC_H__ -#define __RPCASYNC_H__ -#endif - /* Prevent inclusion of winsock.h in windows.h */ #ifndef _WINSOCKAPI_ #define _WINSOCKAPI_