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

Fix failures detected on MacOS X with g++ 4.0.

* src/tgbaalgos/cycles.hh (state_info): Initialize
mark and reach to false.
* src/tgbatest/cycles.test: Use jot if seq is missing,
and a custom loop of jot is missing too.
parent c6840d81
......@@ -85,6 +85,10 @@ namespace spot
// Extra information required for the algorithm for each state.
struct state_info
{
state_info()
: reach(false), mark(false)
{
}
// Whether the state has already left the stack at least once.
bool reach;
// set to true when the state current state w is stacked, and
......
......@@ -31,6 +31,34 @@
set -e
# GNU systems have seq,
# BSD systems have jot.
if test "*`(seq 1 1 2>/dev/null)`" = "1"; then
have_seq=true
else
have_seq=false
if test "`(jot 1 1 2>/dev/null)`" = "1"; then
have_jot=true
else
have_jot=false
fi
fi
# enum start end
enum() {
if $have_seq; then
seq $1 $2
elif $have_jot; then
jot `expr $2 - $1 + 1` $1
else
i=$1
while test $i -le $2; do
echo $i
i=`expr $i + 1`
done
fi
}
# Fig.1 from Johnson's SIAM J. Comput. 1975 paper.
(
......@@ -39,17 +67,17 @@ k=3
v=`expr $k + 2`
w=`expr 2 \* $k + 2`
x=`expr 3 \* $k + 3`
for i in $(seq 2 `expr $k + 1`); do
for i in $(enum 2 `expr $k + 1`); do
echo "s1,s$i,,;"
echo "s$i,s$v,,;"
done
for i in $(seq `expr $k + 2` `expr 2 \* $k`); do
for i in $(enum `expr $k + 2` `expr 2 \* $k`); do
echo "s$i,s`expr $i + 1`,,;"
echo "s$i,s$w,,;"
done
echo "s`expr 2 \* $k + 1`,s$w,,;"
echo "s`expr 2 \* $k + 1`,s1,,;"
for i in $(seq `expr 2 \* $k + 3` `expr 3 \* $k + 2`); do
for i in $(enum `expr 2 \* $k + 3` `expr 3 \* $k + 2`); do
echo "s$w,s$i,,;"
echo "s$i,s$x,,;"
done
......
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