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]
This commit is contained in:
Simon Tatham
2013-04-13 10:37:32 +00:00
parent 339329449f
commit 251b21c418
45 changed files with 1856 additions and 1655 deletions

View File

@ -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;