summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorkamil <kamil@NetBSD.org>2020-02-22 11:24:47 +0000
committerkamil <kamil@NetBSD.org>2020-02-22 11:24:47 +0000
commit7e8bb44dc8425bde7c39009c1721167fc2c382b3 (patch)
tree51ce5e22df9f7fa3b9ee7ecac9737f39818cfa90 /lib/libc/stdlib
parent1a5bee78e1212903db6d5ae0410720b392924acc (diff)
Improve readability of __dorand48()
Break long lines into shorter instructions per line. No Functional Change.
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/_rand48.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libc/stdlib/_rand48.c b/lib/libc/stdlib/_rand48.c
index 0468026dcd8..44ec0231a56 100644
--- a/lib/libc/stdlib/_rand48.c
+++ b/lib/libc/stdlib/_rand48.c
@@ -1,4 +1,4 @@
-/* $NetBSD: _rand48.c,v 1.7 2005/06/12 05:21:27 lukem Exp $ */
+/* $NetBSD: _rand48.c,v 1.8 2020/02/22 11:24:47 kamil Exp $ */
/*
* Copyright (c) 1993 Martin Birgmeier
@@ -15,7 +15,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _rand48.c,v 1.7 2005/06/12 05:21:27 lukem Exp $");
+__RCSID("$NetBSD: _rand48.c,v 1.8 2020/02/22 11:24:47 kamil Exp $");
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
@@ -42,12 +42,12 @@ __dorand48(unsigned short xseed[3])
_DIAGASSERT(xseed != NULL);
- accu = (unsigned long) __rand48_mult[0] * (unsigned long) xseed[0] +
- (unsigned long) __rand48_add;
+ accu = (unsigned long) __rand48_mult[0] * (unsigned long) xseed[0];
+ accu += (unsigned long) __rand48_add;
temp[0] = (unsigned short) accu; /* lower 16 bits */
accu >>= sizeof(unsigned short) * 8;
- accu += (unsigned long) __rand48_mult[0] * (unsigned long) xseed[1] +
- (unsigned long) __rand48_mult[1] * (unsigned long) xseed[0];
+ accu += (unsigned long) __rand48_mult[0] * (unsigned long) xseed[1];
+ accu += (unsigned long) __rand48_mult[1] * (unsigned long) xseed[0];
temp[1] = (unsigned short) accu; /* middle 16 bits */
accu >>= sizeof(unsigned short) * 8;
accu += __rand48_mult[0] * xseed[2] + __rand48_mult[1] * xseed[1] + __rand48_mult[2] * xseed[0];