From 17a0e8e736bf745dffec039a5eacc404349e04e5 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 12 Dec 2012 23:19:15 -0800 Subject: [PATCH] nodestack: fixup style --- nodestack.cc | 24 ++++++++++++------------ nodestack.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/nodestack.cc b/nodestack.cc index 0a15db2..58741f7 100644 --- a/nodestack.cc +++ b/nodestack.cc @@ -42,7 +42,7 @@ Node::Node(ModelAction *act, Node *par, int nthreads, Node *prevfairness) act->set_node(this); int currtid = id_to_int(act->get_tid()); int prevtid = (prevfairness != NULL) ? id_to_int(prevfairness->action->get_tid()) : 0; - + if (model->params.fairwindow != 0) { for (int i = 0; i < nthreads; i++) { ASSERT(i < ((int)fairness.size())); @@ -138,7 +138,7 @@ bool Node::increment_promise() { if (promises[i] == (PROMISE_RMW|PROMISE_FULFILLED)) rmw_count++; } - + for (unsigned int i = 0; i < promises.size(); i++) { if ((promises[i] & PROMISE_MASK) == PROMISE_UNFULFILLED) { if ((rmw_count > 0) && (promises[i] & PROMISE_RMW)) { @@ -166,7 +166,7 @@ bool Node::increment_promise() { bool Node::promise_empty() const { bool fulfilledrmw = false; - for (int i = promises.size() - 1 ; i >= 0; i--) { + for (int i = promises.size() - 1; i >= 0; i--) { if (promises[i] == PROMISE_UNFULFILLED) return false; if (!fulfilledrmw && ((promises[i]&PROMISE_MASK) == PROMISE_UNFULFILLED)) @@ -189,7 +189,7 @@ int Node::get_misc() const } bool Node::increment_misc() { - return (misc_index= 0 && future_index<((int)future_values.size())); + ASSERT(future_index >= 0 && future_index < ((int)future_values.size())); return future_values[future_index].value; } modelclock_t Node::get_future_value_expiration() const { - ASSERT(future_index >= 0 && future_index<((int)future_values.size())); + ASSERT(future_index >= 0 && future_index < ((int)future_values.size())); return future_values[future_index].expiration; } @@ -486,7 +486,7 @@ bool Node::relseq_break_empty() const void Node::explore(thread_id_t tid) { int i = id_to_int(tid); - ASSERT(i<((int)backtrack.size())); + ASSERT(i < ((int)backtrack.size())); if (backtrack[i]) { backtrack[i] = false; numBacktracks--; @@ -556,7 +556,7 @@ void NodeStack::pop_restofstack(int numAhead) { /* Diverging from previous execution; clear out remainder of list */ unsigned int it = head_idx + numAhead; - for(unsigned int i = it; i < node_list.size(); i++) + for (unsigned int i = it; i < node_list.size(); i++) delete node_list[i]; node_list.resize(it); } diff --git a/nodestack.h b/nodestack.h index 44d739c..f6d3e4e 100644 --- a/nodestack.h +++ b/nodestack.h @@ -63,7 +63,7 @@ public: /* return true = backtrack set is empty */ bool backtrack_empty() const; - void explore_child(ModelAction *act, enabled_type_t * is_enabled); + void explore_child(ModelAction *act, enabled_type_t *is_enabled); /* return false = thread was already in backtrack */ bool set_backtrack(thread_id_t id); thread_id_t get_next_backtrack(); -- 2.34.1