+* Start using 'design by contract' assertions.
* Allow null driftfile.
* More leap second fixes from Dave Mills.
* Use YYERROR_VERBOSE for the new parser, and fix related BUILT_SOURCES.
mx4200.h \
ntif.h \
ntp.h \
+ ntp_assert.h \
ntp_calendar.h \
ntp_cmdargs.h \
ntp_config.h \
--- /dev/null
+/*
+ * ntp_assert.h - design by contract stuff
+ */
+
+#ifndef NTP_ASSSERT_H
+#define NTP_ASSERT_H
+
+#include "isc/assertions.h"
+
+#define NTP_REQUIRE(x) ISC_REQUIRE(x)
+#define NTP_INSIST(x) ISC_INSIST(x)
+#define NTP_INVARIANT(x) ISC_INVARIANT(x)
+#define NTP_ENSURE(x) ISC_ENSURE(x)
+
+#endif
#include "ntp_fp.h"
#include "ntp_string.h"
+#include "ntp_assert.h"
/*
* Powers of 10
int isneg;
static const char *digits = "0123456789";
+ NTP_REQUIRE(str != NULL);
+
isneg = 0;
dec_i = dec_f = 0;
ndec = 0;
#include "ntp_unixtime.h" /* includes <sys/time.h> */
#include "lib_strbuf.h"
#include "ntp_stdlib.h"
+#include "ntp_assert.h"
static const char *months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
*/
for (epoch_nr = 0; epoch_nr < MAX_EPOCH_NR; epoch_nr++) {
tm = local ? localtime(&t) : gmtime(&t);
+ NTP_INSIST(tm != NULL);
#if SIZEOF_TIME_T < 4
# include "Bletch: sizeof(time_t) < 4!"