Merge
authorAlpar Juttner <alpar@cs.elte.hu>
Wed, 22 Oct 2008 14:37:43 +0100
changeset 3432f5c0c42a5cd
parent 337 0fbbb4bc42dd
parent 341 d900fd1e760f
child 344 3f9f3550dbf5
Merge
scripts/unify-sources.sh
     1.1 --- a/lemon/bfs.h	Mon Oct 20 20:03:14 2008 +0200
     1.2 +++ b/lemon/bfs.h	Wed Oct 22 14:37:43 2008 +0100
     1.3 @@ -51,7 +51,7 @@
     1.4      typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
     1.5      ///Instantiates a PredMap.
     1.6  
     1.7 -    ///This function instantiates a PredMap.
     1.8 +    ///This function instantiates a PredMap.  
     1.9      ///\param g is the digraph, to which we would like to define the
    1.10      ///PredMap.
    1.11      static PredMap *createPredMap(const Digraph &g)
    1.12 @@ -80,8 +80,7 @@
    1.13  
    1.14      ///The type of the map that indicates which nodes are reached.
    1.15  
    1.16 -    ///The type of the map that indicates which nodes are reached.
    1.17 -    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    1.18 +    ///The type of the map that indicates which nodes are reached.///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
    1.19      typedef typename Digraph::template NodeMap<bool> ReachedMap;
    1.20      ///Instantiates a ReachedMap.
    1.21  
     2.1 --- a/lemon/list_graph.h	Mon Oct 20 20:03:14 2008 +0200
     2.2 +++ b/lemon/list_graph.h	Wed Oct 22 14:37:43 2008 +0100
     2.3 @@ -840,8 +840,8 @@
     2.4        explicit Arc(int pid) { id = pid;}
     2.5  
     2.6      public:
     2.7 -      operator Edge() const { 
     2.8 -        return id != -1 ? edgeFromId(id / 2) : INVALID; 
     2.9 +      operator Edge() const {
    2.10 +        return id != -1 ? edgeFromId(id / 2) : INVALID;
    2.11        }
    2.12  
    2.13        Arc() {}
     3.1 --- a/lemon/smart_graph.h	Mon Oct 20 20:03:14 2008 +0200
     3.2 +++ b/lemon/smart_graph.h	Wed Oct 22 14:37:43 2008 +0100
     3.3 @@ -464,8 +464,8 @@
     3.4        explicit Arc(int id) { _id = id;}
     3.5  
     3.6      public:
     3.7 -      operator Edge() const { 
     3.8 -        return _id != -1 ? edgeFromId(_id / 2) : INVALID; 
     3.9 +      operator Edge() const {
    3.10 +        return _id != -1 ? edgeFromId(_id / 2) : INVALID;
    3.11        }
    3.12  
    3.13        Arc() {}
     4.1 --- a/scripts/unify-sources.sh	Mon Oct 20 20:03:14 2008 +0200
     4.2 +++ b/scripts/unify-sources.sh	Wed Oct 22 14:37:43 2008 +0100
     4.3 @@ -88,13 +88,24 @@
     4.4  function check_action() {
     4.5      if ! diff -q $1 $2 >/dev/null
     4.6      then
     4.7 -	echo -n " [$3 failed]"
     4.8 +	echo
     4.9 +	echo -n "      $3 failed at line(s): "
    4.10 +	echo -n $(diff $1 $2 | grep '^[0-9]' | sed "s/^\(.*\)c.*$/ \1/g" | 
    4.11 +	          sed "s/,/-/g" | paste -s -d',')
    4.12  	FAILED=YES
    4.13      fi
    4.14  }
    4.15  
    4.16  function check_warning() {
    4.17 -    echo -n " [$2 warning]"
    4.18 +    echo
    4.19 +    if [ "$2" == 'long lines' ]
    4.20 +    then
    4.21 +        echo -n "      $2 warning at line(s): "
    4.22 +        echo -n $(grep -n -E '.{81,}' $1 | sed "s/^\([0-9]*\)/ \1\t/g" | 
    4.23 +                  cut -f 1 | paste -s -d',')
    4.24 +    else
    4.25 +        echo -n "      $2 warning"
    4.26 +    fi
    4.27      WARNED=YES
    4.28  }
    4.29  
    4.30 @@ -212,7 +223,7 @@
    4.31      TMP_FILE=`mktemp`
    4.32      cat $1 | sed -e 's/ \+$//g' >$TMP_FILE
    4.33  
    4.34 -    "$ACTION"_action "$TMP_FILE" "$1" 'spaces'
    4.35 +    "$ACTION"_action "$TMP_FILE" "$1" 'trailing spaces'
    4.36  }
    4.37  
    4.38  function long_lines_check() {
    4.39 @@ -225,7 +236,7 @@
    4.40  # process the file
    4.41  
    4.42  function process_file() {
    4.43 -    echo -n "    $ACTION " $1...
    4.44 +    echo -n "    $ACTION $1..."
    4.45  
    4.46      CHECKING="header tabs spaces long_lines"
    4.47  
    4.48 @@ -265,7 +276,7 @@
    4.49    --werror|-w
    4.50       Make all warnings into errors.
    4.51    --all|-a
    4.52 -     All files in the repository will be checked.
    4.53 +     Check all source files in the repository.
    4.54    --modified|-m
    4.55       Check only the modified (and new) source files. This option is
    4.56       useful to check the modification before making a commit.
    4.57 @@ -281,36 +292,36 @@
    4.58    --help|-h
    4.59       Print this help message.
    4.60    files
    4.61 -     The files to check/unify. If no file names are given, the
    4.62 -     modified source will be checked/unified
    4.63 -
    4.64 +     The files to check/unify. If no file names are given, the modified
    4.65 +     source files will be checked/unified (just like using the
    4.66 +     --modified|-m option).
    4.67  "
    4.68          exit 0
    4.69      elif [ "$1" == '--dry-run' ] || [ "$1" == '-n' ]
    4.70      then
    4.71 -	[ -n "$ACTION" ] && echo "Invalid option $1" >&2 && exit 1
    4.72 +	[ -n "$ACTION" ] && echo "Conflicting action options" >&2 && exit 1
    4.73  	ACTION=check
    4.74      elif [ "$1" == "--all" ] || [ "$1" == '-a' ]
    4.75      then
    4.76 -	[ -n "$FILES" ] && echo "Invalid option $1" >&2 && exit 1
    4.77 +	[ -n "$FILES" ] && echo "Conflicting target options" >&2 && exit 1
    4.78  	FILES=all_files
    4.79      elif [ "$1" == "--changed" ] || [ "$1" == '-c' ]
    4.80      then
    4.81 -	[ -n "$FILES" ] && echo "Invalid option $1" >&2 && exit 1
    4.82 +	[ -n "$FILES" ] && echo "Conflicting target options" >&2 && exit 1
    4.83  	FILES=changed_files
    4.84      elif [ "$1" == "--modified" ] || [ "$1" == '-m' ]
    4.85      then
    4.86 -	[ -n "$FILES" ] && echo "Invalid option $1" >&2 && exit 1
    4.87 +	[ -n "$FILES" ] && echo "Conflicting target options" >&2 && exit 1
    4.88  	FILES=modified_files
    4.89      elif [ "$1" == "--interactive" ] || [ "$1" == "-i" ]
    4.90      then
    4.91 -	[ -n "$WARNING" ] && echo "Invalid option $1" >&2 && exit 1
    4.92 +	[ -n "$WARNING" ] && echo "Conflicting warning options" >&2 && exit 1
    4.93  	WARNING='INTERACTIVE'
    4.94      elif [ "$1" == "--werror" ] || [ "$1" == "-w" ]
    4.95      then
    4.96 -	[ -n "$WARNING" ] && echo "Invalid option $1" >&2 && exit 1
    4.97 +	[ -n "$WARNING" ] && echo "Conflicting warning options" >&2 && exit 1
    4.98  	WARNING='WERROR'
    4.99 -    elif [ $(echo $1 | cut -c 1) == '-' ]
   4.100 +    elif [ $(echo x$1 | cut -c 2) == '-' ]
   4.101      then
   4.102  	echo "Invalid option $1" >&2 && exit 1
   4.103      else