]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/dtracy/lint.rc
aux/realemu: run cpuproc in same fd group as fileserver
[plan9front.git] / sys / src / cmd / dtracy / lint.rc
1 #!/bin/rc
2 # check for full switch statements
3
4 nl='
5 '
6 nodetypes=`''{sed -n '/OINVAL/,/}/ s/,//p' dat.h | sed 's/[     ]*//g; /^$/d' | sort | grep -v '^OINVAL$'}
7 switches=`$nl{grep -n '/\*nodetype\*/' *.[ch]}
8 for(l in $switches){
9         f=`:{echo $l}
10         a=`$nl{sed -n $f(2)^'s/[^       ].*//p' $f(1)}
11         comm -23 <{echo $nodetypes} <{sed -n $f(2)^',/^'^$a^'}/ s/^'^$a^'case ([^:]*):.*/\1/p' $f(1) | sort} | sed -n 's/.+/'^$f(1)^':'^$f(2)^' missing &/p'
12 }
13
14 oper=`''{sed -n '/OPINVAL/,/}/ s/,//p' dat.h | sed 's/[         ]*//g; /^$/d' | sort | grep -v '^OPINVAL$'}
15 switches=`$nl{grep -n '/\*oper\*/' *.[ch]}
16 for(l in $switches){
17         f=`:{echo $l}
18         a=`$nl{sed -n $f(2)^'s/[^       ].*//p' $f(1)}
19         comm -23 <{echo $oper} <{sed -n $f(2)^',/^'^$a^'}/ s/^'^$a^'case ([^:]*):.*/\1/p' $f(1) | sort} | sed -n 's/.+/'^$f(1)^':'^$f(2)^' missing &/p'
20 }