From 2818da0a2ef36dbc8c2d878e5eee3e78277e3e3e Mon Sep 17 00:00:00 2001
From: Peter S. Mazinger <ps.m@gmx.net>
Date: Fri, 18 Mar 2011 16:03:12 +0100
Subject: [PATCH 091/396] arc4random.c: move arc4_getbyte up

no need for forward declarations

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
---
 libc/stdlib/arc4random.c |   34 ++++++++++++++--------------------
 1 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/libc/stdlib/arc4random.c b/libc/stdlib/arc4random.c
index c7aed66..e074a22 100644
--- a/libc/stdlib/arc4random.c
+++ b/libc/stdlib/arc4random.c
@@ -47,12 +47,6 @@ struct arc4_stream {
 static int    rs_initialized;
 static struct arc4_stream rs;
 
-static __inline__ void arc4_init(struct arc4_stream *);
-static __inline__ void arc4_addrandom(struct arc4_stream *, u_char *, int);
-static void arc4_stir(struct arc4_stream *);
-static __inline__ uint8_t arc4_getbyte(struct arc4_stream *);
-static __inline__ uint32_t arc4_getword(struct arc4_stream *);
-
 static __inline__ void
 arc4_init(struct arc4_stream *as)
 {
@@ -64,6 +58,20 @@ arc4_init(struct arc4_stream *as)
 	as->j = 0;
 }
 
+static __inline__ uint8_t
+arc4_getbyte(struct arc4_stream *as)
+{
+	uint8_t si, sj;
+
+	as->i = (as->i + 1);
+	si = as->s[as->i];
+	as->j = (as->j + si);
+	sj = as->s[as->j];
+	as->s[as->i] = sj;
+	as->s[as->j] = si;
+	return (as->s[(si + sj) & 0xff]);
+}
+
 static __inline__ void
 arc4_addrandom(struct arc4_stream *as, u_char *dat, int datlen)
 {
@@ -131,20 +139,6 @@ arc4_stir(struct arc4_stream *as)
 		arc4_getbyte(as);
 }
 
-static __inline__ uint8_t
-arc4_getbyte(struct arc4_stream *as)
-{
-	uint8_t si, sj;
-
-	as->i = (as->i + 1);
-	si = as->s[as->i];
-	as->j = (as->j + si);
-	sj = as->s[as->j];
-	as->s[as->i] = sj;
-	as->s[as->j] = si;
-	return (as->s[(si + sj) & 0xff]);
-}
-
 static __inline__ uint32_t
 arc4_getword(struct arc4_stream *as)
 {
-- 
1.7.0.4

