Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/time stronger lint foo
details: https://anonhg.NetBSD.org/src/rev/6d7435e7533f
branches: trunk
changeset: 782302:6d7435e7533f
user: christos <christos%NetBSD.org@localhost>
date: Fri Oct 26 23:23:23 2012 +0000
description:
stronger lint foo
diffstat:
lib/libc/time/difftime.c | 10 +++++-----
lib/libc/time/localtime.c | 10 ++++------
lib/libc/time/private.h | 6 +++---
3 files changed, 12 insertions(+), 14 deletions(-)
diffs (114 lines):
diff -r 39403ebebc5a -r 6d7435e7533f lib/libc/time/difftime.c
--- a/lib/libc/time/difftime.c Fri Oct 26 23:05:14 2012 +0000
+++ b/lib/libc/time/difftime.c Fri Oct 26 23:23:23 2012 +0000
@@ -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 @@
** (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.
diff -r 39403ebebc5a -r 6d7435e7533f lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Fri Oct 26 23:05:14 2012 +0000
+++ b/lib/libc/time/localtime.c Fri Oct 26 23:23:23 2012 +0000
@@ -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 @@
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 @@
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 @@
/*
** 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))
diff -r 39403ebebc5a -r 6d7435e7533f lib/libc/time/private.h
--- a/lib/libc/time/private.h Fri Oct 26 23:05:14 2012 +0000
+++ b/lib/libc/time/private.h Fri Oct 26 23:23:23 2012 +0000
@@ -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 @@
#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 @@
*/
#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
Home |
Main Index |
Thread Index |
Old Index