From 3e968a3c9d6f279a42a51df4c7431123c12fd541 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Fri, 21 May 2004 11:55:36 +0000 Subject: [PATCH] * src/sanity/style.test: Check the iface/ tree too. * iface/gspn/gspn.cc, iface/gspn/ssp.cc: Fix style. --- ChangeLog | 3 ++ iface/gspn/gspn.cc | 2 +- iface/gspn/ssp.cc | 24 +++++------ src/sanity/style.test | 99 ++++++++++++++++++++++--------------------- 4 files changed, 67 insertions(+), 61 deletions(-) diff --git a/ChangeLog b/ChangeLog index e12d1966b..61d49b435 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-05-21 Alexandre Duret-Lutz + * src/sanity/style.test: Check the iface/ tree too. + * iface/gspn/gspn.cc, iface/gspn/ssp.cc: Fix style. + * src/sanity/80columns.test: Check the iface/ tree too. * iface/gspn/dcswaveltl.test, iface/gspn/dcswavefm.test, iface/gspn/dcswaveeltl.test, iface/gspn/udcsltl.test, diff --git a/iface/gspn/gspn.cc b/iface/gspn/gspn.cc index 772c37003..1fdd981d9 100644 --- a/iface/gspn/gspn.cc +++ b/iface/gspn/gspn.cc @@ -201,7 +201,7 @@ namespace spot assert(successors_); // GSPN is expected to return a looping "dead" transition where // there is no successor. - assert(size_> 0); + assert(size_ > 0); } virtual diff --git a/iface/gspn/ssp.cc b/iface/gspn/ssp.cc index 9d76888fe..9066ab73c 100644 --- a/iface/gspn/ssp.cc +++ b/iface/gspn/ssp.cc @@ -40,7 +40,7 @@ namespace spot assert(new_size); bdd* tmp = new bdd[new_size]; - for(int i = 0; i < size; i++) + for (int i = 0; i < size; i++) tmp[i] = t[i]; delete[] t; @@ -195,7 +195,7 @@ namespace spot ~tgba_succ_iterator_gspn_ssp() { - for(size_t i = 0; i < size_states_; i++) + for (size_t i = 0; i < size_states_; i++) delete state_array_[i]; delete[] bdd_array_; @@ -216,8 +216,8 @@ namespace spot virtual void first() { - if(!successors_) - return ; + if (!successors_) + return; current_succ_=0; } @@ -385,10 +385,10 @@ namespace spot state_array = (state**) realloc(state_array, (size_states + 1) * sizeof(state*)); state_array[size_states] = i->current_state(); - props_[nb_arc_props].arc->curr_state = size_states ; + props_[nb_arc_props].arc->curr_state = size_states; size_states++; - while (all_conds_ != bddfalse ) + while (all_conds_ != bddfalse) { cond = bdd_satone(all_conds_); cond = bdd_simplify(cond, cond | outside_); @@ -444,16 +444,16 @@ namespace spot for (j = 0; j < nb_arc_props; j++) { - for (conj = 0 ; conj < props_[j].nb_conj ; conj++) + for (conj = 0; conj < props_[j].nb_conj; conj++) free(props_[j].prop[conj]); free(props_[j].prop); } delete i; return new tgba_succ_iterator_gspn_ssp(succ_tgba_, size_tgba_, - bdd_array, state_array, - size_states, props_, - nb_arc_props); + bdd_array, state_array, + size_states, props_, + nb_arc_props); } bdd @@ -672,7 +672,7 @@ namespace spot if (old_state->left() && new_state->left() - && spot_inclusion(new_state->left(),old_state->left())) + && spot_inclusion(new_state->left(), old_state->left())) break; } } @@ -715,7 +715,7 @@ namespace spot if (old_state->left() && new_state->left() - && spot_inclusion(new_state->left(),old_state->left())) + && spot_inclusion(new_state->left(), old_state->left())) break; } } diff --git a/src/sanity/style.test b/src/sanity/style.test index 5e28210a9..cd2bd8458 100755 --- a/src/sanity/style.test +++ b/src/sanity/style.test @@ -21,79 +21,82 @@ export GREP_COLOR tmp=incltest.tmp -find "${INCDIR-..}" \( -name "${1-*}.hh" -o -name "${1-*}.cc" \) \ - -a -type f -a -print | -while read file; do - if grep 'GNU Bison' "$file" >/dev/null || +for dir in "${INCDIR-..}" "${INCDIR-..}"/../iface; do + + find "$dir" \( -name "${1-*}.hh" -o -name "${1-*}.cc" \) \ + -a -type f -a -print | + while read file; do + if grep 'GNU Bison' "$file" >/dev/null || grep 'generated by flex' "$file" >/dev/null ; then continue - fi + fi - fail=false + fail=false - sed 's,//.*,,' < $file > $tmp + sed 's,//.*,,' < $file > $tmp - grep '[ ]if(' $tmp && - diag 'Missing space after "if"' + grep '[ ]if(' $tmp && + diag 'Missing space after "if"' - grep '[ ]if (.*).*{' $tmp && - diag 'Opening { should be on its own line.' + grep '[ ]if (.*).*{' $tmp && + diag 'Opening { should be on its own line.' - grep '[ ]if (.*).*;' $tmp && - diag 'if body should be on another line.' + grep '[ ]if (.*).*;' $tmp && + diag 'if body should be on another line.' - grep '[ ]while(' $tmp && - diag 'Missing space after "while"' + grep '[ ]while(' $tmp && + diag 'Missing space after "while"' - grep '[ ]while (.*).*{' $tmp && - diag 'Opening { should be on its own line.' + grep '[ ]while (.*).*{' $tmp && + diag 'Opening { should be on its own line.' - grep '[ ]while (.*).*[^)];' $tmp && - diag 'while body should be on another line.' + grep '[ ]while (.*).*[^)];' $tmp && + diag 'while body should be on another line.' - grep '[ ]for(' $tmp && - diag 'Missing space after "for"' + grep '[ ]for(' $tmp && + diag 'Missing space after "for"' - grep '[ ]for (.*).*{' $tmp && - diag 'Opening { should be on its own line.' + grep '[ ]for (.*).*{' $tmp && + diag 'Opening { should be on its own line.' - grep '[ ]for (.*;.*;.*).*;' $tmp && - diag 'for body should be on another line.' + grep '[ ]for (.*;.*;.*).*;' $tmp && + diag 'for body should be on another line.' - grep '[ ]switch(' $tmp && - diag 'Missing space after "switch"' + grep '[ ]switch(' $tmp && + diag 'Missing space after "switch"' - grep '[ ]switch (.*).*{' $tmp && - diag 'Opening { should be on its own line.' + grep '[ ]switch (.*).*{' $tmp && + diag 'Opening { should be on its own line.' - grep '( ' $tmp && - diag 'No space after opening (.' + grep '( ' $tmp && + diag 'No space after opening (.' - grep ' )' $tmp && - diag 'No space before closing ).' + grep ' )' $tmp && + diag 'No space before closing ).' - grep '! ' $tmp && - diag 'No space after unary operators (!).' + grep '! ' $tmp && + diag 'No space after unary operators (!).' - grep ',[(a-zA-Z+=_!]' $tmp && - diag 'Space after coma.' + grep ',[(a-zA-Z+=_!]' $tmp && + diag 'Space after coma.' - grep '[^ ]&&[^ ]' $tmp && - diag 'Space arround binary operators.' + grep '[^ ]&&[^ ]' $tmp && + diag 'Space arround binary operators.' - grep '[^ ]||[^ ]' $tmp && - diag 'Space arround binary operators.' + grep '[^ ]||[^ ]' $tmp && + diag 'Space arround binary operators.' - grep '[ ]default:[^:].*;' $tmp && - diag 'Label should be on their own line.' + grep '[ ]default:[^:].*;' $tmp && + diag 'Label should be on their own line.' - grep '[ ]case.*:[^:].*;' $tmp && - diag 'Label should be on their own line.' + grep '[ ]case.*:[^:].*;' $tmp && + diag 'Label should be on their own line.' - grep '[ ];' $tmp && - diag 'No space before semicolon.' + grep '[ ];' $tmp && + diag 'No space before semicolon.' - $fail && echo "$file" >>failures + $fail && echo "$file" >>failures + done done if test -f failures; then