[ntp:bk-ntp-dev-send] BitKeeper diffs

Harlan Stenn stenn at deacon.udel.edu
Fri Jun 22 05:03:22 UTC 2007


#### ChangeSet ####
2007-06-22 01:01:28-04:00, stenn at deacon.udel.edu 
  Start using 'design by contract' assertions

==== ChangeLog ====
2007-06-22 01:00:47-04:00, stenn at deacon.udel.edu +1 -0
  Start using 'design by contract' assertions

--- 1.73/ChangeLog	2007-06-19 19:07:33 -04:00
+++ 1.74/ChangeLog	2007-06-22 01:00:47 -04:00
@@ -1,3 +1,4 @@
+* 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.

==== include/Makefile.am ====
2007-06-22 01:00:48-04:00, stenn at deacon.udel.edu +1 -0
  Start using 'design by contract' assertions

--- 1.27/include/Makefile.am	2007-05-12 23:12:56 -04:00
+++ 1.28/include/Makefile.am	2007-06-22 01:00:48 -04:00
@@ -22,6 +22,7 @@ noinst_HEADERS = \
 	mx4200.h \
 	ntif.h \
 	ntp.h \
+	ntp_assert.h \
 	ntp_calendar.h \
 	ntp_cmdargs.h \
 	ntp_config.h \

==== include/ntp_assert.h ====
2007-06-22 01:00:58-04:00, stenn at deacon.udel.edu +15 -0
  BitKeeper file /deacon/backroom/ntp-dev/include/ntp_assert.h

--- /dev/null	2007-06-22 01:03:05 -04:00
+++ 1.1/include/ntp_assert.h	2007-06-22 01:00:58 -04:00
@@ -0,0 +1,15 @@
+/*
+ * 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_assert.h ====
2007-06-22 01:00:58-04:00, stenn at deacon.udel.edu +0 -0

==== libntp/atolfp.c ====
2007-06-22 01:00:48-04:00, stenn at deacon.udel.edu +3 -0
  Start using 'design by contract' assertions

--- 1.2/libntp/atolfp.c	2001-10-08 21:18:09 -04:00
+++ 1.3/libntp/atolfp.c	2007-06-22 01:00:48 -04:00
@@ -6,6 +6,7 @@
 
 #include "ntp_fp.h"
 #include "ntp_string.h"
+#include "ntp_assert.h"
 
 /*
  * Powers of 10
@@ -37,6 +38,8 @@ atolfp(
 	int ndec;
 	int isneg;
 	static const char *digits = "0123456789";
+
+	NTP_REQUIRE(str != NULL);
 
 	isneg = 0;
 	dec_i = dec_f = 0;

==== libntp/prettydate.c ====
2007-06-22 01:00:48-04:00, stenn at deacon.udel.edu +2 -0
  Start using 'design by contract' assertions

--- 1.5/libntp/prettydate.c	2005-05-25 05:01:11 -04:00
+++ 1.6/libntp/prettydate.c	2007-06-22 01:00:48 -04:00
@@ -7,6 +7,7 @@
 #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",
@@ -52,6 +53,7 @@ ntp2unix_tm(
 	*/
     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!"


More information about the bk-ntp-dev-send mailing list