Module Name:    src
Committed By:   christos
Date:           Fri Oct 26 23:23:23 UTC 2012

Modified Files:
        src/lib/libc/time: difftime.c localtime.c private.h

Log Message:
stronger lint foo


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/lib/libc/time/difftime.c
cvs rdiff -u -r1.69 -r1.70 src/lib/libc/time/localtime.c
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/time/private.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/difftime.c
diff -u src/lib/libc/time/difftime.c:1.12 src/lib/libc/time/difftime.c:1.13
--- src/lib/libc/time/difftime.c:1.12	Fri Oct 26 14:30:11 2012
+++ src/lib/libc/time/difftime.c	Fri Oct 26 19:23:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: difftime.c,v 1.12 2012/10/26 18:30:11 christos Exp $	*/
+/*	$NetBSD: difftime.c,v 1.13 2012/10/26 23:23:23 christos Exp $	*/
 
 /*
 ** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
 #if 0
 static char	elsieid[] = "@(#)difftime.c	8.1";
 #else
-__RCSID("$NetBSD: difftime.c,v 1.12 2012/10/26 18:30:11 christos Exp $");
+__RCSID("$NetBSD: difftime.c,v 1.13 2012/10/26 23:23:23 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -26,17 +26,17 @@ difftime(const time_t time1, const time_
 	** (assuming that the larger type has more precision).
 	** This is the common real-world case circa 2004.
 	*/
-	/* CONSTCOND */
+	/*CONSTCOND*/
 	if (sizeof (double) > sizeof (time_t))
 		return (double) time1 - (double) time0;
-	/* CONSTCOND */
+	/*LINTED const not */
 	if (!TYPE_INTEGRAL(time_t)) {
 		/*
 		** time_t is floating.
 		*/
 		return time1 - time0;
 	}
-	/* CONSTCOND */
+	/*LINTED const not */
 	if (!TYPE_SIGNED(time_t)) {
 		/*
 		** time_t is integral and unsigned.

Index: src/lib/libc/time/localtime.c
diff -u src/lib/libc/time/localtime.c:1.69 src/lib/libc/time/localtime.c:1.70
--- src/lib/libc/time/localtime.c:1.69	Fri Oct 26 14:31:14 2012
+++ src/lib/libc/time/localtime.c	Fri Oct 26 19:23:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: localtime.c,v 1.69 2012/10/26 18:31:14 christos Exp $	*/
+/*	$NetBSD: localtime.c,v 1.70 2012/10/26 23:23:23 christos Exp $	*/
 
 /*
 ** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
 #if 0
 static char	elsieid[] = "@(#)localtime.c	8.17";
 #else
-__RCSID("$NetBSD: localtime.c,v 1.69 2012/10/26 18:31:14 christos Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.70 2012/10/26 23:23:23 christos Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -356,7 +356,6 @@ settzname(void)
 static int
 differ_by_repeat(const time_t t1, const time_t t0)
 {
-/* CONSTCOND */
 	if (TYPE_INTEGRAL(time_t) &&
 		TYPE_BIT(time_t) - TYPE_SIGNED(time_t) < SECSPERREPEAT_BITS)
 			return 0;
@@ -527,7 +526,6 @@ tzload(timezone_t sp, const char *name, 
 		for (i = 0; i < sp->timecnt - 2; ++i)
 			if (sp->ats[i] > sp->ats[i + 1]) {
 				++i;
-/* CONSTCOND */
 				if (TYPE_SIGNED(time_t)) {
 					/*
 					** Ignore the end (easy).
@@ -1867,11 +1865,11 @@ again:
 	/*
 	** Do a binary search (this works whatever time_t's type is).
 	*/
-	/* CONSTCOND */
+	/* LINTED const not */
 	if (!TYPE_SIGNED(time_t)) {
 		lo = 0;
 		hi = lo - 1;
-	/* CONSTCOND */
+	/* LINTED const not */
 	} else if (!TYPE_INTEGRAL(time_t)) {
 		/* CONSTCOND */
 		if (sizeof(time_t) > sizeof(float))

Index: src/lib/libc/time/private.h
diff -u src/lib/libc/time/private.h:1.27 src/lib/libc/time/private.h:1.28
--- src/lib/libc/time/private.h:1.27	Tue Oct 23 20:10:03 2012
+++ src/lib/libc/time/private.h	Fri Oct 26 19:23:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: private.h,v 1.27 2012/10/24 00:10:03 christos Exp $	*/
+/*	$NetBSD: private.h,v 1.28 2012/10/26 23:23:23 christos Exp $	*/
 
 #ifndef PRIVATE_H
 #define PRIVATE_H
@@ -203,7 +203,7 @@ const char *	scheck(const char * string,
 #endif /* !defined TYPE_BIT */
 
 #ifndef TYPE_SIGNED
-#define TYPE_SIGNED(type) (((type) -1) < 0)
+#define TYPE_SIGNED(type) (/*CONSTCOND*/((type) -1) < 0)
 #endif /* !defined TYPE_SIGNED */
 
 /*
@@ -212,7 +212,7 @@ const char *	scheck(const char * string,
 */
 
 #ifndef TYPE_INTEGRAL
-#define TYPE_INTEGRAL(type) (((type) 0.5) != 0.5)
+#define TYPE_INTEGRAL(type) (/*CONSTCOND*/((type) 0.5) != 0.5)
 #endif /* !defined TYPE_INTEGRAL */
 
 #ifndef INT_STRLEN_MAXIMUM

Reply via email to