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

Fix a g++-4.7 warning about a variable used only in an assert().

* src/tgbaalgos/weight.cc (inc_weight_handler)
(dec_weight_handler): Remove these assertions that require the
loop the be completed, and use break to exit ASAP.
parent 9130d6f5
2011-11-11 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Fix a g++-4.7 warning about a variable used only in an assert().
* src/tgbaalgos/weight.cc (inc_weight_handler)
(dec_weight_handler): Remove these assertions that require the
loop the be completed, and use break to exit ASAP.
2011-11-08 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Allow neverclaim guards of the form `!(x)' or `! (x)'.
......
// Copyright (C) 2011 Laboratoire de Recherche et Developpement de
// l'Epita.
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
// dpartement Systmes Rpartis Coopratifs (SRC), Universit Pierre
// et Marie Curie.
......@@ -33,17 +35,15 @@ namespace spot
void weight::inc_weight_handler(char* varset, int size)
{
bool ok = true;
for (int v = 0; v < size; ++v)
if (varset[v] > 0)
{
assert(ok);
ok=false;
weight::weight_vector::iterator it = pm->find(v);
if (it == pm->end())
pm->insert(std::make_pair(v, 1));
else
++(it->second);
break;
}
}
......@@ -56,18 +56,16 @@ namespace spot
void weight::dec_weight_handler(char* varset, int size)
{
bool ok = true;
for (int v = 0; v < size; ++v)
if (varset[v] > 0)
{
assert(ok);
ok=false;
weight::weight_vector::iterator it = pm->find(v);
assert(it != pm->end() && it->second > 0);
if (it->second > 1)
--(it->second);
else
pm->erase(it);
break;
}
}
......
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