office-gobmx/bin/find-unused-typedefs.py
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

17 lines
536 B
Python
Executable file

#!/usr/bin/python
import subprocess
a = subprocess.Popen("git grep -P '^typedef\s+.+\s+\w+;' -- \"[!e][!x][!t]*\"", stdout=subprocess.PIPE, shell=True)
with a.stdout as txt:
for line in txt:
idx2 = line.rfind(";")
idx1 = line.rfind(" ", 0, idx2)
typedefName = line[idx1+1 : idx2]
if typedefName.startswith("*"):
typedefName = typedefName[1:]
# ignore anything less than 5 characters, it's probably a parsing error
if len(typedefName) > 4:
print typedefName