diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-20 12:34:14 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2014-12-20 12:34:14 +0000 |
commit | 0d82edd9f8bebb396a9154d4e1003340dbf6b967 (patch) | |
tree | 0659c834f387f3504944a610ed6858b9e268e6c7 /src/librandom | |
parent | 2436785702b47996e9f0e281df0d6027660ec914 (diff) | |
download | skalibs-0d82edd9f8bebb396a9154d4e1003340dbf6b967.tar.xz |
Lots of cosmetic fixes.
sha256 documented.
Diffstat (limited to 'src/librandom')
-rw-r--r-- | src/librandom/random-internal.h | 2 | ||||
-rw-r--r-- | src/librandom/rrandom_add.c | 2 | ||||
-rw-r--r-- | src/librandom/rrandom_finish.c | 2 | ||||
-rw-r--r-- | src/librandom/rrandom_name.c | 2 | ||||
-rw-r--r-- | src/librandom/rrandom_read.c | 2 | ||||
-rw-r--r-- | src/librandom/rrandom_readint.c | 3 | ||||
-rw-r--r-- | src/librandom/surf.c | 4 | ||||
-rw-r--r-- | src/librandom/surf_autoinit.c | 2 | ||||
-rw-r--r-- | src/librandom/surf_init.c | 2 | ||||
-rw-r--r-- | src/librandom/surf_sinit.c | 2 | ||||
-rw-r--r-- | src/librandom/unirandom_finish.c | 2 | ||||
-rw-r--r-- | src/librandom/unirandom_init.c | 2 | ||||
-rw-r--r-- | src/librandom/unirandom_readb.c | 2 | ||||
-rw-r--r-- | src/librandom/unirandom_readnb.c | 2 | ||||
-rw-r--r-- | src/librandom/unirandom_register.c | 2 |
15 files changed, 17 insertions, 16 deletions
diff --git a/src/librandom/random-internal.h b/src/librandom/random-internal.h index 37b534e..a9788fc 100644 --- a/src/librandom/random-internal.h +++ b/src/librandom/random-internal.h @@ -8,7 +8,7 @@ #include <skalibs/unirandom.h> #include <skalibs/rrandom.h> -extern void unirandom_register (unirandom_ref, int (*) (union unirandominfo *), int (*) (union unirandominfo *), unsigned int (*) (union unirandominfo *, char *, unsigned int), unsigned int (*) (union unirandominfo *, char *, unsigned int)) ; +extern void unirandom_register (unirandom *, int (*) (union unirandominfo *), int (*) (union unirandominfo *), unsigned int (*) (union unirandominfo *, char *, unsigned int), unsigned int (*) (union unirandominfo *, char *, unsigned int)) ; extern unsigned int random_mask2 (unsigned int) gccattr_const ; extern unsigned int random_nchars (unsigned int) gccattr_const ; diff --git a/src/librandom/rrandom_add.c b/src/librandom/rrandom_add.c index c22a43c..23fa2af 100644 --- a/src/librandom/rrandom_add.c +++ b/src/librandom/rrandom_add.c @@ -4,7 +4,7 @@ #include <skalibs/unirandom.h> #include <skalibs/rrandom.h> -int rrandom_add (rrandom_ref z, int (*f) (unirandom_ref)) +int rrandom_add (rrandom *z, int (*f) (unirandom *)) { if (z->n >= 3) return (errno = EBUSY, 0) ; if (!(*f)(&z->tries[z->n].it)) return 0 ; diff --git a/src/librandom/rrandom_finish.c b/src/librandom/rrandom_finish.c index a3cb24b..c2d4992 100644 --- a/src/librandom/rrandom_finish.c +++ b/src/librandom/rrandom_finish.c @@ -3,7 +3,7 @@ #include <skalibs/unirandom.h> #include <skalibs/rrandom.h> -int rrandom_finish (rrandom_ref z) +int rrandom_finish (rrandom *z) { rrandom zero = RRANDOM_ZERO ; unsigned int i = z->n ; diff --git a/src/librandom/rrandom_name.c b/src/librandom/rrandom_name.c index 5e77e83..2085d17 100644 --- a/src/librandom/rrandom_name.c +++ b/src/librandom/rrandom_name.c @@ -3,7 +3,7 @@ #include <skalibs/unirandom.h> #include <skalibs/rrandom.h> -unsigned int rrandom_name (rrandom_ref z, char *s, unsigned int n, int nb) +unsigned int rrandom_name (rrandom *z, char *s, unsigned int n, int nb) { static char const *oklist = "ABCDEFGHIJKLMNOPQRSTUVWXYZghijklmnopqrstuvwxyz-_0123456789abcdef" ; register unsigned int r = rrandom_read(z, s, n, nb ? &unirandom_readnb : &unirandom_readb) ; diff --git a/src/librandom/rrandom_read.c b/src/librandom/rrandom_read.c index 57ff920..9d56b0c 100644 --- a/src/librandom/rrandom_read.c +++ b/src/librandom/rrandom_read.c @@ -6,7 +6,7 @@ #include <skalibs/unirandom.h> #include <skalibs/rrandom.h> -unsigned int rrandom_read (rrandom_ref z, char *s, unsigned int n, unsigned int (*f) (unirandom_ref, char *, unsigned int)) +unsigned int rrandom_read (rrandom *z, char *s, unsigned int n, unsigned int (*f) (unirandom *, char *, unsigned int)) { unsigned int i = 0 ; for (; i < 3 ; i++) diff --git a/src/librandom/rrandom_readint.c b/src/librandom/rrandom_readint.c index e4f677c..6a34de2 100644 --- a/src/librandom/rrandom_readint.c +++ b/src/librandom/rrandom_readint.c @@ -1,11 +1,12 @@ /* ISC license. */ #include <skalibs/uint.h> +#include <skalibs/bytestr.h> #include <skalibs/unirandom.h> #include "random-internal.h" #include <skalibs/rrandom.h> -unsigned int rrandom_readint (rrandom_ref z, unsigned int n, unsigned int (*f) (unirandom_ref, char *, unsigned int)) +unsigned int rrandom_readint (rrandom *z, unsigned int n, unsigned int (*f) (unirandom *, char *, unsigned int)) { if (!n) return 0 ; else diff --git a/src/librandom/surf.c b/src/librandom/surf.c index 1687df9..ad0aab1 100644 --- a/src/librandom/surf.c +++ b/src/librandom/surf.c @@ -7,7 +7,7 @@ #define ROTATE(x, b) (((x) << (b)) | ((x) >> (32 - (b)))) #define MUSH(i, b) x = t[i] += (((x ^ ctx->seed[i]) + sum) ^ ROTATE(x, b)) -static void surfit (SURFSchedule_ref ctx) +static void surfit (SURFSchedule *ctx) { uint32 t[12] ; uint32 z[8] ; @@ -33,7 +33,7 @@ static void surfit (SURFSchedule_ref ctx) for (i = 0 ; i < 8 ; i++) uint32_pack(ctx->out + (i<<2), z[i]) ; } -void surf (SURFSchedule_ref ctx, char *s, unsigned int n) +void surf (SURFSchedule *ctx, char *s, unsigned int n) { { register unsigned int i = 32 - ctx->pos ; diff --git a/src/librandom/surf_autoinit.c b/src/librandom/surf_autoinit.c index 920612b..b7774c0 100644 --- a/src/librandom/surf_autoinit.c +++ b/src/librandom/surf_autoinit.c @@ -2,7 +2,7 @@ #include <skalibs/surf.h> -void surf_autoinit (SURFSchedule_ref ctx, char *s, unsigned int n) +void surf_autoinit (SURFSchedule *ctx, char *s, unsigned int n) { if (!ctx->in[0] && !ctx->in[1] && !ctx->in[2] && !ctx->in[3]) surf_init(ctx) ; diff --git a/src/librandom/surf_init.c b/src/librandom/surf_init.c index 3662fa8..045ec09 100644 --- a/src/librandom/surf_init.c +++ b/src/librandom/surf_init.c @@ -2,7 +2,7 @@ #include <skalibs/surf.h> -void surf_init (SURFSchedule_ref ctx) +void surf_init (SURFSchedule *ctx) { char s[160] ; surf_makeseed(s) ; diff --git a/src/librandom/surf_sinit.c b/src/librandom/surf_sinit.c index ae7f480..f81a5c8 100644 --- a/src/librandom/surf_sinit.c +++ b/src/librandom/surf_sinit.c @@ -3,7 +3,7 @@ #include <skalibs/uint32.h> #include <skalibs/surf.h> -void surf_sinit (SURFSchedule_ref ctx, char const *s) +void surf_sinit (SURFSchedule *ctx, char const *s) { SURFSchedule zero = SURFSCHEDULE_ZERO ; register unsigned int i = 4 ; diff --git a/src/librandom/unirandom_finish.c b/src/librandom/unirandom_finish.c index 14c4411..bb54eb5 100644 --- a/src/librandom/unirandom_finish.c +++ b/src/librandom/unirandom_finish.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/unirandom.h> -int unirandom_finish (unirandom_ref u) +int unirandom_finish (unirandom *u) { if (!u->initted) return 1 ; if (!(*u->finish)(&u->data)) return 0 ; diff --git a/src/librandom/unirandom_init.c b/src/librandom/unirandom_init.c index 711a4ac..6324d71 100644 --- a/src/librandom/unirandom_init.c +++ b/src/librandom/unirandom_init.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/unirandom.h> -int unirandom_init (unirandom_ref u) +int unirandom_init (unirandom *u) { if (u->initted) return 1 ; if (!(*u->init)(&u->data)) return 0 ; diff --git a/src/librandom/unirandom_readb.c b/src/librandom/unirandom_readb.c index cbe45a6..605e467 100644 --- a/src/librandom/unirandom_readb.c +++ b/src/librandom/unirandom_readb.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/unirandom.h> -unsigned int unirandom_readb (unirandom_ref u, char *s, unsigned int n) +unsigned int unirandom_readb (unirandom *u, char *s, unsigned int n) { if (!u->initted && !unirandom_init(u)) return 0 ; return (*u->readb)(&u->data, s, n) ; diff --git a/src/librandom/unirandom_readnb.c b/src/librandom/unirandom_readnb.c index f0cc38e..5ccc6bc 100644 --- a/src/librandom/unirandom_readnb.c +++ b/src/librandom/unirandom_readnb.c @@ -3,7 +3,7 @@ #include <errno.h> #include <skalibs/unirandom.h> -unsigned int unirandom_readnb (unirandom_ref u, char *s, unsigned int n) +unsigned int unirandom_readnb (unirandom *u, char *s, unsigned int n) { if (!u->initted && !unirandom_init(u)) return 0 ; return (*u->readnb)(&u->data, s, n) ; diff --git a/src/librandom/unirandom_register.c b/src/librandom/unirandom_register.c index 35f7411..e174909 100644 --- a/src/librandom/unirandom_register.c +++ b/src/librandom/unirandom_register.c @@ -4,7 +4,7 @@ #include <skalibs/unirandom.h> #include "random-internal.h" -void unirandom_register (unirandom_ref u, int (*init) (union unirandominfo *), int (*finish) (union unirandominfo *), unsigned int (*readb) (union unirandominfo *, char *, unsigned int), unsigned int (*readnb) (union unirandominfo *, char *, unsigned int)) +void unirandom_register (unirandom *u, int (*init) (union unirandominfo *), int (*finish) (union unirandominfo *), unsigned int (*readb) (union unirandominfo *, char *, unsigned int), unsigned int (*readnb) (union unirandominfo *, char *, unsigned int)) { unirandom zero = UNIRANDOM_ZERO ; *u = zero ; |