Merge "core/sal: pass commandline parameters by reference"
This commit is contained in:
@ -36,16 +36,20 @@ BaseListener* SimulatorController::resume(void)
|
||||
return m_LstList.getLastFired();
|
||||
}
|
||||
|
||||
void SimulatorController::startup(int argc, char **argv)
|
||||
void SimulatorController::startup(int& argc, char **& argv)
|
||||
{
|
||||
if (argv) {
|
||||
CommandLine::Inst().collect_args(argc, argv);
|
||||
}
|
||||
startup();
|
||||
}
|
||||
|
||||
void SimulatorController::startup()
|
||||
{
|
||||
// Some greetings to the user:
|
||||
std::cout << "[SimulatorController] Initializing..." << std::endl;
|
||||
// TODO: Log-Level?
|
||||
|
||||
if (argv) {
|
||||
CommandLine::Inst().collect_args(argc, argv);
|
||||
}
|
||||
|
||||
// Activate previously added experiments to allow initialization:
|
||||
initExperiments();
|
||||
}
|
||||
|
||||
@ -52,7 +52,11 @@ public:
|
||||
* @param argc main()'s argument counter
|
||||
* @param argv main()'s argument value vector
|
||||
*/
|
||||
void startup(int argc = 0, char **argv = 0);
|
||||
void startup(int& argc, char **& argv);
|
||||
/**
|
||||
* @brief Parameter-less version of startup() for backends that do not (yet) handle parameters
|
||||
*/
|
||||
void startup();
|
||||
/**
|
||||
* Experiments need to hook here.
|
||||
*/
|
||||
|
||||
@ -13,7 +13,8 @@ namespace fail {
|
||||
if (strncmp(argv[i], "-Wf,", 4) == 0) {
|
||||
this->argv.push_back(std::string(argv[i] + 4));
|
||||
|
||||
for (int x = i + 1; x < argc; ++x) {
|
||||
// also copy argv[argc], which equals 0
|
||||
for (int x = i + 1; x <= argc; ++x) {
|
||||
argv[x - 1] = argv[x];
|
||||
}
|
||||
i --;
|
||||
|
||||
Reference in New Issue
Block a user