diff options
| author | Simon Tatham <anakin@pobox.com> | 2013-04-13 10:37:32 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2013-04-13 10:37:32 +0000 |
| commit | 251b21c41813055d9c416378508b1ee038bc3dac (patch) | |
| tree | 3adb963c93a9ae014c8c7d6fd1bce5498d6bd062 /random.c | |
| parent | 339329449f4db72e4754f21c14295303ffe0ea5d (diff) | |
| download | puzzles-251b21c41813055d9c416378508b1ee038bc3dac.zip puzzles-251b21c41813055d9c416378508b1ee038bc3dac.tar.gz puzzles-251b21c41813055d9c416378508b1ee038bc3dac.tar.bz2 puzzles-251b21c41813055d9c416378508b1ee038bc3dac.tar.xz | |
Giant const patch of doom: add a 'const' to every parameter in every
puzzle backend function which ought to have it, and propagate those
consts through to per-puzzle subroutines as needed.
I've recently had to do that to a few specific parameters which were
being misused by particular puzzles (r9657, r9830), which suggests
that it's probably a good idea to do the whole lot pre-emptively
before the next such problem shows up.
[originally from svn r9832]
[r9657 == 3b250baa02a7332510685948bf17576c397b8ceb]
[r9830 == 0b93de904a98f119b1a95d3a53029f1ed4bfb9b3]
Diffstat (limited to 'random.c')
| -rw-r--r-- | random.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -107,7 +107,7 @@ void SHA_Init(SHA_State * s) s->lenhi = s->lenlo = 0; } -void SHA_Bytes(SHA_State * s, void *p, int len) +void SHA_Bytes(SHA_State * s, const void *p, int len) { unsigned char *q = (unsigned char *) p; uint32 wordblock[16]; @@ -188,7 +188,7 @@ void SHA_Final(SHA_State * s, unsigned char *output) } } -void SHA_Simple(void *p, int len, unsigned char *output) +void SHA_Simple(const void *p, int len, unsigned char *output) { SHA_State s; @@ -207,7 +207,7 @@ struct random_state { int pos; }; -random_state *random_new(char *seed, int len) +random_state *random_new(const char *seed, int len) { random_state *state; @@ -304,7 +304,7 @@ char *random_state_encode(random_state *state) return dupstr(retbuf); } -random_state *random_state_decode(char *input) +random_state *random_state_decode(const char *input) { random_state *state; int pos, byte, digits; |