Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Use the new magic BINTIME_SCALE_* macros instead of...
details: https://anonhg.NetBSD.org/src/rev/6a33a4902e96
branches: trunk
changeset: 350144:6a33a4902e96
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Thu Jan 05 23:29:14 2017 +0000
description:
Use the new magic BINTIME_SCALE_* macros instead of magic numbers.
No functional change.
diffstat:
sys/kern/subr_time.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (30 lines):
diff -r 0b9145e2f196 -r 6a33a4902e96 sys/kern/subr_time.c
--- a/sys/kern/subr_time.c Thu Jan 05 23:24:39 2017 +0000
+++ b/sys/kern/subr_time.c Thu Jan 05 23:29:14 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_time.c,v 1.18 2016/04/23 23:08:26 christos Exp $ */
+/* $NetBSD: subr_time.c,v 1.19 2017/01/05 23:29:14 pgoyette Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_time.c,v 1.18 2016/04/23 23:08:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_time.c,v 1.19 2017/01/05 23:29:14 pgoyette Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -232,9 +232,9 @@
{
ts->tv_sec = ticks / hz;
uint64_t sticks = ticks - ts->tv_sec * hz;
- if (sticks > 18446744073709551LL) /* floor(2^64 / 1000) */
+ if (sticks > BINTIME_SCALE_MS) /* floor(2^64 / 1000) */
ts->tv_nsec = sticks / hz * 1000000000LL;
- else if (sticks > 18446744073709LL) /* floor(2^64 / 1000000) */
+ else if (sticks > BINTIME_SCALE_US) /* floor(2^64 / 1000000) */
ts->tv_nsec = sticks * 1000LL / hz * 1000000LL;
else
ts->tv_nsec = sticks * 1000000000LL / hz;
Home |
Main Index |
Thread Index |
Old Index