model: change type for ModelChecker::get_id()
[c11tester.git] / model.cc
index f447c1dfa50e98139b4b1b30a7cb5d9d5a6a5060..f541d48d6114a25c5602fcadda7af1a4377df293 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -38,9 +38,8 @@ void ModelChecker::reset_to_initial_state()
 {
        DEBUG("+++ Resetting to initial state +++\n");
        std::map<thread_id_t, class Thread *>::iterator it;
-       for (it = thread_map.begin(); it != thread_map.end(); it++) {
+       for (it = thread_map.begin(); it != thread_map.end(); it++)
                delete (*it).second;
-       }
        thread_map.clear();
        action_trace = new action_list_t();
        currentNode = rootNode;
@@ -49,7 +48,7 @@ void ModelChecker::reset_to_initial_state()
        /* scheduler reset ? */
 }
 
-int ModelChecker::get_next_id()
+thread_id_t ModelChecker::get_next_id()
 {
        return ++used_thread_id;
 }
@@ -332,5 +331,5 @@ void ModelAction::print(void)
                type_str = "unknown type";
        }
 
-       printf("Thread: %d\tAction: %s\tMO: %d\tLoc: %#014zx\tValue: %d\n", tid, type_str, order, (size_t)location, value);
+       printf("Thread: %d\tAction: %s\tMO: %d\tLoc: %#014zx\tValue: %d\n", id_to_int(tid), type_str, order, (size_t)location, value);
 }