X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fsettings.c;h=3bd98c18ca47b177aaae8a0a9ee701c00d38817a;hb=35b33ef0aa2090c0cbb83d31c71175f5b7c95c95;hp=749757bc6fd9526d4cd7e938f9fb8dce4d9f95be;hpb=40271dcbfdecb01dfe808684741215eb2ddeb508;p=pspp diff --git a/src/settings.c b/src/settings.c index 749757bc6f..3bd98c18ca 100644 --- a/src/settings.c +++ b/src/settings.c @@ -20,6 +20,7 @@ #include #include "settings.h" #include +#include #include #include "format.h" #include "val.h" @@ -66,7 +67,6 @@ static size_t workspace = 4L * 1024 * 1024; static struct fmt_spec default_format = {FMT_F, 8, 2}; -#define CC_CNT 5 #define CC_INITIALIZER {"-", "", "", "", '.', ','} static struct custom_currency cc[CC_CNT] = { @@ -77,8 +77,6 @@ static struct custom_currency cc[CC_CNT] = CC_INITIALIZER, }; -static gsl_rng *rng; - static bool testing_mode = false; static int global_algorithm = ENHANCED; @@ -90,20 +88,17 @@ static int syntax = ENHANCED; static void init_viewport (void); void -done_settings (void) +settings_init (void) { - if (rng != NULL) - gsl_rng_free (rng); - - free (prompt); - free (cprompt); - free (dprompt); + init_viewport (); } void -init_settings (void) +settings_done (void) { - init_viewport (); + free (prompt); + free (cprompt); + free (dprompt); } /* Screen length in lines. */ @@ -494,7 +489,7 @@ set_endcmd (char endcmd_) /* Approximate maximum amount of memory to use for cases, in bytes. */ size_t -get_workspace(void) +get_workspace (void) { return workspace; } @@ -540,26 +535,6 @@ set_cc (int idx, const struct custom_currency *cc_) cc[idx] = *cc_; } -/* Returns the current random number generator. */ -gsl_rng * -get_rng (void) -{ - if (rng == NULL) - set_rng (time (0)); - return rng; -} - -/* Initializes or reinitializes the random number generator with - the given SEED. */ -void -set_rng (unsigned long seed) -{ - rng = gsl_rng_alloc (gsl_rng_mt19937); - if (rng == NULL) - xalloc_die (); - gsl_rng_set (rng, seed); -} - /* Are we in testing mode? (e.g. --testing-mode command line option) */ bool