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

Cosmetics.

* src/sanity/style.test: Catch some binary operators not
delimited with spaces.
* src/tgbaalgos/bfssteps.cc, src/tgbaalgos/magic.cc,
src/tgbaalgos/reducerun.cc, src/tgbaalgos/se05.cc,
src/tgbaalgos/tau03.cc, src/tgbaalgos/tau03opt.cc: Fix these.
parent 36f7c648
2011-03-31 Alexandre Duret-Lutz <adl@va-et-vient.net>
Cosmetics.
* src/sanity/style.test: Catch some binary operators not
delimited with spaces.
* src/tgbaalgos/bfssteps.cc, src/tgbaalgos/magic.cc,
src/tgbaalgos/reducerun.cc, src/tgbaalgos/se05.cc,
src/tgbaalgos/tau03.cc, src/tgbaalgos/tau03opt.cc: Fix these.
2011-03-31 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Make state_explicit instances persistent objects.
......
......@@ -121,10 +121,16 @@ for dir in "${INCDIR-..}" "${INCDIR-..}"/../iface; do
grep ",[^ \t\"%']" $tmp &&
diag 'Space after coma.'
grep '[^ ]&&[^ ]' $tmp &&
# The 'r' allows operator&&
grep '[^ r]&&[^ ]' $tmp &&
diag 'Space arround binary operators.'
grep '[^ ]||[^ ]' $tmp &&
# The 'r' allows operator||
grep '[^ r]||[^ ]' $tmp &&
diag 'Space arround binary operators.'
# The 'r' allows operator==
grep '[^ r][!<>=]=[^ ]' $tmp &&
diag 'Space arround binary operators.'
grep '[ ]default:[^:].*;' $tmp &&
......
......@@ -52,7 +52,7 @@ namespace spot
break;
std::map<const state*, tgba_run::step,
state_ptr_less_than>::const_iterator it = father.find(current.s);
assert(it!=father.end());
assert(it != father.end());
current = it->second;
}
l.splice(l.end(), p);
......
......@@ -447,7 +447,7 @@ namespace spot
}
bool is_white() const
{
return p==0;
return p == 0;
}
private:
color *p;
......@@ -472,19 +472,19 @@ namespace spot
color_ref get_color_ref(const state*& s)
{
hash_type::iterator it = h.find(s);
if (it==h.end())
if (it == h.end())
return color_ref(0);
if (s!=it->first)
if (s != it->first)
{
s->destroy();
s = it->first;
}
return color_ref(&(it->second));
return color_ref(&it->second);
}
void add_new_state(const state* s, color c)
{
assert(h.find(s)==h.end());
assert(h.find(s) == h.end());
h.insert(std::make_pair(s, c));
}
......@@ -532,7 +532,7 @@ namespace spot
}
bool is_white() const
{
return get_color()==WHITE;
return get_color() == WHITE;
}
private:
unsigned char *base;
......
......@@ -68,7 +68,7 @@ namespace spot
filter(const state* s)
{
state_set::const_iterator i = seen.find(s);
if (i==seen.end())
if (i == seen.end())
seen.insert(s);
else
{
......
......@@ -469,7 +469,7 @@ namespace spot
{
assert(c != CYAN);
int i = phc->erase(ps);
assert(i==1);
assert(i == 1);
(void)i;
ph->insert(std::make_pair(ps, c));
}
......@@ -480,7 +480,7 @@ namespace spot
}
bool is_white() const
{
return !is_cyan && pc==0;
return !is_cyan && pc == 0;
}
private:
bool is_cyan;
......@@ -515,19 +515,19 @@ namespace spot
color_ref get_color_ref(const state*& s)
{
hcyan_type::iterator ic = hc.find(s);
if (ic==hc.end())
if (ic == hc.end())
{
hash_type::iterator it = h.find(s);
if (it==h.end())
if (it == h.end())
return color_ref(0); // white state
if (s!=it->first)
if (s != it->first)
{
s->destroy();
s = it->first;
}
return color_ref(&(it->second)); // blue or red state
return color_ref(&it->second); // blue or red state
}
if (s!=*ic)
if (s != *ic)
{
s->destroy();
s = *ic;
......@@ -537,7 +537,7 @@ namespace spot
void add_new_state(const state* s, color c)
{
assert(hc.find(s)==hc.end() && h.find(s)==h.end());
assert(hc.find(s) == hc.end() && h.find(s) == h.end());
if (c == CYAN)
hc.insert(s);
else
......@@ -599,17 +599,17 @@ namespace spot
}
void set_color(color c)
{
if (is_cyan && c!=CYAN)
if (is_cyan && c != CYAN)
{
int i = phc->erase(ps);
assert(i==1);
assert(i == 1);
(void)i;
}
*b = (*b & ~(3U << o)) | (c << o);
}
bool is_white() const
{
return get_color()==WHITE;
return get_color() == WHITE;
}
private:
bool is_cyan;
......@@ -634,7 +634,7 @@ namespace spot
{
size_t ha = s->hash();
hcyan_type::iterator ic = hc.find(s);
if (ic!=hc.end())
if (ic != hc.end())
return color_ref(&hc, *ic, &h[ha%size_], ha%4);
return color_ref(&h[ha%size_], ha%4);
}
......@@ -642,7 +642,7 @@ namespace spot
void add_new_state(const state* s, color c)
{
assert(get_color_ref(s).is_white());
if (c==CYAN)
if (c == CYAN)
hc.insert(s);
else
{
......
......@@ -337,19 +337,19 @@ namespace spot
color_ref get_color_ref(const state*& s)
{
hash_type::iterator it = h.find(s);
if (it==h.end())
if (it == h.end())
return color_ref(0, 0);
if (s!=it->first)
if (s != it->first)
{
s->destroy();
s = it->first;
}
return color_ref(&(it->second.first), &(it->second.second));
return color_ref(&it->second.first, &it->second.second);
}
void add_new_state(const state* s, color c)
{
assert(h.find(s)==h.end());
assert(h.find(s) == h.end());
h.insert(std::make_pair(s, std::make_pair(c, bddfalse)));
}
......
......@@ -450,7 +450,7 @@ namespace spot
assert(p.second);
acc = &(p.first->second.second);
int i = phc->erase(ps);
assert(i==1);
assert(i == 1);
(void)i;
}
else
......@@ -508,33 +508,33 @@ namespace spot
color_ref get_color_ref(const state*& s)
{
hcyan_type::iterator ic = hc.find(s);
if (ic==hc.end())
if (ic == hc.end())
{
hash_type::iterator it = h.find(s);
if (it==h.end())
if (it == h.end())
// white state
return color_ref(0, 0);
if (s!=it->first)
if (s != it->first)
{
s->destroy();
s = it->first;
}
// blue or red state
return color_ref(&(it->second.first), &(it->second.second));
return color_ref(&it->second.first, &it->second.second);
}
if (s!=ic->first)
if (s != ic->first)
{
s->destroy();
s = ic->first;
}
// cyan state
return color_ref(&h, &hc, ic->first,
&(ic->second.first), &(ic->second.second));
&ic->second.first, &ic->second.second);
}
void add_new_state(const state* s, color c, const weight& w)
{
assert(hc.find(s)==hc.end() && h.find(s)==h.end());
assert(hc.find(s) == hc.end() && h.find(s) == h.end());
assert(c == CYAN);
(void)c;
hc.insert(std::make_pair(s, std::make_pair(w, bddfalse)));
......
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