fix warnings
authorDerek Yeh <djyeh@plrg-1.ics.uci.edu>
Wed, 22 Jul 2020 00:56:16 +0000 (17:56 -0700)
committerDerek Yeh <djyeh@plrg-1.ics.uci.edu>
Wed, 22 Jul 2020 00:56:16 +0000 (17:56 -0700)
model.cc
model.h

index 03f4648..0493e7e 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -373,9 +373,9 @@ uint64_t ModelChecker::switch_thread(ModelAction *act)
 
        } while (next->is_model_thread() || next->is_complete() || next->get_pending() && curr_thread_num < get_num_threads()); 
        */
-       Thread *next;
+       Thread *next = NULL;
        curr_thread_num++;
-       while (curr_thread_num < get_num_threads) {
+       while (curr_thread_num < get_num_threads()) {
                thread_id_t tid = int_to_id(curr_thread_num);
                next = get_thread(tid);
                if (!next->is_model_thread() && !next->is_complete() && !next->get_pending())
@@ -450,7 +450,7 @@ void ModelChecker::run()
                        curr_thread_num = 0;
                        thread_id_t tid = int_to_id(0);
                        Thread *thr = get_thread(tid);
-                       switch_from_master(tid);
+                       switch_from_master(thr);
                        /*
                        for (unsigned int i = 0;i < get_num_threads();i++) {
                                thread_id_t tid = int_to_id(i);
diff --git a/model.h b/model.h
index a1a04d1..8a2f9c6 100644 (file)
--- a/model.h
+++ b/model.h
@@ -78,7 +78,7 @@ private:
 
        int execution_number;
 
-       int curr_thread_num;
+       unsigned int curr_thread_num;
 
        unsigned int get_num_threads() const;