[Git][NTPsec/ntpsec][master] 4 commits: assert: replace NTP_REQUIRE, NTP_INSIST, NTP_INVARIANT, NTP_ENSURE
Gary E. Miller
gitlab at mg.gitlab.com
Fri Jun 2 03:22:15 UTC 2017
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
99c5f581 by Gary E. Miller at 2017-06-01T19:43:54-07:00
assert: replace NTP_REQUIRE, NTP_INSIST, NTP_INVARIANT, NTP_ENSURE
They just added another layer of macro indirection. They used to be:
So no functional change.
- - - - -
936430b4 by Gary E. Miller at 2017-06-01T20:02:14-07:00
assert: remove shim macro ALWAYS_INSIST().
Just another level of pointless indirection.
- - - - -
aee91275 by Gary E. Miller at 2017-06-01T20:10:05-07:00
assert: remove redundant definitions of REQUIRE(), etc.
- - - - -
5c4c69db by Gary E. Miller at 2017-06-01T20:20:18-07:00
assert: move isc/assertions.h into ntp-assert.h
They were all tangled up anyway. This sets up more redundancy removal.
- - - - -
14 changed files:
- include/ntp_assert.h
- include/ntp_lists.h
- libisc/assertions.c
- − libisc/include/isc/assertions.h
- libisc/include/isc/util.h
- libntp/decodenetnum.c
- libntp/msyslog.c
- libntp/socket.c
- ntpd/ntp_config.c
- ntpd/ntp_control.c
- ntpd/ntp_io.c
- ntpd/ntp_monitor.c
- ntpd/ntp_restrict.c
- tests/libntp/strtolfp.c
Changes:
=====================================
include/ntp_assert.h
=====================================
--- a/include/ntp_assert.h
+++ b/include/ntp_assert.h
@@ -1,6 +1,11 @@
/*
* ntp_assert.h - design by contract stuff
*
+ * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 1997-2001 Internet Software Consortium.
+ * Copyright 2015 by the NTPsec project contributors
+ * SPDX-License-Identifier: ISC
+ *
* example:
*
* int foo(char *a) {
@@ -48,35 +53,116 @@
#include <assert.h>
#define ALWAYS_REQUIRE(x) assert(x)
-#define ALWAYS_INSIST(x) assert(x)
+#define INSIST(x) assert(x)
#define ALWAYS_INVARIANT(x) assert(x)
#define ALWAYS_ENSURE(x) assert(x)
# else /* not FlexeLint */
-#include "isc/assertions.h"
+/*% isc assertion type */
+typedef enum {
+ isc_assertiontype_require,
+ isc_assertiontype_ensure,
+ isc_assertiontype_insist,
+ isc_assertiontype_invariant
+} isc_assertiontype_t;
+
+typedef void (*isc_assertioncallback_t)(const char *, int, isc_assertiontype_t,
+ const char *);
+
+/* coverity[+kill] */
+ISC_PLATFORM_NORETURN_PRE
+void isc_assertion_failed(const char *, int, isc_assertiontype_t,
+ const char *) ISC_PLATFORM_NORETURN_POST;
+
+void
+isc_assertion_setcallback(isc_assertioncallback_t);
+
+const char *
+isc_assertion_typetotext(isc_assertiontype_t type)
+ __attribute__((const));
+
+#if defined(ISC_CHECK_ALL) || defined(__COVERITY__)
+#define ISC_CHECK_REQUIRE 1
+#define ISC_CHECK_ENSURE 1
+#define ISC_CHECK_INSIST 1
+#define ISC_CHECK_INVARIANT 1
+#endif
+
+#if defined(ISC_CHECK_NONE) && !defined(__COVERITY__)
+#define ISC_CHECK_REQUIRE 0
+#define ISC_CHECK_ENSURE 0
+#define ISC_CHECK_INSIST 0
+#define ISC_CHECK_INVARIANT 0
+#endif
+
+#ifndef ISC_CHECK_REQUIRE
+#define ISC_CHECK_REQUIRE 1
+#endif
+
+#ifndef ISC_CHECK_ENSURE
+#define ISC_CHECK_ENSURE 1
+#endif
+
+#ifndef ISC_CHECK_INSIST
+#define ISC_CHECK_INSIST 1
+#endif
+
+#ifndef ISC_CHECK_INVARIANT
+#define ISC_CHECK_INVARIANT 1
+#endif
+
+#if ISC_CHECK_REQUIRE != 0
+#define ISC_REQUIRE(cond) \
+ ((void) ((cond) || \
+ ((isc_assertion_failed)(__FILE__, __LINE__, \
+ isc_assertiontype_require, \
+ #cond), 0)))
+#else
+#define ISC_REQUIRE(cond) ((void) 0)
+#endif /* ISC_CHECK_REQUIRE */
+
+#if ISC_CHECK_ENSURE != 0
+#define ISC_ENSURE(cond) \
+ ((void) ((cond) || \
+ ((isc_assertion_failed)(__FILE__, __LINE__, \
+ isc_assertiontype_ensure, \
+ #cond), 0)))
+#else
+#define ISC_ENSURE(cond) ((void) 0)
+#endif /* ISC_CHECK_ENSURE */
+
+#if ISC_CHECK_INSIST != 0
+#define ISC_INSIST(cond) \
+ ((void) ((cond) || \
+ ((isc_assertion_failed)(__FILE__, __LINE__, \
+ isc_assertiontype_insist, \
+ #cond), 0)))
+#else
+#define ISC_INSIST(cond) ((void) 0)
+#endif /* ISC_CHECK_INSIST */
+
+#if ISC_CHECK_INVARIANT != 0
+#define ISC_INVARIANT(cond) \
+ ((void) ((cond) || \
+ ((isc_assertion_failed)(__FILE__, __LINE__, \
+ isc_assertiontype_invariant, \
+ #cond), 0)))
+#else
+#define ISC_INVARIANT(cond) ((void) 0)
+#endif /* ISC_CHECK_INVARIANT */
#define ALWAYS_REQUIRE(x) ISC_REQUIRE(x)
-#define ALWAYS_INSIST(x) ISC_INSIST(x)
+#define INSIST(x) ISC_INSIST(x)
#define ALWAYS_INVARIANT(x) ISC_INVARIANT(x)
#define ALWAYS_ENSURE(x) ISC_ENSURE(x)
# endif /* not FlexeLint */
#define REQUIRE(x) ALWAYS_REQUIRE(x)
-#define INSIST(x) ALWAYS_INSIST(x)
#define INVARIANT(x) ALWAYS_INVARIANT(x)
#define ENSURE(x) ALWAYS_ENSURE(x)
-/*
- * We initially used NTP_REQUIRE() instead of REQUIRE() etc, but that
- * is unnecessarily 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)
#define DEBUG_INSIST(x) INSIST(x)
=====================================
include/ntp_lists.h
=====================================
--- a/include/ntp_lists.h
+++ b/include/ntp_lists.h
@@ -216,8 +216,8 @@ do { \
for (pentry = (listhead); \
pentry != NULL; \
pentry = pentry->nextlink){ \
- NTP_INSIST(pentry != pentry->nextlink); \
- NTP_INSIST((listhead) != pentry->nextlink); \
+ INSIST(pentry != pentry->nextlink); \
+ INSIST((listhead) != pentry->nextlink); \
} \
} while (false)
=====================================
libisc/assertions.c
=====================================
--- a/libisc/assertions.c
+++ b/libisc/assertions.c
@@ -12,7 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "isc/assertions.h"
+#include "ntp_assert.h"
#include "isc/backtrace.h"
#include "isc/result.h"
=====================================
libisc/include/isc/assertions.h deleted
=====================================
--- a/libisc/include/isc/assertions.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- * Copyright (C) 1997-2001 Internet Software Consortium.
- * Copyright 2015 by the NTPsec project contributors
- * SPDX-License-Identifier: ISC
- */
-
-/*! \file isc/assertions.h
- */
-
-#ifndef GUARD_ISC_ASSERTIONS_H
-#define GUARD_ISC_ASSERTIONS_H 1
-
-/*% isc assertion type */
-typedef enum {
- isc_assertiontype_require,
- isc_assertiontype_ensure,
- isc_assertiontype_insist,
- isc_assertiontype_invariant
-} isc_assertiontype_t;
-
-typedef void (*isc_assertioncallback_t)(const char *, int, isc_assertiontype_t,
- const char *);
-
-/* coverity[+kill] */
-ISC_PLATFORM_NORETURN_PRE
-void isc_assertion_failed(const char *, int, isc_assertiontype_t,
- const char *) ISC_PLATFORM_NORETURN_POST;
-
-void
-isc_assertion_setcallback(isc_assertioncallback_t);
-
-const char *
-isc_assertion_typetotext(isc_assertiontype_t type)
- __attribute__((const));
-
-#if defined(ISC_CHECK_ALL) || defined(__COVERITY__)
-#define ISC_CHECK_REQUIRE 1
-#define ISC_CHECK_ENSURE 1
-#define ISC_CHECK_INSIST 1
-#define ISC_CHECK_INVARIANT 1
-#endif
-
-#if defined(ISC_CHECK_NONE) && !defined(__COVERITY__)
-#define ISC_CHECK_REQUIRE 0
-#define ISC_CHECK_ENSURE 0
-#define ISC_CHECK_INSIST 0
-#define ISC_CHECK_INVARIANT 0
-#endif
-
-#ifndef ISC_CHECK_REQUIRE
-#define ISC_CHECK_REQUIRE 1
-#endif
-
-#ifndef ISC_CHECK_ENSURE
-#define ISC_CHECK_ENSURE 1
-#endif
-
-#ifndef ISC_CHECK_INSIST
-#define ISC_CHECK_INSIST 1
-#endif
-
-#ifndef ISC_CHECK_INVARIANT
-#define ISC_CHECK_INVARIANT 1
-#endif
-
-#if ISC_CHECK_REQUIRE != 0
-#define ISC_REQUIRE(cond) \
- ((void) ((cond) || \
- ((isc_assertion_failed)(__FILE__, __LINE__, \
- isc_assertiontype_require, \
- #cond), 0)))
-#else
-#define ISC_REQUIRE(cond) ((void) 0)
-#endif /* ISC_CHECK_REQUIRE */
-
-#if ISC_CHECK_ENSURE != 0
-#define ISC_ENSURE(cond) \
- ((void) ((cond) || \
- ((isc_assertion_failed)(__FILE__, __LINE__, \
- isc_assertiontype_ensure, \
- #cond), 0)))
-#else
-#define ISC_ENSURE(cond) ((void) 0)
-#endif /* ISC_CHECK_ENSURE */
-
-#if ISC_CHECK_INSIST != 0
-#define ISC_INSIST(cond) \
- ((void) ((cond) || \
- ((isc_assertion_failed)(__FILE__, __LINE__, \
- isc_assertiontype_insist, \
- #cond), 0)))
-#else
-#define ISC_INSIST(cond) ((void) 0)
-#endif /* ISC_CHECK_INSIST */
-
-#if ISC_CHECK_INVARIANT != 0
-#define ISC_INVARIANT(cond) \
- ((void) ((cond) || \
- ((isc_assertion_failed)(__FILE__, __LINE__, \
- isc_assertiontype_invariant, \
- #cond), 0)))
-#else
-#define ISC_INVARIANT(cond) ((void) 0)
-#endif /* ISC_CHECK_INVARIANT */
-
-#endif /* GUARD_ISC_ASSERTIONS_H */
=====================================
libisc/include/isc/util.h
=====================================
--- a/libisc/include/isc/util.h
+++ b/libisc/include/isc/util.h
@@ -55,16 +55,7 @@
/*
* Assertions
*/
-#include "isc/assertions.h" /* Contractual promise. */
-
-/*% Require Assertion */
-#define REQUIRE(e) ISC_REQUIRE(e)
-/*% Ensure Assertion */
-#define ENSURE(e) ISC_ENSURE(e)
-/*% Insist Assertion */
-#define INSIST(e) ISC_INSIST(e)
-/*% Invariant Assertion */
-#define INVARIANT(e) ISC_INVARIANT(e)
+#include "ntp_assert.h" /* Contractual promise. */
/*
* Errors
=====================================
libntp/decodenetnum.c
=====================================
--- a/libntp/decodenetnum.c
+++ b/libntp/decodenetnum.c
@@ -132,7 +132,7 @@ decodenetnum(
return retcode;
}
- NTP_INSIST(ai->ai_addrlen <= sizeof(*netnum));
+ INSIST(ai->ai_addrlen <= sizeof(*netnum));
if(netnum) {
memcpy(netnum, ai->ai_addr, ai->ai_addrlen);
}
=====================================
libntp/msyslog.c
=====================================
--- a/libntp/msyslog.c
+++ b/libntp/msyslog.c
@@ -364,7 +364,7 @@ change_logfile(
size_t cd_octets;
size_t octets;
- //NTP_REQUIRE(fname != NULL);
+ //REQUIRE(fname != NULL);
log_fname = fname;
/*
=====================================
libntp/socket.c
=====================================
--- a/libntp/socket.c
+++ b/libntp/socket.c
@@ -70,7 +70,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
@@ -107,7 +107,7 @@ move_fd(
socket_boundary));
} while (socket_boundary > 0);
#else
- NTP_REQUIRE((int)fd >= 0);
+ REQUIRE((int)fd >= 0);
#endif /* defined(F_DUPFD) */
return fd;
}
=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -546,8 +546,8 @@ create_address_node(
{
address_node *my_node;
- NTP_REQUIRE(NULL != addr);
- NTP_REQUIRE(AF_INET == 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;
@@ -564,7 +564,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);
@@ -1070,7 +1070,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;
@@ -3369,7 +3369,7 @@ getnetnum(
)
{
- NTP_REQUIRE(AF_UNSPEC == AF(addr) ||
+ REQUIRE(AF_UNSPEC == AF(addr) ||
AF_INET == AF(addr) ||
AF_INET6 == AF(addr));
=====================================
ntpd/ntp_control.c
=====================================
--- a/ntpd/ntp_control.c
+++ b/ntpd/ntp_control.c
@@ -1169,7 +1169,7 @@ ctl_putdblf(
while (*cq != '\0' && cp < buffer + sizeof(buffer) - 1)
*cp++ = *cq++;
*cp++ = '=';
- NTP_INSIST((size_t)(cp - buffer) < sizeof(buffer));
+ INSIST((size_t)(cp - buffer) < sizeof(buffer));
snprintf(cp, sizeof(buffer) - (size_t)(cp - buffer),
use_f ? "%.*f" : "%.*g",
precision, d);
@@ -1196,7 +1196,7 @@ ctl_putuint(
*cp++ = *cq++;
*cp++ = '=';
- NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+ INSIST((cp - buffer) < (int)sizeof(buffer));
snprintf(cp, sizeof(buffer) - (size_t)(cp - buffer), "%lu", uval);
cp += strlen(cp);
ctl_putdata(buffer, (unsigned)( cp - buffer ), false);
@@ -1226,7 +1226,7 @@ ctl_puttime(
tm = gmtime_r(&fstamp, &tmbuf);
if (NULL == tm)
return;
- NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+ INSIST((cp - buffer) < (int)sizeof(buffer));
snprintf(cp, sizeof(buffer) - (size_t)(cp - buffer),
"%04d-%02d-%02dT%02d:%02dZ", tm->tm_year + 1900,
tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min);
@@ -1255,7 +1255,7 @@ ctl_puthex(
*cp++ = *cq++;
*cp++ = '=';
- NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+ INSIST((cp - buffer) < (int)sizeof(buffer));
snprintf(cp, sizeof(buffer) - (size_t)(cp - buffer), "0x%lx", uval);
cp += strlen(cp);
ctl_putdata(buffer,(unsigned)( cp - buffer ), false);
@@ -1281,7 +1281,7 @@ ctl_putint(
*cp++ = *cq++;
*cp++ = '=';
- NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+ INSIST((cp - buffer) < (int)sizeof(buffer));
snprintf(cp, sizeof(buffer) - (size_t)(cp - buffer), "%ld", ival);
cp += strlen(cp);
ctl_putdata(buffer, (unsigned)( cp - buffer ), false);
@@ -1307,7 +1307,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) - (size_t)(cp - buffer), "0x%08x.%08x",
(u_int)lfpuint(*ts), (u_int)lfpfrac(*ts));
cp += strlen(cp);
@@ -1339,7 +1339,7 @@ ctl_putadr(
cq = numtoa(addr32);
else
cq = socktoa(addr);
- NTP_INSIST((cp - buffer) < (int)sizeof(buffer));
+ INSIST((cp - buffer) < (int)sizeof(buffer));
snprintf(cp, sizeof(buffer) - (size_t)(cp - buffer), "%s", cq);
cp += strlen(cp);
ctl_putdata(buffer, (unsigned)(cp - buffer), false);
@@ -1410,7 +1410,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) - (size_t)(cp - buffer),
" %.2f", arr[i] * MS_PER_S);
cp += strlen(cp);
@@ -2719,7 +2719,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 = true;
}
@@ -2762,7 +2762,7 @@ read_sysvars(void)
gotvar = false;
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 = true;
} else {
@@ -2779,7 +2779,7 @@ read_sysvars(void)
return;
}
n = v->code + CS_MAXCODE + 1;
- NTP_INSIST(n < wants_count);
+ INSIST(n < wants_count);
wants[n] = 1;
gotvar = true;
}
@@ -4293,7 +4293,7 @@ count_var(
while (!(EOV & (k++)->flags))
c++;
- NTP_ENSURE(c <= USHRT_MAX);
+ ENSURE(c <= USHRT_MAX);
return (u_short)c;
}
=====================================
ntpd/ntp_io.c
=====================================
--- a/ntpd/ntp_io.c
+++ b/ntpd/ntp_io.c
@@ -297,7 +297,7 @@ maintain_activefds(
maxactivefd = i;
break;
}
- NTP_INSIST(fd != maxactivefd);
+ INSIST(fd != maxactivefd);
}
}
}
@@ -593,8 +593,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);
@@ -912,15 +912,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);
}
@@ -940,7 +940,7 @@ action_text(
t = "ERROR"; /* quiet uninit warning */
DPRINTF(1, ("fatal: unknown nic_rule_action %u\n",
action));
- NTP_ENSURE(0);
+ ENSURE(0);
break;
case ACTION_LISTEN:
@@ -2761,7 +2761,7 @@ calc_addr_distance(
bool a1_greater;
int i;
- NTP_REQUIRE(AF(a1) == AF(a2));
+ REQUIRE(AF(a1) == AF(a2));
ZERO_SOCK(dist);
AF(dist) = AF(a1);
@@ -2812,7 +2812,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))
=====================================
ntpd/ntp_monitor.c
=====================================
--- a/ntpd/ntp_monitor.c
+++ b/ntpd/ntp_monitor.c
@@ -129,7 +129,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);
}
=====================================
ntpd/ntp_restrict.c
=====================================
--- a/ntpd/ntp_restrict.c
+++ b/ntpd/ntp_restrict.c
@@ -171,7 +171,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;
}
@@ -197,7 +197,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;
}
@@ -221,7 +221,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);
@@ -289,7 +289,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);
@@ -492,8 +492,8 @@ hack_restrict(
op, socktoa(resaddr), socktoa(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 = true;
@@ -526,7 +526,7 @@ hack_restrict(
&match.u.v6.mask);
} else /* not IPv4 nor IPv6 */
- NTP_REQUIRE(0);
+ REQUIRE(0);
match.flags = flags;
match.mflags = mflags;
@@ -598,7 +598,7 @@ hack_restrict(
break;
default: /* unknown op */
- NTP_INSIST(0);
+ INSIST(0);
break;
}
@@ -623,7 +623,7 @@ restrict_source(
if (!restrict_source_enabled || SOCK_UNSPEC(addr) || IS_MCAST(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) {
=====================================
tests/libntp/strtolfp.c
=====================================
--- a/tests/libntp/strtolfp.c
+++ b/tests/libntp/strtolfp.c
@@ -46,7 +46,7 @@ atolfp(
bool isneg;
static const char *digits = "0123456789";
- NTP_REQUIRE(str != NULL);
+ REQUIRE(str != NULL);
isneg = false;
dec_i = dec_f = 0;
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/9d335068a42b306797808489ab8149575e28ea86...5c4c69db7ff151dd9a3d392a04a2290186decc2f
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/9d335068a42b306797808489ab8149575e28ea86...5c4c69db7ff151dd9a3d392a04a2290186decc2f
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170602/5250c5fb/attachment.html>
More information about the vc
mailing list