From: Brian Norris Date: Fri, 12 Oct 2012 17:52:00 +0000 (-0700) Subject: fixup 'int' vs. 'thread_id_t' usage X-Git-Tag: pldi2013~46 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=commitdiff_plain;h=8c82e3813dcbe9f61197a45d0543abc5d131a0fa fixup 'int' vs. 'thread_id_t' usage --- diff --git a/action.cc b/action.cc index 16f2327..140d590 100644 --- a/action.cc +++ b/action.cc @@ -492,7 +492,7 @@ unsigned int ModelAction::hash() const unsigned int hash=(unsigned int) this->type; hash^=((unsigned int)this->order)<<3; hash^=seq_number<<5; - hash^=tid<<6; + hash ^= id_to_int(tid) << 6; if (is_read()) { if (reads_from) diff --git a/nodestack.cc b/nodestack.cc index ec7ce16..7471c74 100644 --- a/nodestack.cc +++ b/nodestack.cc @@ -51,7 +51,7 @@ Node::Node(ModelAction *act, Node *par, int nthreads, Node *prevfairness) if (prevfi) { *fi=*prevfi; } - if (parent->is_enabled(i)) { + if (parent->is_enabled(int_to_id(i))) { fi->enabled_count++; } if (i==currtid) { @@ -60,7 +60,7 @@ Node::Node(ModelAction *act, Node *par, int nthreads, Node *prevfairness) } //Do window processing if (prevfairness != NULL) { - if (prevfairness -> parent->is_enabled(i)) + if (prevfairness -> parent->is_enabled(int_to_id(i))) fi->enabled_count--; if (i==prevtid) { fi->turns--; diff --git a/schedule.cc b/schedule.cc index f68cb52..14e6475 100644 --- a/schedule.cc +++ b/schedule.cc @@ -148,7 +148,7 @@ Thread * Scheduler::next_thread(Thread *t) thread_id_t curr_tid=int_to_id(curr_thread_index); if (enabled[curr_thread_index]==THREAD_ENABLED&& (!have_enabled_thread_with_priority||n->has_priority(curr_tid))) { - t = model->get_thread(int_to_id(curr_tid)); + t = model->get_thread(curr_tid); break; } if (curr_thread_index == old_curr_thread) {