office-gobmx/bin/find-unused-defines.awk
Noel Grandin 53f16c39f5 remove unused typedefs and inline use-once typedefs
and improve the script a little

Change-Id: I2792ea4dd5df3a50736fbe209225c3f16fb86b84
Reviewed-on: https://gerrit.libreoffice.org/20033
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-18 10:38:08 +00:00

19 lines
493 B
Awk

{
x++
y=$0
}
END {
tmp = substr(y, 0, index(y, ":")-1)
if (x==1) print "sed -i '/[[:space:]]" p1 "[[:space:]]/d' " tmp
# mark these as potential places to inline a constant
if (x==2) print "#inline " p1 " " tmp
}
# | xargs -P 4 -Ixxx sh -c "git grep -w 'xxx' | awk '{ x++; y=\$0 } END { if (x==1) print y }' && echo \"xxx\" 1>&2"
# sed -i '' '/pattern/d'
# | awk 'arr[$0]++ END { for (i in arr) { if(arr[i]==1) print i } }' \
# | awk -f find-unused-defines.awk