Skip to content

Commit ff0414e

Browse files
authored
Merge pull request #2546 from tautschnig/vs-wmm-int
goto-instrument/wmm: Use int for bit vector of Booleans
2 parents 14dc11e + 5953f6a commit ff0414e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/goto-instrument/wmm/abstract_event.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,15 @@ class abstract_eventt:public graph_nodet<empty_edget>
183183

184184
unsigned char fence_value() const
185185
{
186-
unsigned char value = WRfence + 2*WWfence + 4*RRfence + 8*RWfence
187-
+ 16*WWcumul + 32*RWcumul + 64*RRcumul;
188-
return value;
186+
return uc(WRfence) + 2u * uc(WWfence) + 4u * uc(RRfence) +
187+
8u * uc(RWfence) + 16u * uc(WWcumul) + 32u * uc(RWcumul) +
188+
64u * uc(RRcumul);
189+
}
190+
191+
private:
192+
static unsigned char uc(bool truth_value)
193+
{
194+
return truth_value ? 1u : 0u;
189195
}
190196
};
191197

0 commit comments

Comments
 (0)