Browse Source

arc4random.c: move arc4_getbyte up

no need for forward declarations

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Peter S. Mazinger 14 years ago
parent
commit
85a5d70b5f
1 changed files with 14 additions and 20 deletions
  1. 14 20
      libc/stdlib/arc4random.c

+ 14 - 20
libc/stdlib/arc4random.c

@@ -47,12 +47,6 @@ struct arc4_stream {
 static int    rs_initialized;
 static int    rs_initialized;
 static struct arc4_stream rs;
 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
 static __inline__ void
 arc4_init(struct arc4_stream *as)
 arc4_init(struct arc4_stream *as)
 {
 {
@@ -64,6 +58,20 @@ arc4_init(struct arc4_stream *as)
 	as->j = 0;
 	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
 static __inline__ void
 arc4_addrandom(struct arc4_stream *as, u_char *dat, int datlen)
 arc4_addrandom(struct arc4_stream *as, u_char *dat, int datlen)
 {
 {
@@ -131,20 +139,6 @@ arc4_stir(struct arc4_stream *as)
 		arc4_getbyte(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
 static __inline__ uint32_t
 arc4_getword(struct arc4_stream *as)
 arc4_getword(struct arc4_stream *as)
 {
 {