diff options
author | Bardur Arantsson <bardur@scientician.net> | 2016-09-17 09:58:14 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2016-09-17 09:58:14 +0200 |
commit | f035201f330a3b1f50a2041ea9ad3f854f7d4e00 (patch) | |
tree | 7ef58d3a83ec4b50a0fe469a704773e5e1e77606 /src/init2.cc | |
parent | 7f147b21e23662c89bd28479ea67ee7c6a94fc0c (diff) |
Move all options to a struct instead of using globals
Diffstat (limited to 'src/init2.cc')
-rw-r--r-- | src/init2.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/init2.cc b/src/init2.cc index 7a7f6906..4c6f7f75 100644 --- a/src/init2.cc +++ b/src/init2.cc @@ -631,6 +631,9 @@ static void init_basic() /* Extended trigger macros */ cli_info = make_array<cli_comm>(CLI_MAX); + + /* Options */ + options = new struct options(); } @@ -810,19 +813,19 @@ static errr init_other(void) /*** Prepare the options ***/ /* Scan the options */ - for (i = 0; option_info[i].o_desc; i++) + for (auto const &option : options->standard_options) { - int os = option_info[i].o_page; - int ob = option_info[i].o_bit; + int os = option.o_page; + int ob = option.o_bit; /* Set the "default" options */ - if (option_info[i].o_var) + if (option.o_var) { /* Accept */ option_mask[os] |= (1L << ob); /* Set */ - if (option_info[i].o_norm) + if (option.o_norm) { /* Set */ option_flag[os] |= (1L << ob); |