diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-16 16:08:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-18 11:02:45 +0000 |
commit | e592877844573fa5ab934b7ab3b13aaa33ed621d (patch) | |
tree | 37138edadc35f0fe1a4ee87bcce66e4d756af469 /compilerplugins/clang/unusedenumvalues.py | |
parent | 17d7ac5c1a06d29cbeeb3efd245ebf2e6725da12 (diff) |
loplugin:unusedenumvalues
Change-Id: Icf17f936ce6d07d0e152252833c8645cf9b1163b
Reviewed-on: https://gerrit.libreoffice.org/28942
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang/unusedenumvalues.py')
-rwxr-xr-x | compilerplugins/clang/unusedenumvalues.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/compilerplugins/clang/unusedenumvalues.py b/compilerplugins/clang/unusedenumvalues.py index f601275ca453..5e113da46439 100755 --- a/compilerplugins/clang/unusedenumvalues.py +++ b/compilerplugins/clang/unusedenumvalues.py @@ -15,9 +15,11 @@ excludedSourceFiles = set([ "sw/inc/toxe.hxx", "sw/inc/poolfmt.hxx", "sw/inc/hintids.hxx", + "vcl/inc/unx/XIM.h", ]) excludedTypes = set([ - "SwVarFormat", "RES_FIELDS", "SwFillOrder", "SwIoDetect", "SwDocumentSettingsPropertyHandles" + "SwVarFormat", "RES_FIELDS", "SwFillOrder", "SwIoDetect", "SwDocumentSettingsPropertyHandles", + "SalGenericDataType", "SwDateSubFormat", "XclFutureRecType", "ds_status", "MediaCommand", ]) # clang does not always use exactly the same numbers in the type-parameter vars it generates @@ -54,11 +56,10 @@ for k, definitions in sourceLocationToDefinitionMap.iteritems(): untouchedSet = set() for d in definitionSet: clazz = d[0] + " " + d[1] - if clazz in exclusionSet: - continue if d in touchSet: continue - srcLoc = definitionToSourceLocationMap[d]; + srcLoc = definitionToSourceLocationMap[d] + srcLocWithoutLineNo = srcLoc.split(":")[0] # ignore external source code if (srcLoc.startswith("external/")): continue @@ -77,8 +78,12 @@ for d in definitionSet: or srcLoc.startswith("include/typelib/") or srcLoc.startswith("include/uno/")): continue - if srcLoc in excludedSourceFiles or d[0] in excludedTypes: + if srcLocWithoutLineNo in excludedSourceFiles or d[0] in excludedTypes: + continue + # structure definitions + if srcLoc.startswith("lotuswordpro/"): continue + # used in templates to find the last member of an enum if d[1] == "LAST" or d[1].endswith("_END"): continue |