Commit ba5aff24 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

Replace << "c" by << 'c', and check for it in style.sh

* src/sanity/style.test: Add a test.
* iface/dve2/dve2.cc, iface/dve2/dve2check.cc, src/bin/common_output.cc,
src/bin/dstar2tgba.cc, src/bin/ltl2tgba.cc, src/bin/ltlcross.cc,
src/dstarparse/dra2ba.cc, src/dstarparse/fmterror.cc,
src/dstarparse/nsa2tgba.cc, src/kripke/kripkeprint.cc,
src/kripkeparse/fmterror.cc, src/ltlast/atomic_prop.cc,
src/ltlast/bunop.cc, src/ltltest/ltlrel.cc, src/ltltest/reduc.cc,
src/ltltest/syntimpl.cc, src/ltlvisit/dotty.cc, src/ltlvisit/lbt.cc,
src/ltlvisit/randomltl.cc, src/ltlvisit/relabel.cc,
src/ltlvisit/simplify.cc, src/ltlvisit/tostring.cc, src/misc/bitvect.cc,
src/misc/optionmap.cc, src/misc/timer.cc, src/neverparse/fmterror.cc,
src/priv/freelist.cc, src/saba/sabacomplementtgba.cc,
src/sabaalgos/sabadotty.cc, src/taalgos/dotty.cc,
src/taalgos/minimize.cc, src/tgba/bdddict.cc, src/tgba/bddprint.cc,
src/tgba/futurecondcol.cc, src/tgba/taatgba.hh,
src/tgba/tgbakvcomplement.cc, src/tgba/tgbasafracomplement.cc,
src/tgbaalgos/compsusp.cc, src/tgbaalgos/cycles.cc,
src/tgbaalgos/dotty.cc, src/tgbaalgos/dtbasat.cc,
src/tgbaalgos/dtgbasat.cc, src/tgbaalgos/emptiness.cc,
src/tgbaalgos/gtec/gtec.cc, src/tgbaalgos/gv04.cc,
src/tgbaalgos/lbtt.cc, src/tgbaalgos/ltl2tgba_fm.cc,
src/tgbaalgos/minimize.cc, src/tgbaalgos/neverclaim.cc,
src/tgbaalgos/powerset.cc, src/tgbaalgos/replayrun.cc,
src/tgbaalgos/save.cc, src/tgbaalgos/scc.cc, src/tgbaalgos/sccfilter.cc,
src/tgbaalgos/weight.cc, src/tgbaalgos/word.cc,
src/tgbaparse/fmterror.cc, src/tgbatest/bitvect.cc,
src/tgbatest/complementation.cc, src/tgbatest/intvcmp2.cc,
src/tgbatest/intvcomp.cc, src/tgbatest/ltl2tgba.cc,
src/tgbatest/randtgba.cc: Replace << "c" by << 'c' when
appropriate.
parent 49c66c63
......@@ -440,8 +440,8 @@ namespace spot
std::cerr << "Possible states are:";
for (ei = enum_map[type_num].begin();
ei != enum_map[type_num].end(); ++ei)
std::cerr << " " << ei->first;
std::cerr << std::endl;
std::cerr << ' ' << ei->first;
std::cerr << '\n';
free(name);
++errors;
......@@ -566,8 +566,8 @@ namespace spot
std::cerr << "Possible states are:";
for (ei = enum_map[type_num].begin();
ei != enum_map[type_num].end(); ++ei)
std::cerr << " " << ei->first;
std::cerr << std::endl;
std::cerr << ' ' << ei->first;
std::cerr << '\n';
free(name);
++errors;
......@@ -906,7 +906,7 @@ namespace spot
++i;
continue;
}
res << vname_[i] << "=" << vars[i];
res << vname_[i] << '=' << vars[i];
++i;
if (i == state_size_)
break;
......@@ -993,7 +993,7 @@ namespace spot
if (verbose)
std::cerr << "Execution of `" << command.c_str()
<< "' returned exit code " << WEXITSTATUS(res)
<< "." << std::endl;
<< ".\n";
return true;
}
return false;
......@@ -1088,7 +1088,7 @@ namespace spot
{
if (verbose)
std::cerr << "Failed to resolve some symbol while loading `"
<< file << "'" << std::endl;
<< file << "'\n";
delete d;
lt_dlexit();
return 0;
......
// Copyright (C) 2011, 2012, 2013 Laboratoire de Recherche et
// -*- coding: utf-8 -*-
// Copyright (C) 2011, 2012, 2013, 2014 Laboratoire de Recherche et
// Developpement de l'Epita (LRDE)
//
// This file is part of Spot, a model checking library.
......@@ -186,7 +187,7 @@ main(int argc, char **argv)
if (!echeck_inst)
{
std::cerr << "Failed to parse argument of -e/-E near `"
<< err << "'" << std::endl;
<< err << "'\n";
exit_code = 1;
goto safe_exit;
}
......
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -242,10 +242,10 @@ output_formula(std::ostream& out,
if (!format)
{
if (prefix)
out << prefix << ",";
out << prefix << ',';
stream_escapable_formula(out, f, filename, linenum);
if (suffix)
out << "," << suffix;
out << ',' << suffix;
}
else
{
......
......@@ -347,7 +347,7 @@ namespace
spot::never_claim_reachable(std::cout, aut);
break;
case Stats:
statistics.print(daut, aut, filename, conversion_time) << "\n";
statistics.print(daut, aut, filename, conversion_time) << '\n';
break;
}
delete aut;
......
......@@ -262,7 +262,7 @@ namespace
spot::never_claim_reachable(std::cout, aut, f);
break;
case Stats:
statistics.print(aut, f, translation_time) << "\n";
statistics.print(aut, f, translation_time) << '\n';
break;
}
delete aut;
......
......@@ -1061,11 +1061,11 @@ namespace
std::ostream& err = global_error();
err << "error: ";
if (icomp)
err << "Comp(N" << i << ")";
err << "Comp(N" << i << ')';
else
err << "P" << i;
err << 'P' << i;
if (jcomp)
err << "*Comp(P" << j << ")";
err << "*Comp(P" << j << ')';
else
err << "*N" << j;
err << " is nonempty";
......@@ -1079,12 +1079,12 @@ namespace
<< " ";
spot::tgba_word w(runmin);
w.simplify();
w.print(example(), prod->get_dict()) << "\n";
w.print(example(), prod->get_dict()) << '\n';
delete runmin;
}
else
{
std::cerr << "\n";
std::cerr << '\n';
}
end_error();
}
......@@ -1142,7 +1142,7 @@ namespace
}
err << "} when evaluating ";
if (products > 1)
err << "state-space #" << p << "/" << products << "\n";
err << "state-space #" << p << '/' << products << '\n';
else
err << "the state-space\n";
end_error();
......@@ -1233,14 +1233,14 @@ namespace
// complains.
std::string fstr = runner.formula();
if (filename)
std::cerr << filename << ":";
std::cerr << filename << ':';
if (linenum)
std::cerr << linenum << ":";
std::cerr << linenum << ':';
if (filename || linenum)
std::cerr << " ";
std::cerr << ' ';
if (color_opt)
std::cerr << bright_white;
std::cerr << fstr << "\n";
std::cerr << fstr << '\n';
if (color_opt)
std::cerr << reset_color;
......@@ -1465,9 +1465,9 @@ namespace
<< " and N" << i;
if (products > 1)
err << " for state-space #" << p
<< "/" << products << "\n";
<< '/' << products << '\n';
else
err << "\n";
err << '\n';
end_error();
}
}
......
// Copyright (C) 2013 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// -*- coding: utf-8 -*-
// Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -350,7 +351,7 @@ namespace spot
bool scc_realizable = filter_states(dra->aut, dra, sl, final, nonfinal);
dba_realizable &= scc_realizable;
realizable[scc] = scc_realizable;
//std::cerr << "realizable[" << scc << "] = " << scc_realizable << "\n";
//std::cerr << "realizable[" << scc << "] = " << scc_realizable << '\n';
}
if (dba)
......
// Copyright (C) 2013 Laboratoire de Recherche et Dveloppement de
// l'Epita (LRDE).
// -*- coding: utf-8 -*-
// Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -31,7 +32,7 @@ namespace spot
for (it = error_list.begin(); it != error_list.end(); ++it)
{
if (filename != "-")
os << filename << ":";
os << filename << ':';
os << it->first << ": ";
os << it->second << std::endl;
printed = true;
......
// Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// -*- coding: utf-8 -*-
// Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -222,7 +223,7 @@ namespace spot
// bs2num_map::iterator i = bs2num.begin();
// while (i != bs2num.end())
// {
// std::cerr << i->second << ": (" << i->first.s << ",";
// std::cerr << i->second << ": (" << i->first.s << ',';
// if (i->first.pend)
// std::cerr << *i->first.pend << ")\n";
// else
......
// -*- coding: utf-8 -*-
// Copyright (C) 2011, 2012 Laboratoire de Recherche et Developpement
// de l'Epita (LRDE)
// Copyright (C) 2011, 2012, 2014 Laboratoire de Recherche et
// Developpement de l'Epita (LRDE)
//
// This file is part of Spot, a model checking library.
//
......@@ -42,7 +42,7 @@ namespace spot
void process_state(const state* s, int, tgba_succ_iterator* si)
{
const bdd_dict* d = aut_->get_dict();
os_ << "\"";
os_ << '"';
escape_str(os_, aut_->format_state(s));
os_ << "\", \"";
const kripke* automata = down_cast<const kripke*> (aut_);
......@@ -56,7 +56,7 @@ namespace spot
state* dest = si->current_state();
os_ << " \"";
escape_str(os_, aut_->format_state(dest));
os_ << "\"";
os_ << '"';
}
os_ << ";\n";
}
......@@ -89,7 +89,7 @@ namespace spot
notfirst = true;
const bdd_dict* d = aut_->get_dict();
os_ << "S" << in_s << ", \"";
os_ << 'S' << in_s << ", \"";
const kripke* automata = down_cast<const kripke*>(aut_);
assert(automata);
escape_str(os_, bdd_format_formula(d,
......
// Copyright (C) 2011 Laboratoire de Recherche et Developpement
// -*- coding: utf-8 -*-
// Copyright (C) 2011, 2014 Laboratoire de Recherche et Développement
// de l'Epita (LRDE)
//
// This file is part of Spot, a model checking library.
......@@ -31,7 +32,7 @@ namespace spot
for (it = error_list.begin(); it != error_list.end(); ++it)
{
if (filename != "-")
os << filename << ":";
os << filename << ':';
os << it->first << ": ";
os << it->second << std::endl;
printed = true;
......
......@@ -112,7 +112,7 @@ namespace spot
for (const auto& i: instances)
os << i.second << " = " << i.second->ref_count_()
<< " * atomic_prop(" << i.first.first << ", "
<< i.first.second->name() << ")" << std::endl;
<< i.first.second->name() << ')' << std::endl;
return os;
}
......
......@@ -89,7 +89,7 @@ namespace spot
out << "unbounded";
else
out << max_;
out << ")";
out << ')';
return out.str();
}
......@@ -144,7 +144,7 @@ namespace spot
out << max_;
}
}
out << "]";
out << ']';
return out.str();
}
......
// -*- coding: utf-8 -*-
// Copyright (C) 2013 Laboratoire de Recherche et Developement de
// l'Epita (LRDE).
// Copyright (C) 2013, 2014 Laboratoire de Recherche et Developement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -47,7 +47,7 @@ main(int argc, char **argv)
spot::ltl::relabeling_map* m = new spot::ltl::relabeling_map;
const spot::ltl::formula* f2 = spot::ltl::relabel_bse(f1, spot::ltl::Pnn, m);
f1->destroy();
spot::ltl::to_string(f2, std::cout) << "\n";
spot::ltl::to_string(f2, std::cout) << '\n';
typedef std::map<std::string, std::string> map_t;
......@@ -59,7 +59,7 @@ main(int argc, char **argv)
for (map_t::const_iterator i = sorted_map.begin();
i != sorted_map.end(); ++i)
std::cout << " " << i->first << " -> "
<< i->second << "\n";
<< i->second << '\n';
f2->destroy();
delete m;
......
// Copyright (C) 2008, 2009, 2010, 2011, 2012 Laboratoire de Recherche
// Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 Laboratoire de Recherche
// et Dveloppement de l'Epita (LRDE).
// Copyright (C) 2004, 2006, 2007 Laboratoire d'Informatique de Paris
// 6 (LIP6), dpartement Systmes Rpartis Coopratifs (SRC),
......@@ -258,11 +258,11 @@ main(int argc, char** argv)
// If -h is set, we want to print only formulae that have become larger.
if (!f2 && (!hidereduc || (length_f1_after > length_f1_before)))
{
std::cout << length_f1_before << " " << length_f1_after
<< " '" << f1s_before << "' reduce to '" << f1s_after << "'";
std::cout << length_f1_before << ' ' << length_f1_after
<< " '" << f1s_before << "' reduce to '" << f1s_after << '\'';
if (f1l != "" && f1l != f1s_after)
std::cout << " or (w/o rss) to '" << f1l << "'";
std::cout << std::endl;
std::cout << " or (w/o rss) to '" << f1l << '\'';
std::cout << '\n';
}
if (f2)
......@@ -311,7 +311,7 @@ main(int argc, char** argv)
float before = sum_before;
float after = sum_after;
std::cout << "gain: "
<< (1 - (after / before)) * 100 << "%" << std::endl;
<< (1 - (after / before)) * 100 << '%' << std::endl;
delete fin;
}
......
// -*- coding: utf-8 -*-
// Copyright (C) 2008, 2009, 2010, 2011, 2012 Laboratoire de Recherche
// et Développement de l'Epita (LRDE).
// Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 Laboratoire de
// Recherche et Développement de l'Epita (LRDE).
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
// Pierre et Marie Curie.
......@@ -74,7 +74,7 @@ main(int argc, char** argv)
std::cout << "Test f1 < f2" << std::endl;
if (c->syntactic_implication(f1, f2))
{
std::cout << f1s << " < " << f2s << std::endl;
std::cout << f1s << " < " << f2s << '\n';
exit_return = 1;
}
break;
......@@ -83,7 +83,7 @@ main(int argc, char** argv)
std::cout << "Test !f1 < f2" << std::endl;
if (c->syntactic_implication_neg(f1, f2, false))
{
std::cout << "!(" << f1s << ") < " << f2s << std::endl;
std::cout << "!(" << f1s << ") < " << f2s << '\n';
exit_return = 1;
}
break;
......@@ -92,7 +92,7 @@ main(int argc, char** argv)
std::cout << "Test f1 < !f2" << std::endl;
if (c->syntactic_implication_neg(f1, f2, true))
{
std::cout << f1s << " < !(" << f2s << ")" << std::endl;
std::cout << f1s << " < !(" << f2s << ")\n";
exit_return = 1;
}
break;
......@@ -100,8 +100,8 @@ main(int argc, char** argv)
break;
}
spot::ltl::dump(std::cout, f1) << std::endl;
spot::ltl::dump(std::cout, f2) << std::endl;
spot::ltl::dump(std::cout, f1) << '\n';
spot::ltl::dump(std::cout, f2) << '\n';
f1->destroy();
f2->destroy();
......
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2011, 2012, 2013 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
// Recherche et Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
// Pierre et Marie Curie.
......@@ -160,7 +160,7 @@ namespace spot
os_ << " [taillabel=\"L\"]";
else if (childnum == -2)
os_ << " [taillabel=\"R\"]";
os_ << ";" << std::endl;
os_ << ';' << std::endl;
}
father_ = node;
......@@ -190,7 +190,7 @@ namespace spot
os << "digraph G {" << std::endl;
f->accept(v);
v.finish();
os << "}" << std::endl;
os << '}' << std::endl;
return os;
}
......
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -88,10 +88,10 @@ namespace spot
switch (c->val())
{
case constant::False:
os_ << "f";
os_ << 'f';
break;
case constant::True:
os_ << "t";
os_ << 't';
break;
case constant::EmptyWord:
assert(!"unsupported constant");
......@@ -106,25 +106,25 @@ namespace spot
switch (bo->op())
{
case binop::Xor:
os_ << "^";
os_ << '^';
break;
case binop::Implies:
os_ << "i";
os_ << 'i';
break;
case binop::Equiv:
os_ << "e";
os_ << 'e';
break;
case binop::U:
os_ << "U";
os_ << 'U';
break;
case binop::R:
os_ << "V";
os_ << 'V';
break;
case binop::W:
os_ << "W";
os_ << 'W';
break;
case binop::M:
os_ << "M";
os_ << 'M';
break;
case binop::UConcat:
case binop::EConcat:
......@@ -149,16 +149,16 @@ namespace spot
switch (uo->op())
{
case unop::Not:
os_ << "!";
os_ << '!';
break;
case unop::X:
os_ << "X";
os_ << 'X';
break;
case unop::F:
os_ << "F";
os_ << 'F';
break;
case unop::G:
os_ << "G";
os_ << 'G';
break;
case unop::Finish:
case unop::Closure:
......
......@@ -291,7 +291,7 @@ namespace spot
random_formula::dump_priorities(std::ostream& os) const
{
for (unsigned i = 0; i < proba_size_; ++i)
os << proba_[i].name << "\t" << proba_[i].proba << std::endl;
os << proba_[i].name << '\t' << proba_[i].proba << '\n';
return os;
}
......
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
......@@ -57,7 +57,7 @@ namespace spot
const formula* next()
{
std::ostringstream s;
s << "p" << nn++;
s << 'p' << nn++;
return default_environment::instance().require(s.str());
}
};
......@@ -401,7 +401,7 @@ namespace spot
while (!s.empty())
{
// std::cerr << "-- visiting " << to_string(s.top().parent) << "\n";
// std::cerr << "-- visiting " << to_string(s.top().parent) << '\n';
stack_entry& e = s.top();
if (e.current_child != e.last_child)
{
......@@ -414,8 +414,8 @@ namespace spot
continue;
}
// std::cerr << " grand parent is "
// << to_string(e.grand_parent) << "\n"
// << " child is " << to_string(child) << "\n";
// << to_string(e.grand_parent)
// << "\n child is " << to_string(child) << '\n';
data_entry d = { num, num };
std::pair<fmap_t::iterator, bool> i =
data.insert(fmap_t::value_type(child, d));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment