annotate TOOLS/checktree.sh @ 25190:ac0406c340b3

add test for deprecated and obsolete functions
author ivo
date Fri, 30 Nov 2007 22:52:56 +0000
parents 993062afb229
children b72103c6f21c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
1 #!/bin/sh
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
2
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
3 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
4
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
5 # Check source-tree for anomalies
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
6 #
23940
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
7 # Copyright (C) 2005-2007 by Ivo van Poorten
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
8 #
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
9 # This program is free software; you can redistribute it and/or modify
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
10 # it under the terms of the GNU General Public License as published by
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
11 # the Free Software Foundation; either version 2 of the License, or
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
12 # (at your option) any later version.
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
13 #
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
14 # This program is distributed in the hope that it will be useful,
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
17 # GNU General Public License for more details.
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
18 #
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
19 # You should have received a copy of the GNU General Public License
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
20 # along with this program; if not, write to the Free Software
1b3e61a77754 Update copyright info and license
ivo
parents: 23939
diff changeset
21 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
22 #
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
23 # Thanks to Melchior Franz of the FlightGear project for the original idea
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
24 # of a source-tree checker and Torinthiel for the feedback along the way.
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
25
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
26 # $Id$
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
27
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
28 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
29
23948
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
30 # All yes/no flags. Spaces around flagnames are important!
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
31
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
32 testflags=" spaces extensions crlf tabs trailws rcsid oll charset stupid gnu \
25190
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
33 res depr"
23948
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
34 allflags="$testflags showcont color head svn "
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
35
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
36 # Default settings
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
37
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
38 _spaces=yes
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
39 _extensions=yes
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
40 _crlf=yes
23235
0e8285c7b2fa test for tab characters
ivo
parents: 23233
diff changeset
41 _tabs=no
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
42 _trailws=no
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
43 _rcsid=no
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
44 _oll=no
18087
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
45 _charset=no
19085
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
46 _stupid=no
17131
80d3fdcf58a8 option to show the lines containing anomalies, patch by Ivo van Poorten
wanderer
parents: 16405
diff changeset
47 _showcont=no
23927
91ccac9cc015 Add test for GNUisms
ivo
parents: 23235
diff changeset
48 _gnu=no
23935
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
49 _res=no
25190
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
50 _depr=no
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
51
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
52 _color=yes
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
53 _head=yes
19077
e3f7f221f75e CVS --> Subversion
ivo
parents: 18087
diff changeset
54 _svn=yes
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
55 _files=
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
56
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
57 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
58
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
59 # Avoid locale problems
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
60
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
61 export LC_ALL=C
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
62
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
63 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
64
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
65 # Helper functions
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
66
23949
26db94620073 Shorten (un)setting of all test flags
ivo
parents: 23948
diff changeset
67 set_all_tests() {
26db94620073 Shorten (un)setting of all test flags
ivo
parents: 23948
diff changeset
68 for i in $testflags ; do
26db94620073 Shorten (un)setting of all test flags
ivo
parents: 23948
diff changeset
69 eval _$i=$1
26db94620073 Shorten (un)setting of all test flags
ivo
parents: 23948
diff changeset
70 done
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
71 }
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
72
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
73 printoption() {
23951
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
74 test -n "$3" && def=$3 || eval def=\$_$1
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
75 echo " -(no)$1 $2 [default: $def]"
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
76 }
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
77
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
78 printhead() {
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
79 test "$_head" = "yes" && echo -e "$COLB$1$COLE"
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
80 }
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
81
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
82 all_filenames() {
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
83 test "$_files" != "" && echo "$_files" && return
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
84
20204
97fbe96274c3 Use = instead of == for extra portability.
diego
parents: 19085
diff changeset
85 if [ "$_svn" = "no" ]; then
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
86 find . -type f \
19077
e3f7f221f75e CVS --> Subversion
ivo
parents: 18087
diff changeset
87 | grep -v "\.\#\|\~$\|\.depend\|\/\.svn\/\|config.mak\|^\./config\.h" \
19078
4361813f6cae also omit configure.log and the generated help_mp.h from files to check
ivo
parents: 19077
diff changeset
88 | grep -v "^\./version\.h\|\.o$\|\.a$\|configure.log\|^\./help_mp.h"
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
89 else
22361
eec955510da7 do not rely on svn internals and use svn info instead
ivo
parents: 22359
diff changeset
90 svn info -R | sed -n '/Path:/bb; :a; d; b; :b; s/Path: /.\//; h; :c; n;
eec955510da7 do not rely on svn internals and use svn info instead
ivo
parents: 22359
diff changeset
91 /Node Kind:/bd; bc; :d; /directory/ba; g; p;'
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
92 fi
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
93 }
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
94
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
95 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
96
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
97 # Parse command line
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
98
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
99 for i in "$@"; do
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
100 case "$i" in
22359
206b4600a956 also respond to --help, -h and -? command line options
ivo
parents: 22358
diff changeset
101 -help|--help|-h|-\?)
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
102 echo -e "\n$0 [options] [files]\n"
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
103 echo -e "options:\n"
23951
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
104 printoption "spaces " "test for spaces in filenames"
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
105 printoption "extensions" "test for uppercase extensions"
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
106 printoption "crlf " "test for MSDOS line endings"
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
107 printoption "tabs " "test for tab characters"
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
108 printoption "trailws " "test for trailing whitespace"
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
109 printoption "rcsid " "test for missing RCS Id's"
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
110 printoption "oll " "test for overly long lines"
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
111 printoption "charset " "test for wrong charset"
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
112 printoption "stupid " "test for stupid code"
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
113 printoption "gnu " "test for GNUisms"
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
114 printoption "res " "test for reserved identifiers"
25190
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
115 printoption "depr " "test for deprecated function calls"
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
116 echo
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
117 printoption "all " "enable all tests" "no"
22357
131563493cc4 clarify -none command line option
ivo
parents: 20204
diff changeset
118 echo " (-noall can be specified as -none)"
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
119 echo
23951
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
120 printoption "showcont " "show offending content of file(s)"
17131
80d3fdcf58a8 option to show the lines containing anomalies, patch by Ivo van Poorten
wanderer
parents: 16405
diff changeset
121 echo
23951
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
122 printoption "color " "colored output"
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
123 printoption "head " "print heading for each test"
22509
b65e001a3e68 fix forgotten \
ivo
parents: 22361
diff changeset
124 printoption "svn " \
23951
993062afb229 Make the printoption function take the default values from the variable
ivo
parents: 23950
diff changeset
125 "use svn info to determine which files to check"
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
126 echo -e "\nIf no files are specified, the whole tree is traversed."
19077
e3f7f221f75e CVS --> Subversion
ivo
parents: 18087
diff changeset
127 echo -e "If there are, -(no)svn has no effect.\n"
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
128 exit
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
129 ;;
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
130 -all)
23949
26db94620073 Shorten (un)setting of all test flags
ivo
parents: 23948
diff changeset
131 set_all_tests yes
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
132 ;;
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
133 -noall)
23949
26db94620073 Shorten (un)setting of all test flags
ivo
parents: 23948
diff changeset
134 set_all_tests no
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
135 ;;
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
136 -none)
23949
26db94620073 Shorten (un)setting of all test flags
ivo
parents: 23948
diff changeset
137 set_all_tests no
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
138 ;;
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
139 -*)
23948
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
140 var=`echo X$i | sed 's/^X-//'`
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
141 val=yes
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
142 case "$var" in
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
143 no*)
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
144 var=`echo "$var" | cut -c 3-`
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
145 val=no
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
146 ;;
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
147 esac
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
148 case "$allflags" in
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
149 *\ $var\ *)
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
150 eval _$var=$val
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
151 ;;
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
152 *)
23950
68af8ad58a8f cosmetics, indentation
ivo
parents: 23949
diff changeset
153 echo "unknown option: $i" >&2
68af8ad58a8f cosmetics, indentation
ivo
parents: 23949
diff changeset
154 exit 0
68af8ad58a8f cosmetics, indentation
ivo
parents: 23949
diff changeset
155 ;;
23948
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
156 esac
66a261a0e0f2 Much smaller command line parser
ivo
parents: 23940
diff changeset
157 ;;
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
158 *)
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
159 _files="$_files $i"
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
160 ;;
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
161 esac
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
162 done
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
163
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
164 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
165
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
166 # Set heading color
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
167
20204
97fbe96274c3 Use = instead of == for extra portability.
diego
parents: 19085
diff changeset
168 if [ "$_color" = "yes" ]; then
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
169 COLB="\e[36m"
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
170 COLE="\e[m"
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
171 else
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
172 COLB=""
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
173 COLE=""
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
174 fi
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
175
19077
e3f7f221f75e CVS --> Subversion
ivo
parents: 18087
diff changeset
176 # Generate filelist once so -svn isn't _that_ much slower than -nosvn anymore
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
177
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
178 filelist=`all_filenames`
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
179
25190
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
180 if [ "$_stupid" = "yes" -o "$_res" = "yes" -o "$_depr" = "yes" ] ; then
23935
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
181 # generate 'shortlist' to avoid false positives in xpm files, docs, etc,
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
182 # when one only needs to check .c and .h files
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
183 chfilelist=`echo $filelist | tr ' ' '\n' | grep "[\.][ch]$"`
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
184 fi
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
185
20204
97fbe96274c3 Use = instead of == for extra portability.
diego
parents: 19085
diff changeset
186 if [ "$_showcont" = "yes" ]; then
18087
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
187 _diffopts="-u"
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
188 _grepopts="-n -I"
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
189 else
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
190 _diffopts="-q"
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
191 _grepopts="-l -I"
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
192 fi
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
193
23936
c0b23a73d5f1 10l, forgot to make TAB global
ivo
parents: 23935
diff changeset
194 TAB=`echo " " | tr ' ' '\011'`
c0b23a73d5f1 10l, forgot to make TAB global
ivo
parents: 23935
diff changeset
195
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
196 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
197
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
198 # DO CHECKS
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
199
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
200 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
201
20204
97fbe96274c3 Use = instead of == for extra portability.
diego
parents: 19085
diff changeset
202 if [ "$_spaces" = "yes" ]; then
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
203 printhead "checking for spaces in filenames ..."
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
204 find . | grep " "
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
205 fi
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
206
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
207 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
208
20204
97fbe96274c3 Use = instead of == for extra portability.
diego
parents: 19085
diff changeset
209 if [ "$_extensions" = "yes" ]; then
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
210 printhead "checking for uppercase extensions ..."
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
211 echo $filelist | grep "\.[[:upper:]]\+$" | grep -v "\.S$"
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
212 fi
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
213
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
214 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
215
20204
97fbe96274c3 Use = instead of == for extra portability.
diego
parents: 19085
diff changeset
216 if [ "$_crlf" = "yes" ]; then
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
217 printhead "checking for MSDOS line endings ..."
19079
0ba020beb2e4 fix matching of MSDOS line endings
ivo
parents: 19078
diff changeset
218 CR=`echo " " | tr ' ' '\015'`
0ba020beb2e4 fix matching of MSDOS line endings
ivo
parents: 19078
diff changeset
219 grep $_grepopts "$CR" $filelist
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
220 fi
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
221
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
222 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
223
23235
0e8285c7b2fa test for tab characters
ivo
parents: 23233
diff changeset
224 if [ "$_tabs" = "yes" ]; then
0e8285c7b2fa test for tab characters
ivo
parents: 23233
diff changeset
225 printhead "checking for TAB characters ..."
0e8285c7b2fa test for tab characters
ivo
parents: 23233
diff changeset
226 grep $_grepopts "$TAB" $filelist
0e8285c7b2fa test for tab characters
ivo
parents: 23233
diff changeset
227 fi
0e8285c7b2fa test for tab characters
ivo
parents: 23233
diff changeset
228
0e8285c7b2fa test for tab characters
ivo
parents: 23233
diff changeset
229 # -----------------------------------------------------------------------------
0e8285c7b2fa test for tab characters
ivo
parents: 23233
diff changeset
230
20204
97fbe96274c3 Use = instead of == for extra portability.
diego
parents: 19085
diff changeset
231 if [ "$_trailws" = "yes" ]; then
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
232 printhead "checking for trailing whitespace ..."
18087
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
233 grep $_grepopts "[[:space:]]\+$" $filelist
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
234 fi
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
235
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
236 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
237
20204
97fbe96274c3 Use = instead of == for extra portability.
diego
parents: 19085
diff changeset
238 if [ "$_rcsid" = "yes" ]; then
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
239 printhead "checking for missing RCS \$Id\$ or \$Revision\$ tags ..."
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
240 grep -L -I "\$\(Id\|Revision\)[[:print:]]\+\$" $filelist
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
241 fi
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
242
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
243 # -----------------------------------------------------------------------------
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
244
20204
97fbe96274c3 Use = instead of == for extra portability.
diego
parents: 19085
diff changeset
245 if [ "$_oll" = "yes" ]; then
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
246 printhead "checking for overly long lines (over 79 characters) ..."
18087
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
247 grep $_grepopts "^[[:print:]]\{80,\}$" $filelist
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
248 fi
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
249
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
250 # -----------------------------------------------------------------------------
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
251
23927
91ccac9cc015 Add test for GNUisms
ivo
parents: 23235
diff changeset
252 if [ "$_gnu" = "yes" ]; then
91ccac9cc015 Add test for GNUisms
ivo
parents: 23235
diff changeset
253 printhead "checking for GNUisms ..."
91ccac9cc015 Add test for GNUisms
ivo
parents: 23235
diff changeset
254 grep $_grepopts "case.*\.\.\..*:" $filelist
91ccac9cc015 Add test for GNUisms
ivo
parents: 23235
diff changeset
255 fi
91ccac9cc015 Add test for GNUisms
ivo
parents: 23235
diff changeset
256
91ccac9cc015 Add test for GNUisms
ivo
parents: 23235
diff changeset
257 # -----------------------------------------------------------------------------
91ccac9cc015 Add test for GNUisms
ivo
parents: 23235
diff changeset
258
23937
00d78036f96b only test for stupid code and reserved identifiers if there are any .c or .h
ivo
parents: 23936
diff changeset
259 if [ "$_res" = "yes" -a -n "$chfilelist" ]; then
23935
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
260 printhead "checking for reserved identifiers ..."
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
261 grep $_grepopts "#[ $TAB]*define[ $TAB]\+_[[:upper:]].*" $chfilelist
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
262 grep $_grepopts "#[ $TAB]*define[ $TAB]\+__.*" $chfilelist
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
263 fi
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
264
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
265 # -----------------------------------------------------------------------------
b4a1d0cf4c11 Test for reserved identifiers.
ivo
parents: 23927
diff changeset
266
20204
97fbe96274c3 Use = instead of == for extra portability.
diego
parents: 19085
diff changeset
267 if [ "$_charset" = "yes" ]; then
18087
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
268 printhead "checking bad charsets ..."
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
269 for I in $filelist ; do
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
270 case "$I" in
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
271 ./help/help_mp-*.h)
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
272 ;;
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
273 ./DOCS/*)
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
274 ;;
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
275 *.c|*.h)
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
276 iconv -c -f ascii -t ascii "$I" | diff $_diffopts "$I" -
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
277 ;;
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
278 esac
edffd6f8a022 add check for non-ascii charsets used in code and simplify showcont switch handling
reimar
parents: 17131
diff changeset
279 done
16240
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
280 fi
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
281
d4cf25d45b13 Script to check (CVS) source-tree for anomalies, like MSDOS line endings etc..
ivo
parents:
diff changeset
282 # -----------------------------------------------------------------------------
19085
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
283
23937
00d78036f96b only test for stupid code and reserved identifiers if there are any .c or .h
ivo
parents: 23936
diff changeset
284 if [ "$_stupid" = "yes" -a -n "$chfilelist" ]; then
19085
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
285 printhead "checking for stupid code ..."
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
286
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
287 for i in calloc malloc realloc memalign av_malloc av_mallocz faad_malloc \
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
288 lzo_malloc safe_malloc mpeg2_malloc _ogg_malloc; do
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
289 printhead "--> casting of void* $i()"
23939
f85dd30807a3 cosmetics, break overly long lines
ivo
parents: 23938
diff changeset
290 grep $_grepopts "([ $TAB]*[a-zA-Z_]\+[ $TAB]*\*.*)[ $TAB]*$i" \
f85dd30807a3 cosmetics, break overly long lines
ivo
parents: 23938
diff changeset
291 $chfilelist
19085
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
292 done
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
293
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
294 for i in "" signed unsigned; do
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
295 printhead "--> usage of sizeof($i char)"
23939
f85dd30807a3 cosmetics, break overly long lines
ivo
parents: 23938
diff changeset
296 grep $_grepopts "sizeof[ $TAB]*([ $TAB]*$i[ $TAB]*char[ $TAB]*)" \
f85dd30807a3 cosmetics, break overly long lines
ivo
parents: 23938
diff changeset
297 $chfilelist
19085
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
298 done
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
299
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
300 for i in int8_t uint8_t; do
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
301 printhead "--> usage of sizeof($i)"
23938
0239a594ec45 replace ^I by $TAB now that TAB is global
ivo
parents: 23937
diff changeset
302 grep $_grepopts "sizeof[ $TAB]*([ $TAB]*$i[ $TAB]*)" $chfilelist
19085
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
303 done
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
304
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
305 printhead "--> usage of &&1"
23938
0239a594ec45 replace ^I by $TAB now that TAB is global
ivo
parents: 23937
diff changeset
306 grep $_grepopts "&&[ $TAB]*1" $chfilelist
19085
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
307
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
308 printhead "--> usage of ||0"
23938
0239a594ec45 replace ^I by $TAB now that TAB is global
ivo
parents: 23937
diff changeset
309 grep $_grepopts "||[ $TAB]*0" $chfilelist
19085
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
310
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
311 # added a-fA-F_ to eliminate some false positives
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
312 printhead "--> usage of *0"
23939
f85dd30807a3 cosmetics, break overly long lines
ivo
parents: 23938
diff changeset
313 grep $_grepopts "[a-zA-Z0-9)]\+[ $TAB]*\*[ $TAB]*0[^.0-9xa-fA-F_]" \
f85dd30807a3 cosmetics, break overly long lines
ivo
parents: 23938
diff changeset
314 $chfilelist
19085
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
315
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
316 printhead "--> usage of *1"
23939
f85dd30807a3 cosmetics, break overly long lines
ivo
parents: 23938
diff changeset
317 grep $_grepopts "[a-zA-Z0-9)]\+[ $TAB]*\*[ $TAB]*1[^.0-9ea-fA-F_]" \
f85dd30807a3 cosmetics, break overly long lines
ivo
parents: 23938
diff changeset
318 $chfilelist
19085
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
319
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
320 printhead "--> usage of +0"
23939
f85dd30807a3 cosmetics, break overly long lines
ivo
parents: 23938
diff changeset
321 grep $_grepopts "[a-zA-Z0-9)]\+[ $TAB]*+[ $TAB]*0[^.0-9xa-fA-F_]" \
f85dd30807a3 cosmetics, break overly long lines
ivo
parents: 23938
diff changeset
322 $chfilelist
19085
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
323
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
324 printhead "--> usage of -0"
23939
f85dd30807a3 cosmetics, break overly long lines
ivo
parents: 23938
diff changeset
325 grep $_grepopts "[a-zA-Z0-9)]\+[ $TAB]*-[ $TAB]*0[^.0-9xa-fA-F_]" \
f85dd30807a3 cosmetics, break overly long lines
ivo
parents: 23938
diff changeset
326 $chfilelist
19085
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
327 fi
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
328
e5ec659ec1c6 added checks for stupid code like casting return value of malloc and friends,
ivo
parents: 19083
diff changeset
329 # -----------------------------------------------------------------------------
25190
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
330
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
331 if [ "$_depr" = "yes" -a -n "$chfilelist" ]; then
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
332 printhead "checking for deprecated and obsolete function calls ..."
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
333
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
334 for i in bcmp bcopy bzero getcwd getipnodebyname inet_ntoa inet_addr \
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
335 atoq ecvt fcvt ecvt_r fcvt_r qecvt_r qfcvt_r finite ftime gcvt herror \
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
336 hstrerror getpass getpw getutent getutid getutline pututline setutent \
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
337 endutent utmpname gsignal ssignal gsignal_r ssignal_r infnan memalign \
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
338 valloc re_comp re_exec drem dremf dreml rexec svc_getreq sigset \
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
339 sighold sigrelse sigignore sigvec sigmask sigblock sigsetmask \
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
340 siggetmask ualarm ulimit usleep statfs fstatfs ustat get_kernel_syms \
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
341 query_module sbrk
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
342 do
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
343 printhead "--> $i()"
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
344 grep $_grepopts "[^a-zA-Z0-9]$i[ $TAB]*(" $chfilelist
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
345 done
ac0406c340b3 add test for deprecated and obsolete functions
ivo
parents: 23951
diff changeset
346 fi