model: make print_list() into a static C function
authorBrian Norris <banorris@uci.edu>
Thu, 21 Jun 2012 22:13:56 +0000 (15:13 -0700)
committerBrian Norris <banorris@uci.edu>
Thu, 21 Jun 2012 22:17:38 +0000 (15:17 -0700)
This function does not need to be a class member function. It only performs
a standard 'printing' option on a STL list of ModelAction objects.

model.cc
model.h

index 91ceae4e412ed66f38398510223abbd7d790c4fd..93e06d0262de2b4c4d93bf8c9207f018b710cb3e 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -346,19 +346,7 @@ void ModelChecker::build_reads_from_past(ModelAction *curr)
        }
 }
 
        }
 }
 
-void ModelChecker::print_summary(void)
-{
-       printf("\n");
-       printf("Number of executions: %d\n", num_executions);
-       printf("Total nodes created: %d\n", node_stack->get_total_nodes());
-
-       scheduler->print();
-
-       print_list(action_trace);
-       printf("\n");
-}
-
-void ModelChecker::print_list(action_list_t *list)
+static void print_list(action_list_t *list)
 {
        action_list_t::iterator it;
 
 {
        action_list_t::iterator it;
 
@@ -371,6 +359,18 @@ void ModelChecker::print_list(action_list_t *list)
        printf("---------------------------------------------------------------------\n");
 }
 
        printf("---------------------------------------------------------------------\n");
 }
 
+void ModelChecker::print_summary(void)
+{
+       printf("\n");
+       printf("Number of executions: %d\n", num_executions);
+       printf("Total nodes created: %d\n", node_stack->get_total_nodes());
+
+       scheduler->print();
+
+       print_list(action_trace);
+       printf("\n");
+}
+
 int ModelChecker::add_thread(Thread *t)
 {
        (*thread_map)[id_to_int(t->get_id())] = t;
 int ModelChecker::add_thread(Thread *t)
 {
        (*thread_map)[id_to_int(t->get_id())] = t;
diff --git a/model.h b/model.h
index ab961f840b03613492a4da2b8585453bbe6b2847..4635644b6b40b6bf1cfda8d08fc587b3a0fe67bb 100644 (file)
--- a/model.h
+++ b/model.h
@@ -80,8 +80,6 @@ private:
        ModelAction * get_parent_action(thread_id_t tid);
        void build_reads_from_past(ModelAction *curr);
 
        ModelAction * get_parent_action(thread_id_t tid);
        void build_reads_from_past(ModelAction *curr);
 
-       void print_list(action_list_t *list);
-
        ModelAction *current_action;
        ModelAction *diverge;
        thread_id_t nextThread;
        ModelAction *current_action;
        ModelAction *diverge;
        thread_id_t nextThread;