X-Git-Url: https://git.libav.org/?p=libav.git;a=blobdiff_plain;f=tools%2Fpatcheck;h=65beca9db93e46454604a3157b6b71e0f0287aab;hp=ac4de1aea558cd8ae128ddbeba61c8c82268d932;hb=f55e1812d016610839ea09740eb3f3ea535b81d6;hpb=be3e68b277328b996d87272e2454ff7fc023b0b6 diff --git a/tools/patcheck b/tools/patcheck index ac4de1aea5..65beca9db9 100755 --- a/tools/patcheck +++ b/tools/patcheck @@ -66,6 +66,8 @@ hiegrep '#(el|)if *(0|1)' 'useless #if' $* hiegrep 'if *\( *(0|1) *\)' 'useless if()' $* hiegrep '& *[a-zA-Z0-9_]* *\[ *0 *\]' 'useless & [0]' $* hiegrep '(\( *[0-9] *(&&|\|\|)|(&&|\|\|) *[0-9] *\))' 'overriding condition' $* +hiegrep '(:\+|,|;)( *|static|\*)*'"$ERE_PRITYP"' *\*( |\*)*(src|source|input|in[^a-z])' 'missing const?' $* +hiegrep '(:\+|,|;)( *|static|\*)*'"$ERE_PRITYP"' *(src|source|input|in)([0-9A-Z_][0-9A-Za-z_]*){1,} *\[' 'missing const (test2)?' $* hiegrep2 '\.long_name *=' 'NULL_IF_CONFIG_SMAL' 'missing NULL_IF_CONFIG_SMAL' $* @@ -74,14 +76,14 @@ hiegrep2 '\.long_name *=' 'NULL_IF_CONFIG_SMAL' 'missing NULL_IF_CONFIG_SMAL' $* hiegrep2 "$ERE_TYPES" '(static|av_|ff_|typedef|:\+[^a-zA-Z_])' 'Non static with no ff_/av_ prefix' $* -hiegrep ':\+[^}]*else' 'missing } prior to else' $* +hiegrep ':\+[^}#]*else' 'missing } prior to else' $* #FIXME this should print the previous statement maybe hiegrep ':\+ *{ *$' '{ should be on the same line as the related previous statement' $* rm $TMP -for i in `grep -H '^+.*@param' $*| sed 's/^\([^:]*\):.*@param *\([a-zA-Z0-9_]*\) .*$/\1:\2/'` ; do +for i in `grep -H '^+.*@param' $*| sed 's/^\([^:]*\):.*@param\(\[.*\]\|\) *\([a-zA-Z0-9_]*\) .*$/\1:\3/'` ; do doxpar=`echo $i | sed 's/^.*:\(.*\)$/\1/'` file=`echo $i | sed 's/^\([^:]*\):.*$/\1/'` grep " *$doxpar *[),]" $file | grep -v '@param' >/dev/null || grep --color=always "@param *$doxpar" $file >>$TMP @@ -91,7 +93,7 @@ if test -e $TMP ; then cat $TMP fi -egrep -B2 $OPT '^(\+|) *'"$ERE_TYPES" $* | egrep -A2 --color=always '(:|-)\+.*[^/]/(\*([^*]|$)|/([^/]|$))' > $TMP && echo -e "\n Non doxy comments" +egrep -B2 $OPT '^(\+|) *('"$ERE_TYPES"'|# *define)' $* | egrep -A2 --color=always '(:|-)\+[^/]*/(\*([^*]|$)|/([^/]|$))' > $TMP && echo -e "\n Non doxy comments" cat $TMP rm $TMP