]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Get rid of the NTP_ prefix on our assertion macros. Harlan Stenn.
authorHarlan Stenn <stenn@ntp.org>
Thu, 16 Jul 2015 07:37:32 +0000 (07:37 +0000)
committerHarlan Stenn <stenn@ntp.org>
Thu, 16 Jul 2015 07:37:32 +0000 (07:37 +0000)
bk: 55a75f3cJWq-3zG-yQRj6dTU_bvPDA

27 files changed:
ChangeLog
include/ntp_assert.h
include/ntp_lists.h
libntp/atolfp.c
libntp/caljulian.c
libntp/caltontp.c
libntp/decodenetnum.c
libntp/msyslog.c
libntp/ntp_intres.c
libntp/ntp_rfc2553.c
libntp/prettydate.c
libntp/recvbuff.c
libntp/socket.c
libntp/socktohost.c
ntpd/ntp_config.c
ntpd/ntp_control.c
ntpd/ntp_crypto.c
ntpd/ntp_io.c
ntpd/ntp_monitor.c
ntpd/ntp_peer.c
ntpd/ntp_refclock.c
ntpd/ntp_restrict.c
ntpdc/ntpdc.c
ntpq/ntpq-subs.c
ports/winnt/libntp/termios.c
ports/winnt/ntpd/nt_clockstuff.c
ports/winnt/ntpd/ntp_iocompletionport.c

index aec5887ec848e48cf643684ca8065fa4ec40ae04..a689abab69ddb63a57c7ca0cb143dbf3cbd8e764 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,7 @@
 * tests/libntp/test_caltontp needs -lpthread.  Harlan Stenn.
 * br-flock: --enable-local-libevent.  Harlan Stenn.
 * scripts/lib/NTP/Util.pm: stratum output is version-dependent.  Harlan Stenn.
+* Get rid of the NTP_ prefix on our assertion macros.  Harlan Stenn.
 ---
 (4.2.8p3) 2015/06/29 Released by Harlan Stenn <stenn@ntp.org>
 
index 2f3bbc8a0b9b55fe2847f628ad6bd6f704edcd35..42d78acab0db8352fb8cec8031ad2ca61dc28c38 100644 (file)
@@ -88,10 +88,6 @@ extern void calysto_assert(unsigned char cnd); /* check whether this holds */
  * We initially used NTP_REQUIRE() instead of REQUIRE() etc, but that
  * is unneccesarily verbose, as libisc use of REQUIRE() etc shows.
  */
-#define        NTP_REQUIRE(x)          REQUIRE(x)
-#define        NTP_INSIST(x)           INSIST(x)
-#define        NTP_INVARIANT(x)        INVARIANT(x)
-#define        NTP_ENSURE(x)           ENSURE(x)
 
 # ifdef DEBUG
 #define        DEBUG_REQUIRE(x)        REQUIRE(x)
index 2b6e616965a7c8cf0a9bfaa096fa6267e608f00f..d741974943efa4a861cb3c0ddc5560720f79df0e 100644 (file)
@@ -215,9 +215,9 @@ do {                                                                \
                                                                \
        for (pentry = (listhead);                               \
             pentry != NULL;                                    \
-            pentry = pentry->nextlink)                       \
-               NTP_INSIST(pentry != pentry->nextlink);         \
-               NTP_INSIST((listhead) != pentry->nextlink);     \
+            pentry = pentry->nextlink) {                       \
+               INSIST(pentry != pentry->nextlink);             \
+               INSIST((listhead) != pentry->nextlink);         \
        }                                                       \
 } while (FALSE)
 
