changed all non-owned unique_ptr access to reference to the object itself

This commit is contained in:
2024-07-11 22:15:15 -04:00
parent 6d3e8229df
commit c68330b3e3
17 changed files with 73 additions and 57 deletions

View File

@ -121,18 +121,19 @@ feature proc_args(int argc, char **argv,
if (result & FEATURE_NCURSES) {
curse = std::make_unique<cursor>();
in = std::make_unique<curses_input>(curse);
out = std::make_unique<curses_output>(curse);
in = std::make_unique<curses_input>(*curse);
out = std::make_unique<curses_output>(*curse);
}
if (result & FEATURE_SEED) {
std::istringstream iss {seed};
unsigned int tmp;
iss >> tmp;
if (!iss.good())
if (!iss.good())
return FEATURE_PANIC_SEED;
rng = std::make_unique<RNG>(tmp);
rng = std::make_unique<RNG>(tmp);
}
return result;
@ -166,9 +167,8 @@ void panic_args(feature panic) {
cerr << "Something must have went really, really, wrong..."
<< endl;
}
}
else if (panic & FEATURE_PANIC_SEED) {
cerr << "Invalid seed" << endl;
} else if (panic & FEATURE_PANIC_SEED) {
cerr << "Invalid seed" << endl;
} else
cerr << "Something must have went really, really, wrong..."
<< endl;