diff --git a/src/bin/common_finput.cc b/src/bin/common_finput.cc index 94335564d..c4d478333 100644 --- a/src/bin/common_finput.cc +++ b/src/bin/common_finput.cc @@ -1,6 +1,6 @@ // -*- 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. // @@ -56,10 +56,10 @@ parse_opt_finput(int key, char* arg, struct argp_state*) switch (key) { case 'f': - jobs.push_back(job(arg, false)); + jobs.emplace_back(arg, false); break; case 'F': - jobs.push_back(job(arg, true)); + jobs.emplace_back(arg, true); break; case OPT_LBT: lbt_input = true; diff --git a/src/bin/dstar2tgba.cc b/src/bin/dstar2tgba.cc index 1b4b92038..bc64f1a4e 100644 --- a/src/bin/dstar2tgba.cc +++ b/src/bin/dstar2tgba.cc @@ -1,5 +1,5 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2013 Laboratoire de Recherche et Développement de +// Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement de // l'Epita (LRDE). // // This file is part of Spot, a model checking library. @@ -140,7 +140,7 @@ parse_opt(int key, char* arg, struct argp_state*) type = spot::postprocessor::BA; break; case 'F': - jobs.push_back(job(arg, true)); + jobs.emplace_back(arg, true); break; case 'M': type = spot::postprocessor::Monitor; @@ -188,7 +188,7 @@ parse_opt(int key, char* arg, struct argp_state*) type = spot::postprocessor::TGBA; break; case ARGP_KEY_ARG: - jobs.push_back(job(arg, true)); + jobs.emplace_back(arg, true); break; default: @@ -370,7 +370,7 @@ main(int argc, char** argv) exit(err); if (jobs.empty()) - jobs.push_back(job("-", true)); + jobs.emplace_back("-", true); spot::postprocessor post(&extra_options); post.set_pref(pref | comp); diff --git a/src/bin/ltl2tgba.cc b/src/bin/ltl2tgba.cc index c81db4331..b9d6df095 100644 --- a/src/bin/ltl2tgba.cc +++ b/src/bin/ltl2tgba.cc @@ -1,6 +1,6 @@ // -*- 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. // @@ -186,7 +186,7 @@ parse_opt(int key, char* arg, struct argp_state*) break; case ARGP_KEY_ARG: // FIXME: use stat() to distinguish filename from string? - jobs.push_back(job(arg, false)); + jobs.emplace_back(arg, false); break; default: diff --git a/src/bin/ltl2tgta.cc b/src/bin/ltl2tgta.cc index d926c4407..8b471770e 100644 --- a/src/bin/ltl2tgta.cc +++ b/src/bin/ltl2tgta.cc @@ -1,6 +1,6 @@ // -*- 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. // @@ -144,7 +144,7 @@ parse_opt(int key, char* arg, struct argp_state*) break; case ARGP_KEY_ARG: // FIXME: use stat() to distinguish filename from string? - jobs.push_back(job(arg, false)); + jobs.emplace_back(arg, false); break; default: diff --git a/src/bin/ltlcross.cc b/src/bin/ltlcross.cc index 7dcad17f4..0d9846acf 100644 --- a/src/bin/ltlcross.cc +++ b/src/bin/ltlcross.cc @@ -1,6 +1,6 @@ // -*- 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. // @@ -1613,7 +1613,7 @@ main(int argc, char** argv) exit(err); if (jobs.empty()) - jobs.push_back(job("-", 1)); + jobs.emplace_back("-", 1); if (translators.empty()) error(2, 0, "No translator to run? Run '%s --help' for usage.", diff --git a/src/bin/ltlfilt.cc b/src/bin/ltlfilt.cc index 02d6340d2..c37c7b0b2 100644 --- a/src/bin/ltlfilt.cc +++ b/src/bin/ltlfilt.cc @@ -1,6 +1,6 @@ // -*- 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. // @@ -270,7 +270,7 @@ parse_opt(int key, char* arg, struct argp_state*) break; case ARGP_KEY_ARG: // FIXME: use stat() to distinguish filename from string? - jobs.push_back(job(arg, true)); + jobs.emplace_back(arg, true); break; case OPT_BOOLEAN: boolean = true; @@ -598,7 +598,7 @@ main(int argc, char** argv) exit(err); if (jobs.empty()) - jobs.push_back(job("-", 1)); + jobs.emplace_back("-", 1); // --stutter-insensitive implies --ltl ltl |= stutter_insensitive; diff --git a/src/dstarparse/dstarparse.yy b/src/dstarparse/dstarparse.yy index 640344399..4f4446c69 100644 --- a/src/dstarparse/dstarparse.yy +++ b/src/dstarparse/dstarparse.yy @@ -1,6 +1,6 @@ /* -*- coding: utf-8 -*- -** Copyright (C) 2013 Laboratoire de Recherche et Développement de -** l'Epita (LRDE). +** Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement +** de l'Epita (LRDE). ** ** This file is part of Spot, a model checking library. ** @@ -309,7 +309,7 @@ void dstaryy::parser::error(const location_type& location, const std::string& message) { - error_list.push_back(spot::dstar_parse_error(location, message)); + error_list.emplace_back(location, message); } namespace spot @@ -323,9 +323,8 @@ namespace spot { if (dstaryyopen(name)) { - error_list.push_back - (dstar_parse_error(spot::location(), - std::string("Cannot open file ") + name)); + error_list.emplace_back(spot::location(), + std::string("Cannot open file ") + name); return 0; } result_ r; diff --git a/src/kripkeparse/kripkeparse.yy b/src/kripkeparse/kripkeparse.yy index 8ceadf7df..d9df3a058 100644 --- a/src/kripkeparse/kripkeparse.yy +++ b/src/kripkeparse/kripkeparse.yy @@ -1,5 +1,5 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2011, 2012, 2013 Laboratoire de Recherche et +// Copyright (C) 2011, 2012, 2013, 2014 Laboratoire de Recherche et // Développement de l'Epita (LRDE) // // This file is part of Spot, a model checking library. @@ -121,8 +121,7 @@ strident "," condition "," follow_list ";" here.begin.column + i->first.end.column; here.begin.line += i->first.begin.line - 1; here.begin.column += i->first.begin.column; - error_list.push_back(spot::kripke_parse_error(here, - i->second)); + error_list.emplace_back(here, i->second); } if (f) result->add_condition(f, *$1); @@ -154,8 +153,7 @@ string: STRING | UNTERMINATED_STRING { $$ = $1; - error_list.push_back(spot::kripke_parse_error(@1, - "unterminated string")); + error_list.emplace_back(@1, "unterminated string"); } ; @@ -192,7 +190,7 @@ void kripkeyy::parser::error(const location_type& location, const std::string& message) { - error_list.push_back(spot::kripke_parse_error(location, message)); + error_list.emplace_back(location, message); } namespace spot diff --git a/src/ltlast/formula.cc b/src/ltlast/formula.cc index 891767477..d0c83d4e7 100644 --- a/src/ltlast/formula.cc +++ b/src/ltlast/formula.cc @@ -1,6 +1,6 @@ // -*- 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, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // département Systèmes Répartis Coopératifs (SRC), Université Pierre // et Marie Curie. @@ -96,7 +96,7 @@ namespace spot std::list res; #define proprint(m, a, l) \ if (f->m()) \ - res.push_back(std::string(l)); + res.emplace_back(l); printprops; #undef proprint return res; diff --git a/src/ltlparse/ltlparse.yy b/src/ltlparse/ltlparse.yy index 3c7fc36a6..9945d11a7 100644 --- a/src/ltlparse/ltlparse.yy +++ b/src/ltlparse/ltlparse.yy @@ -59,8 +59,8 @@ using namespace spot::ltl; #define missing_right_op_msg(op, str) \ - error_list.push_back(parse_error(op, \ - "missing right operand for \"" str "\"")); + error_list.emplace_back(op, \ + "missing right operand for \"" str "\""); #define missing_right_op(res, op, str) \ do \ @@ -115,8 +115,7 @@ using namespace spot::ltl; if (str.empty()) { - error_list.push_back(parse_error(location, - "unexpected empty block")); + error_list.emplace_back(location, "unexpected empty block"); return 0; } @@ -149,7 +148,7 @@ using namespace spot::ltl; s += "' rejected by environment `"; s += env.name(); s += "'"; - error_list.push_back(parse_error(location, s)); + error_list.emplace_back(location, s); } return f; } @@ -308,14 +307,13 @@ result: START_LTL subformula END_OF_INPUT emptyinput: END_OF_INPUT { - error_list.push_back(parse_error(@$, "empty input")); + error_list.emplace_back(@$, "empty input"); result = 0; } enderror: error END_OF_INPUT { - error_list.push_back(parse_error(@1, - "ignoring trailing garbage")); + error_list.emplace_back(@1, "ignoring trailing garbage"); } @@ -349,12 +347,11 @@ gotoargs: OP_GOTO_OPEN OP_SQBKT_NUM OP_SQBKT_SEP OP_SQBKT_NUM OP_SQBKT_CLOSE | OP_GOTO_OPEN OP_SQBKT_NUM OP_SQBKT_CLOSE { $$.min = $$.max = $2; } | OP_GOTO_OPEN error OP_SQBKT_CLOSE - { error_list.push_back(parse_error(@$, - "treating this goto block as [->]")); + { error_list.emplace_back(@$, "treating this goto block as [->]"); $$.min = $$.max = 1U; } | OP_GOTO_OPEN error_opt END_OF_INPUT - { error_list.push_back(parse_error(@$, - "missing closing bracket for goto operator")); + { error_list. + emplace_back(@$, "missing closing bracket for goto operator"); $$.min = $$.max = 0U; } kleen_star: OP_STAR | OP_BSTAR @@ -366,23 +363,20 @@ starargs: kleen_star | OP_STAR_OPEN sqbracketargs { $$ = $2; } | OP_STAR_OPEN error OP_SQBKT_CLOSE - { error_list.push_back(parse_error(@$, - "treating this star block as [*]")); + { error_list.emplace_back(@$, "treating this star block as [*]"); $$.min = 0U; $$.max = bunop::unbounded; } | OP_STAR_OPEN error_opt END_OF_INPUT - { error_list.push_back(parse_error(@$, - "missing closing bracket for star")); + { error_list.emplace_back(@$, "missing closing bracket for star"); $$.min = $$.max = 0U; } equalargs: OP_EQUAL_OPEN sqbracketargs { $$ = $2; } | OP_EQUAL_OPEN error OP_SQBKT_CLOSE - { error_list.push_back(parse_error(@$, - "treating this equal block as [*]")); + { error_list.emplace_back(@$, "treating this equal block as [*]"); $$.min = 0U; $$.max = bunop::unbounded; } | OP_EQUAL_OPEN error_opt END_OF_INPUT - { error_list.push_back(parse_error(@$, - "missing closing bracket for equal operator")); + { error_list. + emplace_back(@$, "missing closing bracket for equal operator"); $$.min = $$.max = 0U; } @@ -399,7 +393,7 @@ booleanatom: ATOMIC_PROP s += "' in environment `"; s += parse_environment.name(); s += "'"; - error_list.push_back(parse_error(@1, s)); + error_list.emplace_back(@1, s); delete $1; YYERROR; } @@ -416,7 +410,7 @@ booleanatom: ATOMIC_PROP s += "' in environment `"; s += parse_environment.name(); s += "'"; - error_list.push_back(parse_error(@1, s)); + error_list.emplace_back(@1, s); delete $1; YYERROR; } @@ -433,7 +427,7 @@ booleanatom: ATOMIC_PROP s += "' in environment `"; s += parse_environment.name(); s += "'"; - error_list.push_back(parse_error(@1, s)); + error_list.emplace_back(@1, s); delete $1; YYERROR; } @@ -455,11 +449,10 @@ sere: booleanatom } else { - error_list.push_back(parse_error(@2, + error_list.emplace_back(@2, "not a boolean expression: inside a SERE `!' can only " - "be applied to a Boolean expression")); - error_list.push_back(parse_error(@$, - "treating this block as false")); + "be applied to a Boolean expression"); + error_list.emplace_back(@$, "treating this block as false"); $2->destroy(); $$ = constant::false_instance(); } @@ -476,19 +469,19 @@ sere: booleanatom | PAR_OPEN sere PAR_CLOSE { $$ = $2; } | PAR_OPEN error PAR_CLOSE - { error_list.push_back(parse_error(@$, - "treating this parenthetical block as false")); + { error_list. + emplace_back(@$, + "treating this parenthetical block as false"); $$ = constant::false_instance(); } | PAR_OPEN sere END_OF_INPUT - { error_list.push_back(parse_error(@1 + @2, - "missing closing parenthesis")); + { error_list.emplace_back(@1 + @2, "missing closing parenthesis"); $$ = $2; } | PAR_OPEN error END_OF_INPUT - { error_list.push_back(parse_error(@$, + { error_list.emplace_back(@$, "missing closing parenthesis, " - "treating this parenthetical block as false")); + "treating this parenthetical block as false"); $$ = constant::false_instance(); } | sere OP_AND sere @@ -517,7 +510,7 @@ sere: booleanatom { if ($2.max < $2.min) { - error_list.push_back(parse_error(@2, "reversed range")); + error_list.emplace_back(@2, "reversed range"); std::swap($2.max, $2.min); } $$ = bunop::instance(bunop::Star, $1, $2.min, $2.max); @@ -526,7 +519,7 @@ sere: booleanatom { if ($1.max < $1.min) { - error_list.push_back(parse_error(@1, "reversed range")); + error_list.emplace_back(@1, "reversed range"); std::swap($1.max, $1.min); } $$ = bunop::instance(bunop::Star, constant::true_instance(), @@ -536,7 +529,7 @@ sere: booleanatom { if ($2.max < $2.min) { - error_list.push_back(parse_error(@2, "reversed range")); + error_list.emplace_back(@2, "reversed range"); std::swap($2.max, $2.min); } if ($1->is_boolean()) @@ -545,11 +538,11 @@ sere: booleanatom } else { - error_list.push_back(parse_error(@1, + error_list.emplace_back(@1, "not a boolean expression: [=...] can only " - "be applied to a Boolean expression")); - error_list.push_back(parse_error(@$, - "treating this block as false")); + "be applied to a Boolean expression"); + error_list.emplace_back(@$, + "treating this block as false"); $1->destroy(); $$ = constant::false_instance(); } @@ -558,7 +551,7 @@ sere: booleanatom { if ($2.max < $2.min) { - error_list.push_back(parse_error(@2, "reversed range")); + error_list.emplace_back(@2, "reversed range"); std::swap($2.max, $2.min); } if ($1->is_boolean()) @@ -567,11 +560,11 @@ sere: booleanatom } else { - error_list.push_back(parse_error(@1, + error_list.emplace_back(@1, "not a boolean expression: [->...] can only " - "be applied to a Boolean expression")); - error_list.push_back(parse_error(@$, - "treating this block as false")); + "be applied to a Boolean expression"); + error_list.emplace_back(@$, + "treating this block as false"); $1->destroy(); $$ = constant::false_instance(); } @@ -586,18 +579,17 @@ sere: booleanatom { if (!$1->is_boolean()) { - error_list.push_back(parse_error(@1, + error_list.emplace_back(@1, "not a boolean expression: inside SERE `<->' can only " - "be applied to Boolean expressions")); + "be applied to Boolean expressions"); } if (!$3->is_boolean()) { - error_list.push_back(parse_error(@3, + error_list.emplace_back(@3, "not a boolean expression: inside SERE `<->' can only " - "be applied to Boolean expressions")); + "be applied to Boolean expressions"); } - error_list.push_back(parse_error(@$, - "treating this block as false")); + error_list.emplace_back(@$, "treating this block as false"); $1->destroy(); $3->destroy(); $$ = constant::false_instance(); @@ -615,12 +607,11 @@ sere: booleanatom { if (!$1->is_boolean()) { - error_list.push_back(parse_error(@1, + error_list.emplace_back(@1, "not a boolean expression: inside SERE `->' can only " - "be applied to a Boolean expression")); + "be applied to a Boolean expression"); } - error_list.push_back(parse_error(@$, - "treating this block as false")); + error_list.emplace_back(@$, "treating this block as false"); $1->destroy(); $3->destroy(); $$ = constant::false_instance(); @@ -638,18 +629,17 @@ sere: booleanatom { if (!$1->is_boolean()) { - error_list.push_back(parse_error(@1, + error_list.emplace_back(@1, "not a boolean expression: inside SERE `<->' can only " - "be applied to Boolean expressions")); + "be applied to Boolean expressions"); } if (!$3->is_boolean()) { - error_list.push_back(parse_error(@3, + error_list.emplace_back(@3, "not a boolean expression: inside SERE `<->' can only " - "be applied to Boolean expressions")); + "be applied to Boolean expressions"); } - error_list.push_back(parse_error(@$, - "treating this block as false")); + error_list.emplace_back(@$, "treating this block as false"); $1->destroy(); $3->destroy(); $$ = constant::false_instance(); @@ -661,28 +651,28 @@ sere: booleanatom bracedsere: BRACE_OPEN sere BRACE_CLOSE { $$ = $2; } | BRACE_OPEN sere error BRACE_CLOSE - { error_list.push_back(parse_error(@3, "ignoring this")); + { error_list.emplace_back(@3, "ignoring this"); $$ = $2; } | BRACE_OPEN error BRACE_CLOSE - { error_list.push_back(parse_error(@$, - "treating this brace block as false")); + { error_list.emplace_back(@$, + "treating this brace block as false"); $$ = constant::false_instance(); } | BRACE_OPEN sere END_OF_INPUT - { error_list.push_back(parse_error(@1 + @2, - "missing closing brace")); + { error_list.emplace_back(@1 + @2, + "missing closing brace"); $$ = $2; } | BRACE_OPEN sere error END_OF_INPUT - { error_list.push_back(parse_error(@3, - "ignoring trailing garbage and missing closing brace")); + { error_list. emplace_back(@3, + "ignoring trailing garbage and missing closing brace"); $$ = $2; } | BRACE_OPEN error END_OF_INPUT - { error_list.push_back(parse_error(@$, + { error_list.emplace_back(@$, "missing closing brace, " - "treating this brace block as false")); + "treating this brace block as false"); $$ = constant::false_instance(); } | BRA_BLOCK @@ -706,28 +696,27 @@ parenthesedsubformula: PAR_BLOCK | PAR_OPEN subformula PAR_CLOSE { $$ = $2; } | PAR_OPEN subformula error PAR_CLOSE - { error_list.push_back(parse_error(@3, "ignoring this")); + { error_list.emplace_back(@3, "ignoring this"); $$ = $2; } | PAR_OPEN error PAR_CLOSE - { error_list.push_back(parse_error(@$, - "treating this parenthetical block as false")); + { error_list.emplace_back(@$, + "treating this parenthetical block as false"); $$ = constant::false_instance(); } | PAR_OPEN subformula END_OF_INPUT - { error_list.push_back(parse_error(@1 + @2, - "missing closing parenthesis")); + { error_list.emplace_back(@1 + @2, "missing closing parenthesis"); $$ = $2; } | PAR_OPEN subformula error END_OF_INPUT - { error_list.push_back(parse_error(@3, - "ignoring trailing garbage and missing closing parenthesis")); + { error_list.emplace_back(@3, + "ignoring trailing garbage and missing closing parenthesis"); $$ = $2; } | PAR_OPEN error END_OF_INPUT - { error_list.push_back(parse_error(@$, + { error_list.emplace_back(@$, "missing closing parenthesis, " - "treating this parenthetical block as false")); + "treating this parenthetical block as false"); $$ = constant::false_instance(); } @@ -744,28 +733,28 @@ boolformula: booleanatom | PAR_OPEN boolformula PAR_CLOSE { $$ = $2; } | PAR_OPEN boolformula error PAR_CLOSE - { error_list.push_back(parse_error(@3, "ignoring this")); + { error_list.emplace_back(@3, "ignoring this"); $$ = $2; } | PAR_OPEN error PAR_CLOSE - { error_list.push_back(parse_error(@$, - "treating this parenthetical block as false")); + { error_list.emplace_back(@$, + "treating this parenthetical block as false"); $$ = constant::false_instance(); } | PAR_OPEN boolformula END_OF_INPUT - { error_list.push_back(parse_error(@1 + @2, - "missing closing parenthesis")); + { error_list.emplace_back(@1 + @2, + "missing closing parenthesis"); $$ = $2; } | PAR_OPEN boolformula error END_OF_INPUT - { error_list.push_back(parse_error(@3, - "ignoring trailing garbage and missing closing parenthesis")); + { error_list.emplace_back(@3, + "ignoring trailing garbage and missing closing parenthesis"); $$ = $2; } | PAR_OPEN error END_OF_INPUT - { error_list.push_back(parse_error(@$, + { error_list.emplace_back(@$, "missing closing parenthesis, " - "treating this parenthetical block as false")); + "treating this parenthetical block as false"); $$ = constant::false_instance(); } | boolformula OP_AND boolformula @@ -923,7 +912,7 @@ lbtformula: ATOMIC_PROP s += "' rejected by environment `"; s += parse_environment.name(); s += "'"; - error_list.push_back(parse_error(@1, s)); + error_list.emplace_back(@1, s); delete $1; YYERROR; } @@ -969,7 +958,7 @@ lbtformula: ATOMIC_PROP void ltlyy::parser::error(const location_type& location, const std::string& message) { - error_list.push_back(parse_error(location, message)); + error_list.emplace_back(location, message); } namespace spot diff --git a/src/misc/minato.cc b/src/misc/minato.cc index 136216f90..f7094abd3 100644 --- a/src/misc/minato.cc +++ b/src/misc/minato.cc @@ -1,6 +1,6 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2009, 2013 Laboratoire de Recherche et Développement -// de l'Epita (LRDE). +// Copyright (C) 2009, 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. @@ -39,14 +39,14 @@ namespace spot // original algorithm, because in many cases we are trying to // build ISOPs out of formulae that are already cubes. cube_.push(bdd_satprefix(input)); - todo_.push(local_vars(input, input, bdd_support(input))); + todo_.emplace(input, input, bdd_support(input)); } minato_isop::minato_isop(bdd input, bdd vars) : ret_(bddfalse) { cube_.push(bdd_satprefix(input)); - todo_.push(local_vars(input, input, vars)); + todo_.emplace(input, input, vars); } bdd @@ -129,7 +129,7 @@ namespace spot } cube_.push(cube_.top() & v0); - todo_.push(local_vars(l.f0_min - l.f1_max, l.f0_max, l.vars)); + todo_.emplace(l.f0_min - l.f1_max, l.f0_max, l.vars); } continue; @@ -138,7 +138,7 @@ namespace spot l.g0 = ret_; cube_.pop(); cube_.push(cube_.top() & l.v1); - todo_.push(local_vars(l.f1_min - l.f0_max, l.f1_max, l.vars)); + todo_.emplace(l.f1_min - l.f0_max, l.f1_max, l.vars); continue; case local_vars::ThirdStep: @@ -148,7 +148,7 @@ namespace spot { bdd fs_max = l.f0_max & l.f1_max; bdd fs_min = fs_max & ((l.f0_min - l.g0) | (l.f1_min - l.g1)); - todo_.push(local_vars(fs_min, fs_max, l.vars)); + todo_.emplace(fs_min, fs_max, l.vars); } continue; diff --git a/src/neverparse/neverclaimparse.yy b/src/neverparse/neverclaimparse.yy index 8d32440b8..f0f9d7747 100644 --- a/src/neverparse/neverclaimparse.yy +++ b/src/neverparse/neverclaimparse.yy @@ -1,6 +1,6 @@ /* -*- coding: utf-8 -*- -** Copyright (C) 2010, 2011, 2012, 2013 Laboratoire de Recherche et -** Développement de l'Epita (LRDE). +** Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche +** et Développement de l'Epita (LRDE). ** ** This file is part of Spot, a model checking library. ** @@ -259,7 +259,7 @@ void neverclaimyy::parser::error(const location_type& location, const std::string& message) { - error_list.push_back(spot::neverclaim_parse_error(location, message)); + error_list.emplace_back(location, message); } namespace spot @@ -273,9 +273,8 @@ namespace spot { if (neverclaimyyopen(name)) { - error_list.push_back - (neverclaim_parse_error(spot::location(), - std::string("Cannot open file ") + name)); + error_list.emplace_back(spot::location(), + std::string("Cannot open file ") + name); return 0; } tgba_explicit_string* result = new tgba_explicit_string(dict); diff --git a/src/priv/bddalloc.cc b/src/priv/bddalloc.cc index aa24e08cb..d385bc0c0 100644 --- a/src/priv/bddalloc.cc +++ b/src/priv/bddalloc.cc @@ -1,8 +1,9 @@ -// Copyright (C) 2007, 2011 Laboratoire de Recherche et Développement -// de l'Epita (LRDE). +// -*- coding: utf-8 -*- +// Copyright (C) 2007, 2011, 2014 Laboratoire de Recherche et +// Développement de l'Epita (LRDE). // Copyright (C) 2003, 2004, 2006, 2007 Laboratoire d'Informatique de -// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), -// Université Pierre et Marie Curie. +// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), +// Université Pierre et Marie Curie. // // This file is part of Spot, a model checking library. // @@ -32,7 +33,7 @@ namespace spot { initialize(); lvarnum = bdd_varnum(); - fl.push_front(pos_lenght_pair(0, lvarnum)); + fl.emplace_front(0, lvarnum); } void diff --git a/src/ta/ta.cc b/src/ta/ta.cc index db9512a23..c76517a4b 100644 --- a/src/ta/ta.cc +++ b/src/ta/ta.cc @@ -1,5 +1,6 @@ -// Copyright (C) 2010, 2011 Laboratoire de Recherche et Developpement -// de l Epita (LRDE). +// -*- coding: utf-8 -*- +// Copyright (C) 2010, 2011, 2014 Laboratoire de Recherche et +// Developpement de l Epita (LRDE). // // This file is part of Spot, a model checking library. // @@ -52,7 +53,7 @@ namespace spot void scc_stack_ta::push(int index) { - s.push_front(connected_component(index)); + s.emplace_front(index); } std::list& diff --git a/src/taalgos/emptinessta.cc b/src/taalgos/emptinessta.cc index 37218e54b..c97fb24b0 100644 --- a/src/taalgos/emptinessta.cc +++ b/src/taalgos/emptinessta.cc @@ -1,6 +1,6 @@ // -*- coding: utf-8 -*- -// Copyright (C) 2010, 2011, 2012, 2013 Laboratoire de Recherche et -// Développement de l'Epita (LRDE). +// Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche +// et Développement de l'Epita (LRDE). // // This file is part of Spot, a model checking library. // @@ -118,7 +118,7 @@ namespace spot ta_succ_iterator_product* iter = a_->succ_iter(init); iter->first(); - todo.push(pair_state_iter(init, iter)); + todo.emplace(init, iter); inc_depth(); @@ -245,7 +245,7 @@ namespace spot ta_succ_iterator_product* iter = a_->succ_iter(dest); iter->first(); - todo.push(pair_state_iter(dest, iter)); + todo.emplace(dest, iter); //colour[dest] = GREY; inc_depth(); @@ -467,7 +467,7 @@ namespace spot sscc.top().is_accepting = t->is_livelock_accepting_state(init); ta_succ_iterator_product* iter = t->succ_iter(init); iter->first(); - todo.push(pair_state_iter(init, iter)); + todo.emplace(init, iter); inc_depth(); } @@ -561,7 +561,7 @@ namespace spot ta_succ_iterator_product* iter = t->succ_iter(dest); iter->first(); - todo.push(pair_state_iter(dest, iter)); + todo.emplace(dest, iter); inc_depth(); continue; } diff --git a/src/tgba/taatgba.cc b/src/tgba/taatgba.cc index 7dde18c1c..4ea2d75a0 100644 --- a/src/tgba/taatgba.cc +++ b/src/tgba/taatgba.cc @@ -206,9 +206,8 @@ namespace spot } bounds_t bounds; - for (taa_tgba::state_set::const_iterator i = s->begin(); - i != s->end(); ++i) - bounds.push_back(std::make_pair((*i)->begin(), (*i)->end())); + for (auto& i: *s) + bounds.emplace_back(i->begin(), i->end()); /// Sorting might make the cartesian product faster by not /// exploring all possibilities. @@ -216,8 +215,8 @@ namespace spot std::vector pos; pos.reserve(bounds.size()); - for (bounds_t::const_iterator i = bounds.begin(); i != bounds.end(); ++i) - pos.push_back(i->first); + for (auto i: bounds) + pos.push_back(i.first); while (pos[0] != bounds[0].second) { diff --git a/src/tgbaalgos/gtec/gtec.cc b/src/tgbaalgos/gtec/gtec.cc index 035393b1c..6e84d67f3 100644 --- a/src/tgbaalgos/gtec/gtec.cc +++ b/src/tgbaalgos/gtec/gtec.cc @@ -173,7 +173,7 @@ namespace spot arc.push(bddfalse); tgba_succ_iterator* iter = ecs_->aut->succ_iter(init); iter->first(); - todo.push(pair_state_iter(init, iter)); + todo.emplace(init, iter); inc_depth(); } @@ -242,7 +242,7 @@ namespace spot arc.push(acc); tgba_succ_iterator* iter = ecs_->aut->succ_iter(dest); iter->first(); - todo.push(pair_state_iter(dest, iter)); + todo.emplace(dest, iter); inc_depth(); continue; } @@ -329,8 +329,8 @@ namespace spot { for (auto iter: shy->ecs_->aut->succ(s)) { - q.push_back(successor(iter->current_acceptance_conditions(), - iter->current_state())); + q.emplace_back(iter->current_acceptance_conditions(), + iter->current_state()); shy->inc_depth(); shy->inc_transitions(); } @@ -351,7 +351,7 @@ namespace spot const state* i = ecs_->aut->get_init_state(); ecs_->h->insert(i, ++num); ecs_->root.push(num); - todo.push_back(todo_item(i, num, this)); + todo.emplace_back(i, num, this); inc_depth(1); } @@ -510,7 +510,7 @@ namespace spot ecs_->h->insert(succ.s, ++num); ecs_->root.push(num); arc.push(succ.acc); - todo.push_back(todo_item(succ.s, num, this)); + todo.emplace_back(succ.s, num, this); pos = todo.back().q.begin(); inc_depth(); continue; diff --git a/src/tgbaalgos/gtec/sccstack.cc b/src/tgbaalgos/gtec/sccstack.cc index 7ffdbed55..5f0c91521 100644 --- a/src/tgbaalgos/gtec/sccstack.cc +++ b/src/tgbaalgos/gtec/sccstack.cc @@ -1,5 +1,8 @@ +// -*- coding: utf-8 -*- +// Copyright (C) 2014 Laboratoire de Recherche et Developpement de +// l'Epita (LRDE). // Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), -// département Systèmes Répartis Coopératifs (SRC), Université Pierre +// département Systèmes Répartis Coopératifs (SRC), Université Pierre // et Marie Curie. // // This file is part of Spot, a model checking library. @@ -49,7 +52,7 @@ namespace spot void scc_stack::push(int index) { - s.push_front(connected_component(index)); + s.emplace_front(index); } std::list& diff --git a/src/tgbaalgos/magic.cc b/src/tgbaalgos/magic.cc index e682285cc..104793399 100644 --- a/src/tgbaalgos/magic.cc +++ b/src/tgbaalgos/magic.cc @@ -148,12 +148,12 @@ namespace spot private: void push(stack_type& st, const state* s, - const bdd& label, const bdd& acc) + const bdd& label, const bdd& acc) { inc_depth(); tgba_succ_iterator* i = a_->succ_iter(s); i->first(); - st.push_front(stack_item(s, i, label, acc)); + st.emplace_front(s, i, label, acc); } void pop(stack_type& st) diff --git a/src/tgbaalgos/ndfs_result.hxx b/src/tgbaalgos/ndfs_result.hxx index 0333b2026..c91c4ae65 100644 --- a/src/tgbaalgos/ndfs_result.hxx +++ b/src/tgbaalgos/ndfs_result.hxx @@ -263,7 +263,7 @@ namespace spot seen.insert(start); tgba_succ_iterator* i = a_->succ_iter(start); i->first(); - st1.push_front(stack_item(start, i, bddfalse, bddfalse)); + st1.emplace_front(start, i, bddfalse, bddfalse); while (!st1.empty()) { @@ -292,7 +292,7 @@ namespace spot seen.insert(s_prime); tgba_succ_iterator* i = a_->succ_iter(s_prime); i->first(); - st1.push_front(stack_item(s_prime, i, label, acc)); + st1.emplace_front(s_prime, i, label, acc); } else if ((acc & covered_acc) != acc) { diff --git a/src/tgbaalgos/rundotdec.cc b/src/tgbaalgos/rundotdec.cc index 23a4d5778..1201334ae 100644 --- a/src/tgbaalgos/rundotdec.cc +++ b/src/tgbaalgos/rundotdec.cc @@ -1,5 +1,8 @@ +// -*- coding: utf-8 -*- +// Copyright (C) 2014 Laboratoire de Recherche et Developpement +// de l'Epita (LRDE). // Copyright (C) 2004, 2011 Laboratoire d'Informatique de Paris 6 (LIP6), -// département Systèmes Répartis Coopératifs (SRC), Université Pierre +// département Systèmes Répartis Coopératifs (SRC), Université Pierre // et Marie Curie. // // This file is part of Spot, a model checking library. @@ -30,10 +33,10 @@ namespace spot int n = 1; for (tgba_run::steps::const_iterator i = run->prefix.begin(); i != run->prefix.end(); ++i, ++n) - map_[i->s].first.push_back(step_num(i, n)); + map_[i->s].first.emplace_back(i, n); for (tgba_run::steps::const_iterator i = run->cycle.begin(); i != run->cycle.end(); ++i, ++n) - map_[i->s].second.push_back(step_num(i, n)); + map_[i->s].second.emplace_back(i, n); } tgba_run_dotty_decorator::~tgba_run_dotty_decorator() @@ -55,19 +58,17 @@ namespace spot std::string sep = "("; bool in_prefix = false; bool in_cycle = false; - for (step_set::const_iterator j = i->second.first.begin(); - j != i->second.first.end(); ++j) + for (auto j: i->second.first) { - os << sep << j->second; + os << sep << j.second; sep = ", "; in_prefix = true; } if (sep == ", ") sep = "; "; - for (step_set::const_iterator j = i->second.second.begin(); - j != i->second.second.end(); ++j) + for (auto j: i->second.second) { - os << sep << j->second; + os << sep << j.second; sep = ", "; in_cycle = true; } diff --git a/src/tgbaalgos/scc.cc b/src/tgbaalgos/scc.cc index 18ba54e3e..786dbc77d 100644 --- a/src/tgbaalgos/scc.cc +++ b/src/tgbaalgos/scc.cc @@ -147,12 +147,12 @@ namespace spot state* init = aut_->get_init_state(); num_ = -1; h_.insert(std::make_pair(init, num_)); - root_.push_front(scc(num_)); + root_.emplace_front(num_); arc_acc_.push(bddfalse); arc_cond_.push(bddfalse); tgba_succ_iterator* iter = aut_->succ_iter(init); iter->first(); - todo_.push(pair_state_iter(init, iter)); + todo_.emplace(init, iter); } while (!todo_.empty()) @@ -224,12 +224,12 @@ namespace spot // Yes. Number it, stack it, and register its successors // for later processing. h_.insert(std::make_pair(dest, --num_)); - root_.push_front(scc(num_)); + root_.emplace_front(num_); arc_acc_.push(acc); arc_cond_.push(cond); tgba_succ_iterator* iter = aut_->succ_iter(dest); iter->first(); - todo_.push(pair_state_iter(dest, iter)); + todo_.emplace(dest, iter); continue; } diff --git a/src/tgbaalgos/se05.cc b/src/tgbaalgos/se05.cc index a17055bf3..d6d12014c 100644 --- a/src/tgbaalgos/se05.cc +++ b/src/tgbaalgos/se05.cc @@ -153,7 +153,7 @@ namespace spot inc_depth(); tgba_succ_iterator* i = a_->succ_iter(s); i->first(); - st.push_front(stack_item(s, i, label, acc)); + st.emplace_front(s, i, label, acc); } void pop(stack_type& st) diff --git a/src/tgbaalgos/simulation.cc b/src/tgbaalgos/simulation.cc index 583d5bb5a..3c36ce7f6 100644 --- a/src/tgbaalgos/simulation.cc +++ b/src/tgbaalgos/simulation.cc @@ -1317,7 +1317,7 @@ namespace spot bdd sig = dont_care_compute_sig(src); dont_care_bdd_lstate[sig].push_back(src); dont_care_state2sig[src] = sig; - dont_care_now_to_now.push_back(std::make_pair(sig, it->second)); + dont_care_now_to_now.emplace_back(sig, it->second); class2state[it->second] = it->first; sig = compute_sig(src); diff --git a/src/tgbaalgos/tau03.cc b/src/tgbaalgos/tau03.cc index 579017311..c6ac431c7 100644 --- a/src/tgbaalgos/tau03.cc +++ b/src/tgbaalgos/tau03.cc @@ -127,7 +127,7 @@ namespace spot inc_depth(); tgba_succ_iterator* i = a_->succ_iter(s); i->first(); - st.push_front(stack_item(s, i, label, acc)); + st.emplace_front(s, i, label, acc); } void pop(stack_type& st) diff --git a/src/tgbaalgos/tau03opt.cc b/src/tgbaalgos/tau03opt.cc index bcedc9e37..7365f6696 100644 --- a/src/tgbaalgos/tau03opt.cc +++ b/src/tgbaalgos/tau03opt.cc @@ -152,7 +152,7 @@ namespace spot inc_depth(); tgba_succ_iterator* i = a_->succ_iter(s); i->first(); - st.push_front(stack_item(s, i, label, acc)); + st.emplace_front(s, i, label, acc); } void pop(stack_type& st) @@ -321,7 +321,7 @@ namespace spot typedef std::pair cond_level; std::stack condition_stack; unsigned depth = 1; - condition_stack.push(cond_level(bddfalse, 0)); + condition_stack.emplace(bddfalse, 0); while (!st_red.empty()) { @@ -376,7 +376,7 @@ namespace spot { bdd old = acu; acu |= acc; - condition_stack.push(cond_level(acu - old, depth)); + condition_stack.emplace(acu - old, depth); } ++depth; } diff --git a/src/tgbaparse/tgbaparse.yy b/src/tgbaparse/tgbaparse.yy index 38580c4bb..31a4b2a62 100644 --- a/src/tgbaparse/tgbaparse.yy +++ b/src/tgbaparse/tgbaparse.yy @@ -1,6 +1,6 @@ /* -*- coding: utf-8 -*- -** Copyright (C) 2009, 2010, 2012, 2013 Laboratoire de Recherche et -** Développement de l'Epita (LRDE). +** Copyright (C) 2009, 2010, 2012, 2013, 2014 Laboratoire de Recherche +** et Développement de l'Epita (LRDE). ** Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de ** Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), ** Université Pierre et Marie Curie. @@ -123,8 +123,7 @@ line: strident ',' strident ',' condition ',' acc_list ';' here.begin.column + i->first.end.column; here.begin.line += i->first.begin.line - 1; here.begin.column += i->first.begin.column; - error_list.push_back(spot::tgba_parse_error(here, - i->second)); + error_list.emplace_back(here, i->second); } if (f) result->add_condition(t, f); @@ -151,8 +150,7 @@ string: STRING | UNTERMINATED_STRING { $$ = $1; - error_list.push_back(spot::tgba_parse_error(@1, - "unterminated string")); + error_list.emplace_back(@1, "unterminated string"); } strident: string | IDENT @@ -182,8 +180,8 @@ acc_list: const formula* f = parse_envacc.require(*$2); if (! result->has_acceptance_condition(f)) { - error_list.push_back(spot::tgba_parse_error(@2, - "undeclared acceptance condition `" + *$2 + "'")); + error_list.emplace_back(@2, + "undeclared acceptance condition `" + *$2 + "'"); f->destroy(); // $2 will be destroyed on error recovery. YYERROR; @@ -207,7 +205,7 @@ acc_decl: s += "' unknown in environment `"; s += parse_envacc.name(); s += "'"; - error_list.push_back(spot::tgba_parse_error(@2, s)); + error_list.emplace_back(@2, s); YYERROR; } result->declare_acceptance_condition(f); @@ -221,7 +219,7 @@ void tgbayy::parser::error(const location_type& location, const std::string& message) { - error_list.push_back(spot::tgba_parse_error(location, message)); + error_list.emplace_back(location, message); } namespace spot @@ -236,9 +234,8 @@ namespace spot { if (tgbayyopen(name)) { - error_list.push_back - (tgba_parse_error(spot::location(), - std::string("Cannot open file ") + name)); + error_list.emplace_back(spot::location(), + std::string("Cannot open file ") + name); return 0; } formula_cache fcache;