summaryrefslogtreecommitdiff
path: root/bin/find-unused-typedefs.py
diff options
context:
space:
mode:
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