]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Miscellaneous cleanup for clean Windows build.
authorDanny Mayer <mayer@ntp.org>
Tue, 15 Apr 2003 05:32:13 +0000 (01:32 -0400)
committerDanny Mayer <mayer@ntp.org>
Tue, 15 Apr 2003 05:32:13 +0000 (01:32 -0400)
bk: 3e9b995d9fE2f9tIeVG6ocCq4viSDA

libntp/dofptoa.c
libntp/dolfptoa.c
ntpd/ntp_config.c
ntpd/ntp_crypto.c
ports/winnt/include/config.h

index 8d9427ff16e41fe844e363054371ec5c047003c8..0f96909f11751a9ddbd62a73011711c3ddb4871a 100644 (file)
@@ -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);
        }
 
index a155a59dc383f16bef8bd6c429f65afc33b4444b..7c92a305aca3b4091fd200a85bdb1f24881db2f5 100644 (file)
@@ -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);
        }
index 67e2a327744abe387c6a8790f9982ebf1a85293d..4b36bff3de5029fbf32a66afd1081a083a743d2f 100644 (file)
@@ -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:
index 8724a3c0e82d95ca0435574c6e885b9ef5d6a28a..9564cbab08ea7ad13d906e0e3f75c2c2373468f6 100644 (file)
@@ -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;
index 209fcaa854e064c2fec7e23f52d065bb372702d6..951c7352a2c3ce6004d0a87029a7271050b882d8 100644 (file)
 /* 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_