Revision 3d8f9025 tools/patcheck

View differences:

tools/patcheck
23 23
    cat $TMP
24 24
}
25 25

  
26
hiegrep2(){
27
    arg="$1"
28
    varg="$2"
29
    msg="$3"
30
    shift 3
31
    grep $OPT '^+' $* | grep -v ':+++' | egrep -v -- "$varg" | egrep --color=always -- "$arg" > $TMP && echo -e "\n$msg"
32
    cat $TMP
33
}
34

  
26 35
hiegrep '[[:space:]]$'    'trailing whitespace' $*
27 36
hiegrep "`echo x | tr 'x' '\t'`"         'tabs' $*
28 37
#hiegrep ':\+$'          'Empty lines' $*
......
32 41
hiegrep '/\*[-<\* ]*\*/'  'empty comment' $*
33 42
hiegrep 'for *\( *'"$ERE_PRITYP"' '  'not gcc 2.95 compatible' $*
34 43

  
35
egrep $OPT '^\+(int|unsigned|static|void)[a-zA-Z0-9 _]*(init|end)[a-zA-Z0-9 _]*\(.*[^;]$' $* | grep -v 'av_cold'> $TMP && echo -e '\nThese functions may need av_cold, please review the whole patch for similar functions needing av_cold'
36
cat $TMP
44
hiegrep2 '(int|unsigned|static|void)[a-zA-Z0-9 _]*(init|end)[a-zA-Z0-9 _]*\(.*[^;]$' '(av_cold|:\+[^a-zA-Z_])' 'These functions may need av_cold, please review the whole patch for similar functions needing av_cold' $*
37 45

  
38 46
hiegrep '\+= *1 *;'     'can be simplified to ++' $*
39 47
hiegrep '-= *1 *;'      'can be simplified to --' $*
......
58 66
hiegrep '& *[a-zA-Z0-9_]* *\[ *0 *\]' 'useless & [0]' $*
59 67
hiegrep '(\( *[0-9] *(&&|\|\|)|(&&|\|\|) *[0-9] *\))' 'overriding condition' $*
60 68

  
61

  
62
egrep $OPT '^\+.*\.long_name *=' $*| grep -v 'NULL_IF_CONFIG_SMAL'> $TMP && echo -e '\nmissing NULL_IF_CONFIG_SMAL'
63
cat $TMP
69
hiegrep2 '\.long_name *=' 'NULL_IF_CONFIG_SMAL' 'missing NULL_IF_CONFIG_SMAL' $*
64 70

  
65 71
#egrep $OPT '^\+.*const ' $*| grep -v 'static'> $TMP && echo -e '\nnon static const'
66 72
#cat $TMP
67 73

  
68
egrep $OPT '^\+'"$ERE_TYPES" $*| grep ':+[a-zA-Z]' | egrep -v '(static|av_|ff_|typedef)'> $TMP && echo -e '\nNon static with no ff_/av_ prefix'
69
cat $TMP
74
hiegrep2 "$ERE_TYPES" '(static|av_|ff_|typedef|:\+[^a-zA-Z_])' 'Non static with no ff_/av_ prefix' $*
70 75

  
71 76
hiegrep ':\+[^}]*else' 'missing } prior to else' $*
72 77

  

Also available in: Unified diff