Skip to content

Commit dd2d3b0

Browse files
tautschnigpeterschrammel
authored andcommitted
Code formatting in bmc.cpp (using string_utils)
1 parent 3679aee commit dd2d3b0

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/cbmc/bmc.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Author: Daniel Kroening, kroening@kroening.com
1313
#include <util/string2int.h>
1414
#include <util/i2string.h>
1515
#include <util/source_location.h>
16+
#include <util/string_utils.h>
1617
#include <util/time_stopping.h>
1718
#include <util/message.h>
1819
#include <util/json.h>
@@ -381,8 +382,9 @@ void bmct::show_program()
381382
{
382383
std::string string_value;
383384
languages.from_expr(step.ssa_lhs, string_value);
384-
std::cout << "(" << count << ") SHARED_" << (step.is_shared_write()?"WRITE":"READ") << "("
385-
<< string_value <<") " << "\n";
385+
std::cout << "(" << count << ") SHARED_"
386+
<< (step.is_shared_write()?"WRITE":"READ")
387+
<< "(" << string_value <<")\n";
386388

387389
if(!step.guard.is_true())
388390
{
@@ -665,13 +667,11 @@ Function: bmct::setup_unwind
665667
void bmct::setup_unwind()
666668
{
667669
const std::string &set=options.get_option("unwindset");
668-
std::string::size_type length=set.length();
670+
std::vector<std::string> unwindset_loops;
671+
split_string(set, ',', unwindset_loops, true, true);
669672

670-
for(std::string::size_type idx=0; idx<length; idx++)
673+
for(auto & val : unwindset_loops)
671674
{
672-
std::string::size_type next=set.find(",", idx);
673-
std::string val=set.substr(idx, next-idx);
674-
675675
unsigned thread_nr;
676676
bool thread_nr_set=false;
677677

@@ -695,9 +695,6 @@ void bmct::setup_unwind()
695695
else
696696
symex.set_unwind_loop_limit(id, uw);
697697
}
698-
699-
if(next==std::string::npos) break;
700-
idx=next;
701698
}
702699

703700
if(options.get_option("unwind")!="")

0 commit comments

Comments
 (0)