Skip to content

Commit 826fd63

Browse files
committed
goto-instrument/wmm: Use int for bit vector of Booleans
Using an unsigned type is an unnecessary type conversion.
1 parent 8187bdd commit 826fd63

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/goto-instrument/wmm/abstract_event.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ bool abstract_eventt::unsafe_pair_lwfence_param(const abstract_eventt &next,
100100

101101
bool abstract_eventt::unsafe_pair_asm(const abstract_eventt &next,
102102
memory_modelt model,
103-
unsigned char met) const
103+
int met) const
104104
{
105105
/* pairs with fences are not properly pairs */
106106
if(operation==operationt::Fence ||

src/goto-instrument/wmm/abstract_event.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class abstract_eventt:public graph_nodet<empty_edget>
144144
bool unsafe_pair_asm(
145145
const abstract_eventt &next,
146146
memory_modelt model,
147-
unsigned char met) const;
147+
int met) const;
148148

149149
std::string get_operation() const
150150
{
@@ -181,9 +181,9 @@ class abstract_eventt:public graph_nodet<empty_edget>
181181
bool is_direct() const { return WWfence || WRfence || RRfence || RWfence; }
182182
bool is_cumul() const { return WWcumul || RWcumul || RRcumul; }
183183

184-
unsigned char fence_value() const
184+
int fence_value() const
185185
{
186-
unsigned char value = WRfence + 2*WWfence + 4*RRfence + 8*RWfence
186+
int value = WRfence + 2*WWfence + 4*RRfence + 8*RWfence
187187
+ 16*WWcumul + 32*RWcumul + 64*RRcumul;
188188
return value;
189189
}

src/goto-instrument/wmm/event_graph.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ bool event_grapht::critical_cyclet::is_unsafe_asm(
565565
{
566566
egraph.message.debug() << "cycle is safe?" << messaget::eom;
567567
bool unsafe_met=false;
568-
unsigned char fences_met=0;
568+
int fences_met = 0;
569569

570570
/* critical cycles contain at least 4 events */
571571
if(size()<4)

0 commit comments

Comments
 (0)