From bb168337e93650eddb90df61b109db4e1e8570c9 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 27 Feb 2013 14:45:11 -0800 Subject: [PATCH] un-'const' some Promises I need to modify this Promise sometimes, so don't make it const everywhere. --- action.cc | 2 +- action.h | 6 +++--- model.cc | 2 +- nodestack.cc | 2 +- nodestack.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/action.cc b/action.cc index 2390ecc..1309024 100644 --- a/action.cc +++ b/action.cc @@ -402,7 +402,7 @@ void ModelAction::set_read_from(const ModelAction *act) * Set this action's read-from promise * @param promise The promise to read from */ -void ModelAction::set_read_from_promise(const Promise *promise) +void ModelAction::set_read_from_promise(Promise *promise) { ASSERT(is_read()); reads_from_promise = promise; diff --git a/action.h b/action.h index 63c0375..87939f8 100644 --- a/action.h +++ b/action.h @@ -81,13 +81,13 @@ public: modelclock_t get_seq_number() const { return seq_number; } uint64_t get_value() const { return value; } const ModelAction * get_reads_from() const { return reads_from; } - const Promise * get_reads_from_promise() const { return reads_from_promise; } + Promise * get_reads_from_promise() const { return reads_from_promise; } Node * get_node() const; void set_node(Node *n) { node = n; } void set_read_from(const ModelAction *act); - void set_read_from_promise(const Promise *promise); + void set_read_from_promise(Promise *promise); /** Store the most recent fence-release from the same thread * @param fence The fence-release that occured prior to this */ @@ -175,7 +175,7 @@ private: const ModelAction *reads_from; /** The promise that this action reads from. Only valid for reads */ - const Promise *reads_from_promise; + Promise *reads_from_promise; /** The last fence release from the same thread */ const ModelAction *last_fence_release; diff --git a/model.cc b/model.cc index cb53e11..44fba7e 100644 --- a/model.cc +++ b/model.cc @@ -872,7 +872,7 @@ bool ModelChecker::process_read(ModelAction *curr) break; } case READ_FROM_PROMISE: { - const Promise *promise = curr->get_node()->get_read_from_promise(); + Promise *promise = curr->get_node()->get_read_from_promise(); value = promise->get_value(); curr->set_read_from_promise(promise); mo_graph->startChanges(); diff --git a/nodestack.cc b/nodestack.cc index 131b06c..e6f0269 100644 --- a/nodestack.cc +++ b/nodestack.cc @@ -455,7 +455,7 @@ void Node::add_read_from_promise(const ModelAction *reader) * where this->action is a 'read'. * @return The current element in read_from_promises */ -const Promise * Node::get_read_from_promise() const +Promise * Node::get_read_from_promise() const { if (read_from_promise_idx < 0 || read_from_promise_idx >= ((int)read_from_promises.size())) return NULL; diff --git a/nodestack.h b/nodestack.h index fc566d6..f478db2 100644 --- a/nodestack.h +++ b/nodestack.h @@ -75,7 +75,7 @@ public: int get_read_from_past_size() const; void add_read_from_promise(const ModelAction *reader); - const Promise * get_read_from_promise() const; + Promise * get_read_from_promise() const; bool add_future_value(struct future_value fv); struct future_value get_future_value() const; -- 2.34.1