index 3a65f6bcb2f7c54e6c6d664350f31fee5232c322..9a2f6917873a722856668f6aa297db3d932c3e92 100644 (file)
@@ -40,7 +40,7 @@ atolfp(
        int isneg;
        static const char *digits = "0123456789";
 
-       NTP_REQUIRE(str != NULL);
+       REQUIRE(str != NULL);
 
        isneg = 0;
        dec_i = dec_f = 0;
index 6463699b152a3ebaf7721b654540123e115b73df..4a306033ad704d8eba493e56f34a8e0d4bd47abf 100644 (file)
@@ -28,7 +28,7 @@ caljulian(
        ntpcal_split    split;
        
        
-       NTP_INSIST(NULL != jt);
+       INSIST(NULL != jt);
 
        /*
         * Unfold ntp time around current time into NTP domain. Split
index 4246a6a5431ca8edc4109ba416508b372112a588..808c94c64afd46d7848e86ef01633efa19f0a31e 100644 (file)
@@ -40,14 +40,14 @@ caltontp(
        int32_t eraday; /* CE Rata Die number   */
        vint64  ntptime;/* resulting NTP time   */
 
-       NTP_INSIST(jt != NULL);
+       REQUIRE(jt != NULL);
 
-       NTP_REQUIRE(jt->month <= 13);   /* permit month 0..13! */
-       NTP_REQUIRE(jt->monthday <= 32);
-       NTP_REQUIRE(jt->yearday <= 366);
-       NTP_REQUIRE(jt->hour <= 24);
-       NTP_REQUIRE(jt->minute <= MINSPERHR);
-       NTP_REQUIRE(jt->second <= SECSPERMIN);
+       REQUIRE(jt->month <= 13);       /* permit month 0..13! */
+       REQUIRE(jt->monthday <= 32);
+       REQUIRE(jt->yearday <= 366);
+       REQUIRE(jt->hour <= 24);
+       REQUIRE(jt->minute <= MINSPERHR);
+       REQUIRE(jt->second <= SECSPERMIN);
 
        /*
         * First convert the date to he corresponding RataDie
index 187d5cae7e5b6d41d72920335c6a1ae20450c7ea..ebcb2da69f231ef1ba26e53cae4f18a810187586 100644 (file)
@@ -35,8 +35,8 @@ decodenetnum(
        char *np;
        char name[80];
 
-       NTP_REQUIRE(num != NULL);
-       NTP_REQUIRE(strlen(num) < sizeof(name));
+       REQUIRE(num != NULL);
+       REQUIRE(strlen(num) < sizeof(name));
 
        port_str = NULL;
        if ('[' != num[0]) {
@@ -72,7 +72,7 @@ decodenetnum(
        err = getaddrinfo(cp, "ntp", &hints, &ai);
        if (err != 0)
                return 0;
-       NTP_INSIST(ai->ai_addrlen <= sizeof(*netnum));
+       INSIST(ai->ai_addrlen <= sizeof(*netnum));
        ZERO(*netnum);
        memcpy(netnum, ai->ai_addr, ai->ai_addrlen);
        freeaddrinfo(ai);
index 283414d7442350065247b23e73b924e6c3bbd058..4e0aee5db07095984d34bd29d7c4ab3c81a57484 100644 (file)
@@ -454,7 +454,7 @@ change_logfile(
        size_t          octets;
 #endif /* POSIX */
 
-       NTP_REQUIRE(fname != NULL);
+       REQUIRE(fname != NULL);
        log_fname = fname;
 
        /*
index eea88a1273784fcfd345fecde2c621d61aac5d45..b0f562036a0084e86b1ab2638bae1f144a498d58 100644 (file)
@@ -249,12 +249,12 @@ getaddrinfo_sometime(
        size_t                  servsize;
        time_t                  now;
        
-       NTP_REQUIRE(NULL != node);
+       REQUIRE(NULL != node);
        if (NULL != hints) {
-               NTP_REQUIRE(0 == hints->ai_addrlen);
-               NTP_REQUIRE(NULL == hints->ai_addr);
-               NTP_REQUIRE(NULL == hints->ai_canonname);
-               NTP_REQUIRE(NULL == hints->ai_next);
+               REQUIRE(0 == hints->ai_addrlen);
+               REQUIRE(NULL == hints->ai_addr);
+               REQUIRE(NULL == hints->ai_canonname);
+               REQUIRE(NULL == hints->ai_next);
        }
 
        idx = get_dnschild_ctx();
@@ -420,7 +420,7 @@ blocking_getaddrinfo(
 
                ai = ai_res;
                while (NULL != ai) {
-                       NTP_INSIST(ai->ai_addrlen <= sizeof(sockaddr_u));
+                       INSIST(ai->ai_addrlen <= sizeof(sockaddr_u));
                        memcpy(cp, ai->ai_addr, ai->ai_addrlen);
                        cp += sizeof(sockaddr_u);
 
@@ -568,7 +568,7 @@ getaddrinfo_sometime_complete(
                        ai[i].ai_canonname += (size_t)canon_start;
        }
 
-       NTP_ENSURE((char *)psau == canon_start);
+       ENSURE((char *)psau == canon_start);
 
        if (!gai_resp->ai_count)
                ai = NULL;
@@ -634,8 +634,8 @@ getnameinfo_sometime(
        dnschild_ctx *          child_ctx;
        time_t                  time_now;
        
-       NTP_REQUIRE(hostoctets);
-       NTP_REQUIRE(hostoctets + servoctets < 1024);
+       REQUIRE(hostoctets);
+       REQUIRE(hostoctets + servoctets < 1024);
 
        idx = get_dnschild_ctx();
        child_ctx = dnschild_contexts[idx];
@@ -699,7 +699,7 @@ blocking_getnameinfo(
         * large allocations.  We only need room for the host
         * and service names.
         */
-       NTP_REQUIRE(octets < sizeof(host));
+       REQUIRE(octets < sizeof(host));
        service = host + gni_req->hostoctets;
 
        worker_ctx = get_worker_context(c, gni_req->dns_idx);
@@ -775,8 +775,8 @@ blocking_getnameinfo(
                cp += gni_resp->servoctets;
        }
 
-       NTP_INSIST((size_t)(cp - (char *)resp) == resp_octets);
-       NTP_INSIST(resp_octets - sizeof(*resp) == gni_resp->octets);
+       INSIST((size_t)(cp - (char *)resp) == resp_octets);
+       INSIST(resp_octets - sizeof(*resp) == gni_resp->octets);
 
        rc = queue_blocking_response(c, resp, resp_octets, req);
        if (rc)
index f267999c5e3faa95eca4458e91c19984c6521a37..a9ebb4b3536310bec4e97bd7d2211082b40af54d 100644 (file)
@@ -221,7 +221,7 @@ copy_addrinfo_common(
                }
                ++ai_cpy;
        }
-       NTP_ENSURE(pcanon == ((char *)dst + octets));
+       ENSURE(pcanon == ((char *)dst + octets));
 
        return dst;
 }
