aboutsummaryrefslogtreecommitdiff
path: root/blackbox.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-10-22 16:27:54 +0000
committerSimon Tatham <anakin@pobox.com>2005-10-22 16:27:54 +0000
commit23ab000b7b038b6810e48a71a94b8287c20a6047 (patch)
tree1e8bcd5adc7c7d3b8179a954bc0e7c1c50cec7af /blackbox.c
parent4faecc77264b6d3e84ae24707af5593490f36796 (diff)
downloadpuzzles-23ab000b7b038b6810e48a71a94b8287c20a6047.zip
puzzles-23ab000b7b038b6810e48a71a94b8287c20a6047.tar.gz
puzzles-23ab000b7b038b6810e48a71a94b8287c20a6047.tar.bz2
puzzles-23ab000b7b038b6810e48a71a94b8287c20a6047.tar.xz
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]
Diffstat (limited to 'blackbox.c')
-rw-r--r--blackbox.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/blackbox.c b/blackbox.c
index dda036c..1889a19 100644
--- a/blackbox.c
+++ b/blackbox.c
@@ -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++) {