From 23ab000b7b038b6810e48a71a94b8287c20a6047 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 22 Oct 2005 16:27:54 +0000 Subject: 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] --- devel.but | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'devel.but') diff --git a/devel.but b/devel.but index ef43baa..88ff947 100644 --- a/devel.but +++ b/devel.but @@ -1478,7 +1478,7 @@ otherwise be obvious. If a back end needs random numbers at some point during normal play, it can create a fresh \c{random_state} by first calling \c{get_random_seed} (\k{frontend-get-random-seed}) and then passing -the returned seed data to \cw{random_init()}. +the returned seed data to \cw{random_new()}. This is likely not to be what you want. If a puzzle needs randomness in the middle of play, it's likely to be more sensible to store some @@ -3044,9 +3044,9 @@ generator has an \e{explicit} state object called a \c{random_state}. One of these is managed by each mid-end, for example, and passed to the back end to generate a game with. -\S{utils-random-init} \cw{random_init()} +\S{utils-random-init} \cw{random_new()} -\c random_state *random_init(char *seed, int len); +\c random_state *random_new(char *seed, int len); Allocates, initialises and returns a new \c{random_state}. The input data is used as the seed for the random number stream (i.e. using -- cgit v1.1