index 5da5ecc50a69d879dccf359b5f541b8400b0ec39..25b085ef28fb0ee857177a29b64dab12fed3068e 100644 (file)
@@ -141,7 +141,7 @@ get_struct_tm(
                        return NULL; /* That's truly pathological! */
 
        /* 'tm' surely not NULL here! */
-       NTP_INSIST(tm != NULL);
+       INSIST(tm != NULL);
        if (folds != 0) {
                tm->tm_year += folds * SOLAR_CYCLE_YEARS;
                if (tm->tm_year <= 0 || tm->tm_year >= 200)
index 83a9ee193a3b0b5cad9c7ff5eb5680eff30bf43a..73ebe886d9a7eb8dfb9a8a2e78233b69e3dd7f48 100644 (file)
@@ -216,7 +216,7 @@ get_free_recv_buffer_alloc(void)
                create_buffers(RECV_INC);
                buffer = get_free_recv_buffer();
        }
-       NTP_ENSURE(buffer != NULL);
+       ENSURE(buffer != NULL);
        return (buffer);
 }
 #endif
index de678c6340b4c23a2062c4e099ab4cab2c4fbbf2..11fb004690c4cffec4e1413ed35932a25718f737 100644 (file)
@@ -78,7 +78,7 @@ move_fd(
        static SOCKET socket_boundary = -1;
        SOCKET newfd;
 
-       NTP_REQUIRE((int)fd >= 0);
+       REQUIRE((int)fd >= 0);
 
        /*
         * check whether boundary has be set up
@@ -115,7 +115,7 @@ move_fd(
                          socket_boundary));
        } while (socket_boundary > 0);
 #else
-       NTP_REQUIRE((int)fd >= 0);
+       ENSURE((int)fd >= 0);
 #endif /* !defined(SYS_WINNT) && defined(F_DUPFD) */
        return fd;
 }
