* src/sanity/style.test: Diagnose superfluous constructs such
as `if (x) delete x;'. * iface/gspn/gspn.cc, iface/gspn/ssp.cc, src/ltlvisit/basicreduce.cc, src/tgba/tgba.cc, src/tgba/tgbaproduct.cc, src/tgbaalgos/magic.cc, src/tgbatest/ltl2tgba.cc: Remove such constructs.
This commit is contained in:
parent
4654da9ab5
commit
55014e9dcc
9 changed files with 62 additions and 71 deletions
|
|
@ -37,7 +37,7 @@ for dir in "${INCDIR-..}" "${INCDIR-..}"/../iface; do
|
|||
sed 's,[ ]*//.*,,' < $file > $tmp
|
||||
|
||||
grep '[ ]$' $tmp &&
|
||||
diag 'Trailing space or tab.'
|
||||
diag 'Trailing whitespace.'
|
||||
|
||||
grep '[ ]if(' $tmp &&
|
||||
diag 'Missing space after "if"'
|
||||
|
|
@ -137,6 +137,14 @@ for dir in "${INCDIR-..}" "${INCDIR-..}"/../iface; do
|
|||
grep '[^a-zA-Z0-9_](\*[a-zA-Z0-9_]*)\.' $tmp &&
|
||||
diag 'Use "x->y", not "(*x).y"'
|
||||
|
||||
res=`perl -ne '$/ = undef;
|
||||
print "$&\n"
|
||||
while /if \((.*)(\s*==\s*0)?\)\s*delete(\[\])?\s+\1;(?!\s+else)/g' $tmp`
|
||||
if test -n "$res"; then
|
||||
echo "$res"
|
||||
diag 'No "if (x)" required before "delete x;".'
|
||||
fi
|
||||
|
||||
case $file in
|
||||
*.hh | *.hxx)
|
||||
if egrep '(cout|cerr|clog)' $tmp >/dev/null; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue