add more const qualifiers
authorBrian Norris <banorris@uci.edu>
Fri, 6 Jul 2012 23:08:34 +0000 (16:08 -0700)
committerBrian Norris <banorris@uci.edu>
Fri, 6 Jul 2012 23:08:34 +0000 (16:08 -0700)
action.cc
action.h
clockvector.cc
clockvector.h

index 6627714e1089b2ad16c85cc7ef4abe43d77b6f95..68a34aad8c76476084052c8fa615c5c54a502e1f 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -115,7 +115,7 @@ bool ModelAction::is_synchronizing(const ModelAction *act) const
        return false;
 }
 
-void ModelAction::create_cv(ModelAction *parent)
+void ModelAction::create_cv(const ModelAction *parent)
 {
        ASSERT(cv == NULL);
 
@@ -125,7 +125,7 @@ void ModelAction::create_cv(ModelAction *parent)
                cv = new ClockVector(NULL, this);
 }
 
-void ModelAction::read_from(ModelAction *act)
+void ModelAction::read_from(const ModelAction *act)
 {
        ASSERT(cv);
        if (act->is_release() && this->is_acquire())
@@ -139,7 +139,7 @@ void ModelAction::read_from(ModelAction *act)
  * @return true if this action's thread has synchronized with act's thread
  * since the execution of act, false otherwise.
  */
-bool ModelAction::happens_before(ModelAction *act)
+bool ModelAction::happens_before(const ModelAction *act) const
 {
        return act->cv->synchronized_since(this);
 }
index 0200111df387e586c4346c1858c0f139a6c6f4ce..c84381dcff935e0689afa5dac314f589cdb7fae2 100644 (file)
--- a/action.h
+++ b/action.h
@@ -58,11 +58,11 @@ public:
        bool same_thread(const ModelAction *act) const;
        bool is_synchronizing(const ModelAction *act) const;
 
-       void create_cv(ModelAction *parent = NULL);
+       void create_cv(const ModelAction *parent = NULL);
        ClockVector * get_cv() const { return cv; }
-       void read_from(ModelAction *act);
+       void read_from(const ModelAction *act);
 
-       bool happens_before(ModelAction *act);
+       bool happens_before(const ModelAction *act) const;
 
        inline bool operator <(const ModelAction& act) const {
                return get_seq_number() < act.get_seq_number();
index e0ced522a14f88520f072248d54c7d3de9cee630..cfd99c66177568a642947c2959d87582010282c8 100644 (file)
@@ -75,7 +75,7 @@ void ClockVector::merge(ClockVector *cv)
  * thread, false otherwise. That is, this function returns:
  * <BR><CODE>act <= cv[act->tid]</CODE>
  */
-bool ClockVector::synchronized_since(ModelAction *act) const
+bool ClockVector::synchronized_since(const ModelAction *act) const
 {
        int i = id_to_int(act->get_tid());
 
index 82f1e3774608229f33f1379e9037e37fff5b87a2..1428886c80f692891a8103be8e721bc07644cdf7 100644 (file)
@@ -17,7 +17,7 @@ public:
        ClockVector(ClockVector *parent = NULL, ModelAction *act = NULL);
        ~ClockVector();
        void merge(ClockVector *cv);
-       bool synchronized_since(ModelAction *act) const;
+       bool synchronized_since(const ModelAction *act) const;
 
        void print() const;
        modelclock_t getClock(thread_id_t thread);