index c61e57148a65883436e802195aa4740ae643465d..3d9ab960e8a1fd2a7c6a31f312f2cea3107a7302 100644 (file)
@@ -79,7 +79,7 @@ socktohost(
        if (a_info)
                goto forward_fail;
 
-       NTP_INSIST(alist != NULL);
+       INSIST(alist != NULL);
 
        for (ai = alist; ai != NULL; ai = ai->ai_next) {
                /*
index 300773240c74be5cd745296af094f72e4e318e97..0ea5d455dbc74ac600eb859afdbdd84006527ac9 100644 (file)
@@ -1152,9 +1152,8 @@ create_address_node(
 {
        address_node *my_node;
 
-       NTP_REQUIRE(NULL != addr);
-       NTP_REQUIRE(AF_INET == type ||
-                   AF_INET6 == type || AF_UNSPEC == type);
+       REQUIRE(NULL != addr);
+       REQUIRE(AF_INET == type || AF_INET6 == type || AF_UNSPEC == type);
        my_node = emalloc_zero(sizeof(*my_node));
        my_node->address = addr;
        my_node->type = (u_short)type;
@@ -1170,7 +1169,7 @@ destroy_address_node(
 {
        if (NULL == my_node)
                return;
-       NTP_REQUIRE(NULL != my_node->address);
+       REQUIRE(NULL != my_node->address);
 
        free(my_node->address);
        free(my_node);
@@ -1567,7 +1566,7 @@ create_nic_rule_node(
 {
        nic_rule_node *my_node;
 
-       NTP_REQUIRE(match_class != 0 || if_name != NULL);
+       REQUIRE(match_class != 0 || if_name != NULL);
 
        my_node = emalloc_zero(sizeof(*my_node));
        my_node->match_class = match_class;
@@ -4880,9 +4879,9 @@ getnetnum(
        enum gnn_type a_type    /* ignored */
        )
 {
-       NTP_REQUIRE(AF_UNSPEC == AF(addr) ||
-                   AF_INET == AF(addr) ||
-                   AF_INET6 == AF(addr));
+       REQUIRE(AF_UNSPEC == AF(addr) ||
+               AF_INET == AF(addr) ||
+               AF_INET6 == AF(addr));
 
        if (!is_ip_address(num, AF(addr), addr))
                return 0;
index dac4ca80fc7a17ca9b6a64950bd7bbc16a777e38..2ed209bdf89d7b1c0cfaabc094986865548c1391 100644 (file)
@@ -1401,7 +1401,7 @@ ctl_putstr(
        memcpy(buffer, tag, tl);
        cp = buffer + tl;
        if (len > 0) {
-               NTP_INSIST(tl + 3 + len <= sizeof(buffer));
+               INSIST(tl + 3 + len <= sizeof(buffer));
                *cp++ = '=';
                *cp++ = '"';
                memcpy(cp, data, len);
@@ -1436,7 +1436,7 @@ ctl_putunqstr(
        memcpy(buffer, tag, tl);
        cp = buffer + tl;
        if (len > 0) {
-               NTP_INSIST(tl + 1 + len <= sizeof(buffer));
+               INSIST(tl + 1 + len <= sizeof(buffer));
                *cp++ = '=';
                memcpy(cp, data, len);
                cp += len;
@@ -1465,7 +1465,7 @@ ctl_putdblf(
        while (*cq != '\0')
                *cp++ = *cq++;
        *cp++ = '=';
-       NTP_INSIST((size_t)(cp - buffer) < sizeof(buffer));
+       INSIST((size_t)(cp - buffer) < sizeof(buffer));
        snprintf(cp, sizeof(buffer) - (cp - buffer), use_f ? "%.*f" : "%.*g",
            precision, d);
        cp += strlen(cp);
@@ -1491,7 +1491,7 @@ ctl_putuint(
                *cp++ = *cq++;
 
        *cp++ = '=';
-       NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+       INSIST((cp - buffer) < (int)sizeof(buffer));
        snprintf(cp, sizeof(buffer) - (cp - buffer), "%lu", uval);
        cp += strlen(cp);
        ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
@@ -1518,7 +1518,7 @@ ctl_putcal(
                        pcal->hour,
                        pcal->minute
                        );
-       NTP_INSIST(numch < sizeof(buffer));
+       INSIST(numch < sizeof(buffer));
        ctl_putdata(buffer, numch, 0);
 
        return;
@@ -1549,7 +1549,7 @@ ctl_putfs(
        tm = gmtime(&fstamp);
        if (NULL ==  tm)
                return;
-       NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+       INSIST((cp - buffer) < (int)sizeof(buffer));
        snprintf(cp, sizeof(buffer) - (cp - buffer),
                 "%04d%02d%02d%02d%02d", tm->tm_year + 1900,
                 tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min);
@@ -1578,7 +1578,7 @@ ctl_puthex(
                *cp++ = *cq++;
 
        *cp++ = '=';
-       NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+       INSIST((cp - buffer) < (int)sizeof(buffer));
        snprintf(cp, sizeof(buffer) - (cp - buffer), "0x%lx", uval);
        cp += strlen(cp);
        ctl_putdata(buffer,(unsigned)( cp - buffer ), 0);
@@ -1604,7 +1604,7 @@ ctl_putint(
                *cp++ = *cq++;
 
        *cp++ = '=';
-       NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+       INSIST((cp - buffer) < (int)sizeof(buffer));
        snprintf(cp, sizeof(buffer) - (cp - buffer), "%ld", ival);
        cp += strlen(cp);
        ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
@@ -1630,7 +1630,7 @@ ctl_putts(
                *cp++ = *cq++;
 
        *cp++ = '=';
-       NTP_INSIST((size_t)(cp - buffer) < sizeof(buffer));
+       INSIST((size_t)(cp - buffer) < sizeof(buffer));
        snprintf(cp, sizeof(buffer) - (cp - buffer), "0x%08x.%08x",
                 (u_int)ts->l_ui, (u_int)ts->l_uf);
        cp += strlen(cp);
@@ -1662,7 +1662,7 @@ ctl_putadr(
                cq = numtoa(addr32);
        else
                cq = stoa(addr);
-       NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+       INSIST((cp - buffer) < (int)sizeof(buffer));
        snprintf(cp, sizeof(buffer) - (cp - buffer), "%s", cq);
        cp += strlen(cp);
        ctl_putdata(buffer, (unsigned)(cp - buffer), 0);
@@ -1733,7 +1733,7 @@ ctl_putarray(
                if (i == 0)
                        i = NTP_SHIFT;
                i--;
-               NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+               INSIST((cp - buffer) < (int)sizeof(buffer));
                snprintf(cp, sizeof(buffer) - (cp - buffer),
                         " %.2f", arr[i] * 1e3);
                cp += strlen(cp);
@@ -3110,7 +3110,7 @@ read_peervars(void)
                        ctl_error(CERR_UNKNOWNVAR);
                        return;
                }
-               NTP_INSIST(v->code < COUNTOF(wants));
+               INSIST(v->code < COUNTOF(wants));
                wants[v->code] = 1;
                gotvar = 1;
        }
@@ -3153,19 +3153,19 @@ read_sysvars(void)
        gotvar = 0;
        while (NULL != (v = ctl_getitem(sys_var, &valuep))) {
                if (!(EOV & v->flags)) {
-                       NTP_INSIST(v->code < wants_count);
+                       INSIST(v->code < wants_count);
                        wants[v->code] = 1;
                        gotvar = 1;
                } else {
                        v = ctl_getitem(ext_sys_var, &valuep);
-                       NTP_INSIST(v != NULL);
+                       INSIST(v != NULL);
                        if (EOV & v->flags) {
                                ctl_error(CERR_UNKNOWNVAR);
                                free(wants);
                                return;
                        }
                        n = v->code + CS_MAXCODE + 1;
-                       NTP_INSIST(n < wants_count);
+                       INSIST(n < wants_count);
                        wants[n] = 1;
                        gotvar = 1;
                }
@@ -4399,7 +4399,7 @@ read_clockstatus(
                        gotvar = TRUE;
                } else {
                        v = ctl_getitem(kv, &valuep);
-                       NTP_INSIST(NULL != v);
+                       INSIST(NULL != v);
                        if (EOV & v->flags) {
                                ctl_error(CERR_UNKNOWNVAR);
                                free(wants);
@@ -4795,7 +4795,7 @@ report_event(
                for (i = 1; i <= CS_VARLIST; i++)
                        ctl_putsys(i);
        } else {
-               NTP_INSIST(peer != NULL);
+               INSIST(peer != NULL);
                rpkt.associd = htons(peer->associd);
                rpkt.status = htons(ctlpeerstatus(peer));
 
@@ -4900,7 +4900,7 @@ count_var(
        while (!(EOV & (k++)->flags))
                c++;
 
-       NTP_ENSURE(c <= USHRT_MAX);
+       ENSURE(c <= USHRT_MAX);
        return (u_short)c;
 }
 
index 45b2cdd00d3130d94e68cf87cbc412358a83baa6..cd767cc15d493e0ccebae1ce6fae39ad9e08bfe2 100644 (file)
@@ -380,7 +380,7 @@ make_keylist(
                EVP_SignUpdate(&ctx, (u_char *)vp, 12);
                EVP_SignUpdate(&ctx, vp->ptr, sizeof(struct autokey));
                if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
-                       NTP_INSIST(len <= sign_siglen);
+                       INSIST(len <= sign_siglen);
                        vp->siglen = htonl(len);
                        peer->flags |= FLAG_ASSOC;
                }
@@ -1591,7 +1591,7 @@ crypto_encrypt(
        EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
        EVP_SignUpdate(&ctx, vp->ptr, vallen);
        if (EVP_SignFinal(&ctx, vp->sig, &vallen, sign_pkey)) {
-               NTP_INSIST(vallen <= sign_siglen);
+               INSIST(vallen <= sign_siglen);
                vp->siglen = htonl(vallen);
        }
        return (XEVNT_OK);
@@ -1825,7 +1825,7 @@ crypto_update(void)
                EVP_SignUpdate(&ctx, (u_char *)&pubkey, 12);
                EVP_SignUpdate(&ctx, pubkey.ptr, ntohl(pubkey.vallen));
                if (EVP_SignFinal(&ctx, pubkey.sig, &len, sign_pkey)) {
-                       NTP_INSIST(len <= sign_siglen);
+                       INSIST(len <= sign_siglen);
                        pubkey.siglen = htonl(len);
                }
        }
@@ -1846,7 +1846,7 @@ crypto_update(void)
                EVP_SignUpdate(&ctx, cp->cert.ptr,
                    ntohl(cp->cert.vallen));
                if (EVP_SignFinal(&ctx, cp->cert.sig, &len, sign_pkey)) {
-                       NTP_INSIST(len <= sign_siglen);
+                       INSIST(len <= sign_siglen);
                        cp->cert.siglen = htonl(len);
                }
        }
@@ -1896,7 +1896,7 @@ crypto_update(void)
        EVP_SignUpdate(&ctx, (u_char *)&tai_leap, 12);
        EVP_SignUpdate(&ctx, tai_leap.ptr, len);
        if (EVP_SignFinal(&ctx, tai_leap.sig, &len, sign_pkey)) {
-               NTP_INSIST(len <= sign_siglen);
+               INSIST(len <= sign_siglen);
                tai_leap.siglen = htonl(len);
        }
        crypto_flags |= CRYPTO_FLAG_TAI;
@@ -1997,9 +1997,9 @@ asn_to_calendar   (
         * 100. Dontcha love ASN.1? Better than MIL-188.
         */
        len = asn1time->length;
-       NTP_REQUIRE(len < sizeof(v));
+       REQUIRE(len < sizeof(v));
        (void)strncpy(v, (char *)(asn1time->data), len);
-       NTP_REQUIRE(len >= 13);
+       REQUIRE(len >= 13);
        temp = strtoul(v+len-3, NULL, 10);
        pjd->second = temp;
        v[len-3] = '\0';
@@ -2169,7 +2169,7 @@ crypto_alice(
        EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
        EVP_SignUpdate(&ctx, vp->ptr, len);
        if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
-               NTP_INSIST(len <= sign_siglen);
+               INSIST(len <= sign_siglen);
                vp->siglen = htonl(len);
        }
        return (XEVNT_OK);
@@ -2279,7 +2279,7 @@ crypto_bob(
        EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
        EVP_SignUpdate(&ctx, vp->ptr, vallen);
        if (EVP_SignFinal(&ctx, vp->sig, &vallen, sign_pkey)) {
-               NTP_INSIST(vallen <= sign_siglen);
+               INSIST(vallen <= sign_siglen);
                vp->siglen = htonl(vallen);
        }
        return (XEVNT_OK);
@@ -2486,7 +2486,7 @@ crypto_alice2(
        EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
        EVP_SignUpdate(&ctx, vp->ptr, len);
        if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
-               NTP_INSIST(len <= sign_siglen);
+               INSIST(len <= sign_siglen);
                vp->siglen = htonl(len);
        }
        return (XEVNT_OK);
@@ -2586,7 +2586,7 @@ crypto_bob2(
        EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
        EVP_SignUpdate(&ctx, vp->ptr, len);
        if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
-               NTP_INSIST(len <= sign_siglen);
+               INSIST(len <= sign_siglen);
                vp->siglen = htonl(len);
        }
        return (XEVNT_OK);
@@ -2817,7 +2817,7 @@ crypto_alice3(
        EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
        EVP_SignUpdate(&ctx, vp->ptr, len);
        if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
-               NTP_INSIST(len <= sign_siglen);
+               INSIST(len <= sign_siglen);
                vp->siglen = htonl(len);
        }
        return (XEVNT_OK);
@@ -2919,7 +2919,7 @@ crypto_bob3(
        EVP_SignUpdate(&ctx, (u_char *)&vp->tstamp, 12);
        EVP_SignUpdate(&ctx, vp->ptr, len);
        if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
-               NTP_INSIST(len <= sign_siglen);
+               INSIST(len <= sign_siglen);
                vp->siglen = htonl(len);
        }
        return (XEVNT_OK);
@@ -3158,7 +3158,7 @@ cert_sign(
                EVP_SignUpdate(&ctx, (u_char *)vp, 12);
                EVP_SignUpdate(&ctx, vp->ptr, len);
                if (EVP_SignFinal(&ctx, vp->sig, &len, sign_pkey)) {
-                       NTP_INSIST(len <= sign_siglen);
+                       INSIST(len <= sign_siglen);
                        vp->siglen = htonl(len);
                }
        }
index a93733f824a26944dd69a8e016fb036da118db9d..136e9e9d44330531fd539a5a2ffc5141bbb18078 100644 (file)
@@ -371,7 +371,7 @@ maintain_activefds(
                                        maxactivefd = i;
                                        break;
                                }
-                       NTP_INSIST(fd != maxactivefd);
+                       INSIST(fd != maxactivefd);
                }
        }
 }
@@ -687,8 +687,8 @@ addr_samesubnet(
        const u_int32 * pm;
        size_t          loops;
 
-       NTP_REQUIRE(AF(a) == AF(a_mask));
-       NTP_REQUIRE(AF(b) == AF(b_mask));
+       REQUIRE(AF(a) == AF(a_mask));
+       REQUIRE(AF(b) == AF(b_mask));
        /*
         * With address and mask families verified to match, comparing
         * the masks also validates the address's families match.
@@ -735,8 +735,8 @@ is_ip_address(
        char tmpbuf[128];
        char *pch;
 
-       NTP_REQUIRE(host != NULL);
-       NTP_REQUIRE(addr != NULL);
+       REQUIRE(host != NULL);
+       REQUIRE(addr != NULL);
 
        ZERO_SOCK(addr);
 
@@ -1250,15 +1250,15 @@ add_nic_rule(
        rule->action = action;
 
        if (MATCH_IFNAME == match_type) {
-               NTP_REQUIRE(NULL != if_name);
+               REQUIRE(NULL != if_name);
                rule->if_name = estrdup(if_name);
        } else if (MATCH_IFADDR == match_type) {
-               NTP_REQUIRE(NULL != if_name);
+               REQUIRE(NULL != if_name);
                /* set rule->addr */
                is_ip = is_ip_address(if_name, AF_UNSPEC, &rule->addr);
-               NTP_REQUIRE(is_ip);
+               REQUIRE(is_ip);
        } else
-               NTP_REQUIRE(NULL == if_name);
+               REQUIRE(NULL == if_name);
 
        LINK_SLIST(nic_rule_list, rule, next);
 }
@@ -1278,7 +1278,7 @@ action_text(
                t = "ERROR";    /* quiet uninit warning */
                DPRINTF(1, ("fatal: unknown nic_rule_action %d\n",
                            action));
-               NTP_ENSURE(0);
+               ENSURE(0);
                break;
 
        case ACTION_LISTEN:
@@ -2397,7 +2397,7 @@ enable_multicast_if(
        u_int off6 = 0;
 #endif
 
-       NTP_REQUIRE(AF(maddr) == AF(&iface->sin));
+       REQUIRE(AF(maddr) == AF(&iface->sin));
 
        switch (AF(&iface->sin)) {
 
@@ -2629,7 +2629,7 @@ io_setbclient(void)
                        continue;
 
                /* Only IPv4 addresses are valid for broadcast */
-               NTP_REQUIRE(IS_IPV4(&interf->sin));
+               REQUIRE(IS_IPV4(&interf->sin));
 
                /* Do we already have the broadcast address open? */
                if (interf->flags & INT_BCASTOPEN) {
@@ -4079,7 +4079,7 @@ calc_addr_distance(
        int     a1_greater;
        int     i;
 
-       NTP_REQUIRE(AF(a1) == AF(a2));
+       REQUIRE(AF(a1) == AF(a2));
 
        ZERO_SOCK(dist);
        AF(dist) = AF(a1);
@@ -4130,7 +4130,7 @@ cmp_addr_distance(
 {
        int     i;
 
-       NTP_REQUIRE(AF(d1) == AF(d2));
+       REQUIRE(AF(d1) == AF(d2));
 
        if (IS_IPV4(d1)) {
                if (SRCADR(d1) < SRCADR(d2))
index 02fd757307daef532e4f682ebbecdd603498e593..44676b2b6b1759bf6f7c295f0edb2bc032a20fc1 100644 (file)
@@ -133,7 +133,7 @@ remove_from_hash(
        hash = MON_HASH(&mon->rmtadr);
        UNLINK_SLIST(punlinked, mon_hash[hash], mon, hash_next,
                     mon_entry);
-       NTP_ENSURE(punlinked == mon);
+       ENSURE(punlinked == mon);
 }
 
 
index d42d804d444d4515300dd948069725f97c8788ea..41dbae561f3238bd4421de9783eaec97915266fe 100644 (file)
@@ -764,7 +764,7 @@ newpeer(
        /*
         * For now only pool associations have a hostname.
         */
-       NTP_INSIST(NULL == hostname || (MDF_POOL & cast_flags));
+       INSIST(NULL == hostname || (MDF_POOL & cast_flags));
 
        /*
         * First search from the beginning for an association with given
index f0e9b9ec307dbf203ed1dc978cdf03ffb32b836c..1f16ca79710612b14b665934a7924575f47ce014 100644 (file)
@@ -1049,7 +1049,7 @@ refclock_control(
        if (NULL == peer)
                return;
 
-       NTP_INSIST(peer->procptr != NULL);
+       INSIST(peer->procptr != NULL);
        pp = peer->procptr;
 
        /*
index 9948d54d9e903657ee76395fd47083b4ec214910..dee705e8837c7fdfa0a252815c6b4c2096a8ff09 100644 (file)
@@ -173,7 +173,7 @@ alloc_res4(void)
                LINK_SLIST(resfree4, res, link);
                res = (void *)((char *)res - cb);
        }
-       NTP_INSIST(rl == res);
+       INSIST(rl == res);
        /* allocate the first */
        return res;
 }
@@ -199,7 +199,7 @@ alloc_res6(void)
                LINK_SLIST(resfree6, res, link);
                res = (void *)((char *)res - cb);
        }
-       NTP_INSIST(rl == res);
+       INSIST(rl == res);
        /* allocate the first */
        return res;
 }
@@ -223,7 +223,7 @@ free_res(
        else
                plisthead = &restrictlist4;
        UNLINK_SLIST(unlinked, *plisthead, res, link, restrict_u);
-       NTP_INSIST(unlinked == res);
+       INSIST(unlinked == res);
 
        if (v6) {
                zero_mem(res, V6_SIZEOF_RESTRICT_U);
@@ -291,7 +291,7 @@ match_restrict6_addr(
 
        for (res = restrictlist6; res != NULL; res = next) {
                next = res->link;
-               NTP_INSIST(next != res);
+               INSIST(next != res);
                if (res->expire &&
                    res->expire <= current_time)
                        free_res(res, v6);
@@ -494,8 +494,8 @@ hack_restrict(
                    op, stoa(resaddr), stoa(resmask), mflags, flags));
 
        if (NULL == resaddr) {
-               NTP_REQUIRE(NULL == resmask);
-               NTP_REQUIRE(RESTRICT_FLAGS == op);
+               REQUIRE(NULL == resmask);
+               REQUIRE(RESTRICT_FLAGS == op);
                restrict_source_flags = flags;
                restrict_source_mflags = mflags;
                restrict_source_enabled = 1;
@@ -528,7 +528,7 @@ hack_restrict(
                               &match.u.v6.mask);
 
        } else  /* not IPv4 nor IPv6 */
-               NTP_REQUIRE(0);
+               REQUIRE(0);
 
        match.flags = flags;
        match.mflags = mflags;
@@ -600,7 +600,7 @@ hack_restrict(
                break;
 
        default:        /* unknown op */
-               NTP_INSIST(0);
+               INSIST(0);
                break;
        }
 
@@ -626,7 +626,7 @@ restrict_source(
            IS_MCAST(addr) || ISREFCLOCKADR(addr))
                return;
 
-       NTP_REQUIRE(AF_INET == AF(addr) || AF_INET6 == AF(addr));
+       REQUIRE(AF_INET == AF(addr) || AF_INET6 == AF(addr));
 
        SET_HOSTMASK(&onesmask, AF(addr));
        if (farewell) {
index ce35bd4e23082f21bb0043b10032dc7ee951f215..8c07dac978e780e29f952cc957285e0c352058ff 100644 (file)
@@ -1443,7 +1443,7 @@ getnetnum(
                                    LENHOSTNAME, NULL, 0, 0);
                return 1;
        } else if (getaddrinfo(hname, "ntp", &hints, &ai) == 0) {
-               NTP_INSIST(sizeof(*num) >= ai->ai_addrlen);
+               INSIST(sizeof(*num) >= ai->ai_addrlen);
                memcpy(num, ai->ai_addr, ai->ai_addrlen);
                if (fullhost != NULL) {
                        if (ai->ai_canonname != NULL)
index c6478701eb2736536018028128379c469f404fdc..bfa5d2341d541428f065ff1571d31a8074f3c3e0 100644 (file)
@@ -2387,7 +2387,7 @@ add_mru(
                }
                UNLINK_DLIST(mon, mlink);
                UNLINK_SLIST(unlinked, hash_table[hash], mon, hlink, mru);
-               NTP_INSIST(unlinked == mon);
+               INSIST(unlinked == mon);
                mru_dupes++;
                TRACE(2, ("(updated from %08x.%08x) ", mon->last.l_ui,
                      mon->last.l_uf));
@@ -2482,7 +2482,7 @@ collect_mru_list(
        mru_count = 0;
        INIT_DLIST(mru_list, mlink);
        cb = NTP_HASH_SIZE * sizeof(*hash_table);
-       NTP_INSIST(NULL == hash_table);
+       INSIST(NULL == hash_table);
        hash_table = emalloc_zero(cb);
 
        c_mru_l_rc = FALSE;
@@ -2526,7 +2526,7 @@ collect_mru_list(
                                        ri);
                        while (ri--) {
                                recent = HEAD_DLIST(mru_list, mlink);
-                               NTP_INSIST(recent != NULL);
+                               INSIST(recent != NULL);
                                if (debug)
                                        fprintf(stderr,
                                                "tossing prior entry %s to resync\n",
@@ -2535,7 +2535,7 @@ collect_mru_list(
                                hash = NTP_HASH_ADDR(&recent->addr);
                                UNLINK_SLIST(unlinked, hash_table[hash],
                                             recent, hlink, mru);
-                               NTP_INSIST(unlinked == recent);
+                               INSIST(unlinked == recent);
                                free(recent);
                                mru_count--;
                        }
@@ -2777,7 +2777,7 @@ collect_mru_list(
                if (have_now)
                        list_complete = TRUE;
                if (list_complete) {
-                       NTP_INSIST(0 == ri || have_addr_older);
+                       INSIST(0 == ri || have_addr_older);
                }
                if (mrulist_interrupted) {
                        printf("mrulist retrieval interrupted by operator.\n"
@@ -3145,13 +3145,13 @@ mrulist(
        ppentry = sorted;
        if (MRUSORT_R_DEF != order) {
                ITER_DLIST_BEGIN(mru_list, recent, mlink, mru)
-                       NTP_INSIST(ppentry < sorted + mru_count);
+                       INSIST(ppentry < sorted + mru_count);
                        *ppentry = recent;
                        ppentry++;
                ITER_DLIST_END()
        } else {
                REV_ITER_DLIST_BEGIN(mru_list, recent, mlink, mru)
-                       NTP_INSIST(ppentry < sorted + mru_count);
+                       INSIST(ppentry < sorted + mru_count);
                        *ppentry = recent;
                        ppentry++;
                REV_ITER_DLIST_END()
index 5ac017dcd0359714e48eb0c0b45c4bd1b22103ca..4ee89899ba6f9ae06c0a368dd19ee3a1ff3205c7 100644 (file)
@@ -94,7 +94,7 @@ HANDLE common_serial_open(
        }
 
        if (NULL == hnds[unit].h) {
-               NTP_ENSURE(0 == hnds[unit].opens);
+               INSIST(0 == hnds[unit].opens);
                LIB_GETBUF(windev);
                snprintf(windev, LIB_BUFLENGTH, "\\\\.\\COM%d", unit);
                TRACE(1, ("windows device %s\n", windev));
index dc2f150b726adf2cbc5fefac8a6ac71a43405cb4..fdb3c475fbd07eb17eeeb1656feda782bdf7c820 100644 (file)
@@ -410,7 +410,7 @@ is_qpc_built_on_pcc(void)
        FT_ULL          ft4;
        FT_ULL          ft5;
 
-       NTP_REQUIRE(NomPerfCtrFreq != 0);
+       REQUIRE(NomPerfCtrFreq != 0);
 
        QueryPerformanceCounter(&ft1.li);
        ft2.ull = get_pcc();
index 046d6cda1e2b5c9c4a6be06f3a4dcdf4e3c30288..621852af0e9ef36139012d8163fe566dec1c97bc 100644 (file)
@@ -610,7 +610,7 @@ ntpd_addremove_semaphore(
                 * room, then append to the table array.
                 */
                if (hi >= ActiveWaitHandles) {
-                       NTP_INSIST(ActiveWaitHandles < COUNTOF(WaitHandles));
+                       INSIST(ActiveWaitHandles < COUNTOF(WaitHandles));
                        WaitHandles[ActiveWaitHandles] = sem;
                        ActiveWaitHandles++;
                }
@@ -758,7 +758,7 @@ OnSerialWaitComplete(
        buff = lpo->recv_buf;
        dev  = lpo->devCtx;
 
-       NTP_INSIST(rio == lpo->rio);
+       INSIST(rio == lpo->rio);
 
 #ifdef DEBUG
        if (~(EV_RXFLAG | EV_RLSD | EV_RXCHAR) & lpo->com_events) {
@@ -898,7 +898,7 @@ OnSerialReadComplete(
        /* get & validate context and buffer. */
        rio  = lpo->rio;
        buff = lpo->recv_buf;
-       NTP_INSIST((ULONG_PTR)rio == key);
+       INSIST((ULONG_PTR)rio == key);
 
        /* Offload to worker pool */
        if (!QueueUserWorkItem(&OnSerialReadWorker, lpo, WT_EXECUTEDEFAULT)) {
@@ -1074,7 +1074,7 @@ OnRawSerialReadComplete(
        /* get & validate context and buffer. */
        rio  = lpo->rio;
        buff = lpo->recv_buf;
-       NTP_INSIST((ULONG_PTR)rio == key);
+       INSIST((ULONG_PTR)rio == key);
 
        /* ignore 0 bytes read. */
        if (lpo->byteCount > 0) {
@@ -1395,8 +1395,8 @@ OnSocketRecv(
        recvbuf_t * newbuff;
        struct interface * inter = (struct interface *)key;
        
-       NTP_REQUIRE(NULL != lpo);
-       NTP_REQUIRE(NULL != lpo->recv_buf);
+       REQUIRE(NULL != lpo);
+       REQUIRE(NULL != lpo->recv_buf);
 
        /* check and bail out if operation failed */
        if (!IoResultCheck(lpo->errCode, lpo,
@@ -1432,8 +1432,7 @@ OnSocketRecv(
         * If we keep it add some info to the structure
         */
        if (buff->recv_length && !inter->ignore_packets) {
-               NTP_INSIST(buff->recv_srcadr_len <=
-                          sizeof(buff->recv_srcadr));
+               INSIST(buff->recv_srcadr_len <= sizeof(buff->recv_srcadr));
                buff->receiver = &receive; 
                buff->dstadr   = inter;
                packets_received++;