first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / buildor / find_one_word_comments.sh
1 #!/bin/bash
2 # this finds any one-word commented items, which are often a sign of a formal
3 # parameter that was commented out because it's unused.  that's a suboptimal
4 # way to fix the compiler warning for some people, and so this will find any
5 # occurrences of the "wrong"ish way.
6 # (one different way that some think is more optimal is to use the formal()
7 # macro to hide the function definition.)
8
9 SOURCES_FOUND_LIST="$(mktemp "$TMP/sources_found.XXXXXX")"
10
11 source $SHELLDIR/build/seek_all_source.sh $*
12   # got a list of source files now.
13
14 function examine_file {
15   file="$1"
16   matches="$(sed -n -e 's/\/\*[a-z_A-Z][a-z_A-Z0-9]*\*\//yo/p' <"$file")"
17   if [ ! -z "$matches" ]; then echo "$file"; fi
18 }
19
20 while read line_found; do
21   if [ $? != 0 ]; then break; fi
22   examine_file "$line_found"
23 done <"$SOURCES_FOUND_LIST"
24
25 rm "$SOURCES_FOUND_LIST"
26