summaryrefslogtreecommitdiffstats
path: root/bin/find-unused-typedefs.py
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-18 10:12:08 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-18 10:38:08 +0000
commit53f16c39f5c4c69ab603bf9098daec71f7a0acb8 (patch)
tree00b3166ecff36bb55dcf0b8c2122a08b72656ab5 /bin/find-unused-typedefs.py
parentClean up (diff)
downloadcore-53f16c39f5c4c69ab603bf9098daec71f7a0acb8.tar.gz
core-53f16c39f5c4c69ab603bf9098daec71f7a0acb8.zip
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>
Diffstat (limited to 'bin/find-unused-typedefs.py')
-rwxr-xr-xbin/find-unused-typedefs.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/find-unused-typedefs.py b/bin/find-unused-typedefs.py
index e261d13e546b..e292f097526a 100755
--- a/bin/find-unused-typedefs.py
+++ b/bin/find-unused-typedefs.py
@@ -2,12 +2,13 @@
import subprocess
-a = subprocess.Popen("git grep -P '^typedef\s+.+\w+;' -- \"[!e][!x][!t]*\"", stdout=subprocess.PIPE, shell=True)
+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:
- idx1 = line.rfind(" ")
- typedefName = line[idx1+1 : len(line)-2]
+ 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