Cleanup: rename random_init() to random_new(), because it actually

_allocates_ a random_state rather than just initialising one passed
in by the caller.

[originally from svn r6412]
This commit is contained in:
Simon Tatham
2005-10-22 16:27:54 +00:00
parent 4faecc7726
commit 23ab000b7b
7 changed files with 15 additions and 15 deletions

View File

@ -692,9 +692,9 @@ static int check_guesses(game_state *state, int cagey)
* grid, so that repeating the same marking will give
* the same answer instead of a different one.
*/
random_state *rs = random_init((char *)guesses->grid,
(state->w+2)*(state->h+2) *
sizeof(unsigned int));
random_state *rs = random_new((char *)guesses->grid,
(state->w+2)*(state->h+2) *
sizeof(unsigned int));
n = random_upto(rs, n);
random_free(rs);
for (i = 0; i < guesses->nlasers; i++) {
@ -727,9 +727,9 @@ static int check_guesses(game_state *state, int cagey)
* grid, so that repeating the same marking will give
* the same answer instead of a different one.
*/
random_state *rs = random_init((char *)guesses->grid,
(state->w+2)*(state->h+2) *
sizeof(unsigned int));
random_state *rs = random_new((char *)guesses->grid,
(state->w+2)*(state->h+2) *
sizeof(unsigned int));
n = random_upto(rs, n);
random_free(rs);
for (i = 0; i < guesses->nlasers; i++) {