Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/lib/libkern KNF



details:   https://anonhg.NetBSD.org/src/rev/a329109ff576
branches:  trunk
changeset: 550754:a329109ff576
user:      itojun <itojun%NetBSD.org@localhost>
date:      Wed Aug 20 13:32:33 2003 +0000

description:
KNF

diffstat:

 sys/lib/libkern/arc4random.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (41 lines):

diff -r 7c785a06ccbd -r a329109ff576 sys/lib/libkern/arc4random.c
--- a/sys/lib/libkern/arc4random.c      Wed Aug 20 13:07:41 2003 +0000
+++ b/sys/lib/libkern/arc4random.c      Wed Aug 20 13:32:33 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arc4random.c,v 1.9 2002/10/06 13:42:36 dan Exp $       */
+/*     $NetBSD: arc4random.c,v 1.10 2003/08/20 13:32:33 itojun Exp $   */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -199,22 +199,23 @@
                arc4_randrekey();
        }
 
-       for(i = 0, ret = 0; i < 24; ret |= arc4_randbyte() << i, i += 8);
+       for (i = 0, ret = 0; i < 24; ret |= arc4_randbyte() << i, i += 8)
+               ;
        return ret;
 }
 
 void
 arc4randbytes(void *p, size_t len)
 {
-    u_int8_t *buf;
-    size_t i;
+       u_int8_t *buf;
+       size_t i;
 
-    buf = (u_int8_t *)p;
+       buf = (u_int8_t *)p;
 
-    for(i = 0; i < len; buf[i] = arc4_randbyte(), i++);
-    arc4_numruns += len / sizeof(u_int32_t);
-    if((arc4_numruns > ARC4_MAXRUNS) ||
-       (mono_time.tv_sec > arc4_tv_nextreseed.tv_sec)) {
+       for (i = 0; i < len; buf[i] = arc4_randbyte(), i++);
+               arc4_numruns += len / sizeof(u_int32_t);
+       if ((arc4_numruns > ARC4_MAXRUNS) ||
+           (mono_time.tv_sec > arc4_tv_nextreseed.tv_sec)) {
                arc4_randrekey();
        }
 }



Home | Main Index | Thread Index | Old Index