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 91ceae4..93e06d0 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;
 
@@ -371,6 +359,18 @@ void ModelChecker::print_list(action_list_t *list)
        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;
diff --git a/model.h b/model.h
index ab961f8..4635644 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);
 
-       void print_list(action_list_t *list);
-
        ModelAction *current_action;
        ModelAction *diverge;
        thread_id_t nextThread;