model: create 'action_list_t' typedef
authorBrian Norris <banorris@uci.edu>
Thu, 19 Apr 2012 20:00:26 +0000 (13:00 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 19 Apr 2012 20:00:26 +0000 (13:00 -0700)
'std::list<class ModelAction *>' is a long name for a repeated type. Replace
it.

model.cc
model.h

index adc47cd058b00f43262060bf8832b13a8bff5f9d..e496abd012a537b13019c292741a8dda6bc71935 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -17,7 +17,7 @@ ModelChecker::ModelChecker()
 
        rootNode = new TreeNode(NULL);
        currentNode = rootNode;
-       action_trace = new std::list<class ModelAction *>();
+       action_trace = new action_list_t();
 }
 
 ModelChecker::~ModelChecker()
@@ -53,7 +53,7 @@ ModelAction *ModelChecker::get_last_conflict(ModelAction *act)
                default:
                        break;
        }
-       std::list<class ModelAction *>::reverse_iterator rit;
+       action_list_t::reverse_iterator rit;
        for (rit = action_trace->rbegin(); rit != action_trace->rend(); rit++) {
                ModelAction *prev = *rit;
                if (prev->get_location() != loc)
@@ -112,7 +112,7 @@ void ModelChecker::check_current_action(void)
 
 void ModelChecker::print_trace(void)
 {
-       std::list<class ModelAction *>::iterator it;
+       action_list_t::iterator it;
 
        printf("\n");
        printf("---------------------------------------------------------------------\n");
diff --git a/model.h b/model.h
index b62ab80a1b490fbbda331a7f0c1fbac09540bf1a..a347350acea1b7aadc65e6eb78e2938107e4e181 100644 (file)
--- a/model.h
+++ b/model.h
@@ -20,6 +20,8 @@ typedef enum action_type {
        ATOMIC_WRITE
 } action_type_t;
 
+typedef std::list<class ModelAction *> action_list_t;
+
 class ModelAction {
 public:
        ModelAction(action_type_t type, memory_order order, void *loc, int value);
@@ -65,7 +67,7 @@ public:
 private:
        int used_thread_id;
        class ModelAction *current_action;
-       std::list<class ModelAction *> *action_trace;
+       action_list_t *action_trace;
        std::map<thread_id_t, class Thread *> thread_map;
        class TreeNode *rootNode, *currentNode;
 };