action: refactor ATOMIC_READ printing
[model-checker.git] / action.cc
index e88fceef66a8d173e851f4439afd55f1d96564f4..a11467587901f258a03b9e11623403f60f3d1263 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -470,7 +470,11 @@ void ModelAction::print() const
                type_str = "unknown type";
        }
 
-       uint64_t valuetoprint=type==ATOMIC_READ?(reads_from!=NULL?reads_from->value:VALUE_NONE):value;
+       uint64_t valuetoprint;
+       if (type == ATOMIC_READ && reads_from != NULL)
+               valuetoprint = reads_from->value;
+       else
+               valuetoprint = value;
 
        switch (this->order) {
        case std::memory_order_relaxed: