We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 14dc11e + 5953f6a commit ff0414eCopy full SHA for ff0414e
src/goto-instrument/wmm/abstract_event.h
@@ -183,9 +183,15 @@ class abstract_eventt:public graph_nodet<empty_edget>
183
184
unsigned char fence_value() const
185
{
186
- unsigned char value = WRfence + 2*WWfence + 4*RRfence + 8*RWfence
187
- + 16*WWcumul + 32*RWcumul + 64*RRcumul;
188
- return value;
+ return uc(WRfence) + 2u * uc(WWfence) + 4u * uc(RRfence) +
+ 8u * uc(RWfence) + 16u * uc(WWcumul) + 32u * uc(RWcumul) +
+ 64u * uc(RRcumul);
189
+ }
190
+
191
+private:
192
+ static unsigned char uc(bool truth_value)
193
+ {
194
+ return truth_value ? 1u : 0u;
195
}
196
};
197
0 commit comments