From: Brian Norris Date: Wed, 9 May 2012 06:45:00 +0000 (-0700) Subject: model: change constructor assignments to initializer list X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2f3e4e24140493a96a7ece89429d294546a9e0c0;p=cdsspec-compiler.git model: change constructor assignments to initializer list Apparently this is a nice C++ feature I didn't know of. Not much use here, but there will be other uses... --- diff --git a/model.cc b/model.cc index 53411c6..142e862 100644 --- a/model.cc +++ b/model.cc @@ -39,21 +39,21 @@ void free_action_list(action_list_t *list) } ModelChecker::ModelChecker() -{ - /* First thread created will have id INITIAL_THREAD_ID */ - next_thread_id = INITIAL_THREAD_ID; - used_sequence_numbers = 0; + : /* Initialize default scheduler */ - scheduler = new Scheduler(); - - num_executions = 0; - current_action = NULL; - exploring = NULL; - nextThread = THREAD_ID_T_NONE; - - rootNode = new TreeNode(); - currentNode = rootNode; - action_trace = new action_list_t(); + scheduler(new Scheduler()), + /* First thread created will have id INITIAL_THREAD_ID */ + next_thread_id(INITIAL_THREAD_ID), + used_sequence_numbers(0), + + num_executions(0), + current_action(NULL), + exploring(NULL), + nextThread(THREAD_ID_T_NONE), + action_trace(new action_list_t()), + rootNode(new TreeNode()), + currentNode(rootNode) +{ } ModelChecker::~ModelChecker()